3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: 1 [2]

Author Topic: Simple TreeShader (for 6.41+)  (Read 4320 times)

« Reply #15 on: June 22, 2010, 04:40:13 PM »
Thanks shadmar...I have no lights in my level yet....here are the files so you can take a look.
« Reply #16 on: June 23, 2010, 01:26:16 AM »
Seems to work fine.
However the shader will use a default directional light if no sunlight object is present at vector 0,0,-1 (I think).. If you don't want any directional light (only amibient)

Replace this this under the pixelshader :


   float3 finalcolor = (lightAmbient+shadow)*color.xyz +
       Lighting.x*(color*lightColor.xyz*Lighting.y+SpecIntesity*Lighting.z);

With this :
 
    float3 finalcolor = (lightAmbient+shadow)*color.xyz;
 

« Reply #17 on: June 23, 2010, 08:27:57 AM »
Thanks shadmar! Place a sunlight helped a lot. But relaceing the code as suggested removed all wanted light...thanks
Pages: 1 [2]