source code of shader

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
skumar
Posts: 201
Joined: Thu Feb 14, 2008 6:24 pm
Location: kerala state india
Contact:

source code of shader

Post by skumar »

Hi,
On which source code file i can get the source of the Lightmapping shader?
I am not good at source mining but i really need that for study...
Any helps appreciated...

thanks in advance...
skumar
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: source code of shader

Post by serengeor »

http://en.wikipedia.org/wiki/Lightmap
I don't think you need a shader for this technique of lighting since lights are baked into textures (?)

PS. Why do you put "..." after most of your sentences?
Working on game: Marrbles (Currently stopped).
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Re: source code of shader

Post by shadowslair »

@skumar: AFAIK Irrlicht is not using a shader for the lightmap materials. It`s using some blend states for this, as its extremely easy. But, in a shader you`ll simply need a color sampler texture and a lightmap sampler texture, usually 2 texturecoordinate sets, which you pass from the vertex to the pixel shader and you do:

Code: Select all

float4 finalColor = sampledTextureColor * sampledLightMapColor;
return finalColor; 
Can`t be easier than that. Well, some extremely basic shader knowledge is needed though.
serengeor wrote:PS. Why do you put "..." after most of your sentences?
He does this because recently there`s a shortage of "."-s in the forum because of this guy, who never puts single periods in his posts: http://irrlicht.sourceforge.net/forum/v ... =1&t=44772
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: source code of shader

Post by serengeor »

shadowslair wrote:
serengeor wrote:PS. Why do you put "..." after most of your sentences?
He does this because recently there`s a shortage of "."-s in the forum because of this guy, who never puts single periods in his posts: http://irrlicht.sourceforge.net/forum/v ... =1&t=44772
Oh, That makes sense now :)
Working on game: Marrbles (Currently stopped).
skumar
Posts: 201
Joined: Thu Feb 14, 2008 6:24 pm
Location: kerala state india
Contact:

Re: source code of shader

Post by skumar »

Thank you shadowslair and all others for helping me....
serengeor.... i put a lot of dots simply to show the flow rather than a stop...
like when we speak....

everything in the life is flowing...why dont that happen when you write also....

bye .....
skumar
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: source code of shader

Post by serengeor »

skumar wrote:Thank you shadowslair and all others for helping me....
serengeor.... i put a lot of dots simply to show the flow rather than a stop...
like when we speak....

everything in the life is flowing...why dont that happen when you write also....

bye .....
I was taught otherwise at school. :wink:
Working on game: Marrbles (Currently stopped).
Post Reply