Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Shader kills lighting...  (Read 831 times)
tom_namibia
Customers
Community Member
*****
Posts: 176


WWW
« on: February 22, 2010, 03:12:49 AM »

Hi,

I successfully wrote my first shader, based on Zak's HeightBasedLandscape.fx to add some color to my landscape textures depending on the elevation.
Thanks Zak for this very helpful demo :-)

But now my lighting is gone...

The landscape looks as if it switched back to
Mesh.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_NONE)

Does a shader deactivates a  Mesh.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_MANAGED)?

What must I do to keep the LightingMode?

Regards,
Tom

Logged
Shadowsong
Customers
Community Member
*****
Posts: 328


« Reply #1 on: February 22, 2010, 08:43:57 AM »

You'll probably don't like the answer...

Using your own shader means you cannot use TV's internal lighting any more. Any kind of lighting you want to have must be computed in your own shader.

Basically, TV's lighting simply is a shader. By using your own shader, you override TV's one. So unfortunately there is no way to combine TV's light with a custom shader.

But it is not as hard as you may think. Standard lighting is pretty simple.

See Zak's tutorial for standard Blinn/Phong lighting shader:

http://wiki.truevision3d.com/tutorialsarticlesandexamples/programming_hlsl_shaders5

« Last Edit: February 22, 2010, 08:45:38 AM by Shadowsong » Logged
tom_namibia
Customers
Community Member
*****
Posts: 176


WWW
« Reply #2 on: February 22, 2010, 09:05:37 AM »

Quote
You'll probably don't like the answer...

 Tongue
Quote
But it is not as hard as you may think. Standard lighting is pretty simple.
Smiley

I will test it now. Thx shadowsong.

Tom
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks