www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: fireside on April 08, 2009, 03:51:23 am

Title: shaders
Post by: fireside on April 08, 2009, 03:51:23 am
I just read the shader entry in the wiki.  I don't know anything about this yet, but I was wondering how you assign a shader to a certain texture, like a bump map?
Title: Re: shaders
Post by: EgonOlsen on April 08, 2009, 07:14:43 am
You don't assign it directly to a texture. You assign it to the pipeline, i.e. you enable your shader and it's used on all polygons from there on until you disable it. To use a texture in a shader, it has to be assigned to a texture stage (jPCT does this for you) and you have to make your shader know it (that's your part). There are a lot of GLSL examples and tutorials that show how to do it.
Title: Re: shaders
Post by: fireside on April 08, 2009, 03:03:20 pm
I'll see if I can find some GLSL tutorials on the net, then.
Title: Re: shaders
Post by: EgonOlsen on June 06, 2009, 01:24:31 pm
I've added some demo code for a simple normal mapping shader to the wiki.