Create celshade in program

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
Bady
Halfling
Posts: 52
Joined: Sun Mar 16, 2014 1:47 am
x 3

Create celshade in program

Post by Bady »

Hy.

I tried to make cel shade but I failed. I read a lot of tutorial about that, Like this:
http://www.ogre3d.org/tikiwiki/tiki-ind ... CelShading




I have this line in the plugins.cfg:
Plugin=Plugin_CgProgramManager

And I set the object materialname.

The cel shade is working in my computer, because some demo (Without source code of course :( ) working.
The basic tutorial in the ogredsk not working either, it throw an exeption: "Unable to start program.... some destination...Sample_celshading.dll"

Please someone tell me how to make cel shade. And if it possible, only with c++ code. I mean how to do without "random" files, because I want to make custom colored lines, and with this files I can't, just only predefined colors.

Pc:
Ogredsk 1.8
Win 7 64 bit
Visual Atudio 2010


this code load the texture for all object:

Code: Select all



bool Mainscene::loadtexture(string nev)
{

	Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create(nev, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
	
	mTextureustate=mat->getTechnique(0)->getPass(0)->createTextureUnitState(nev+".png");
	
	

	mEntity->setMaterialName("cs");
	//mSubentity = mEntity->getSubEntity(0);
	//enum ShaderParam { SP_SHININESS = 1, SP_DIFFUSE, SP_SPECULAR };

	//mSubentity->setCustomParameter(SP_SHININESS, Ogre::Vector4(10, 0, 0, 0));
    //mSubentity->setCustomParameter(SP_DIFFUSE, Ogre::Vector4(0, 0.5, 0, 1));
    //mSubentity->setCustomParameter(SP_SPECULAR, Ogre::Vector4(0.3, 0.5, 0.3, 1));



return true;
}
Bady
Halfling
Posts: 52
Joined: Sun Mar 16, 2014 1:47 am
x 3

Re: Create celshade in program

Post by Bady »

In time I solve the problem. But the result is wery odd:
Image

I try with that tutorial, what i linked in the first post, and i ty with this codes too what i found here:
http://www.ogre3d.org/forums/viewtopic.php?f=2&t=63593
the result is always the same.
Bady
Halfling
Posts: 52
Joined: Sun Mar 16, 2014 1:47 am
x 3

Re: Create celshade in program

Post by Bady »

In time i solve the problem. But thanks. :)
User avatar
tod
Troll
Posts: 1394
Joined: Wed Aug 02, 2006 9:41 am
Location: Bucharest
x 94
Contact:

Re: Create celshade in program

Post by tod »

Maybe you could tell others what the problem was and how you solved it, and also mark the thread as solved.
Bady
Halfling
Posts: 52
Joined: Sun Mar 16, 2014 1:47 am
x 3

Re: Create celshade in program

Post by Bady »

Hy!

Actually, i not solve the problem yet.
I found the cg book on the Nvidia webpage, and started to read it.
Post Reply