Page 1 of 1

source code of shader

Posted: Mon Sep 12, 2011 2:38 pm
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...

Re: source code of shader

Posted: Mon Sep 12, 2011 3:16 pm
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?

Re: source code of shader

Posted: Mon Sep 12, 2011 5:33 pm
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

Re: source code of shader

Posted: Mon Sep 12, 2011 7:55 pm
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 :)

Re: source code of shader

Posted: Tue Sep 13, 2011 6:01 am
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 .....

Re: source code of shader

Posted: Tue Sep 13, 2011 6:42 am
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: