Horde3D
http://horde3d.org/forums/

Shader Trouble
http://horde3d.org/forums/viewtopic.php?f=2&t=112
Page 1 of 1

Author:  SpOOky [ 20.05.2007, 14:32 ]
Post subject:  Shader Trouble

I have 2 objects that are sharing the same shader. Basically a duplicated
skybox shader. I the bad thing is that i`m getting this strange effect:


Image


It seems that when overlapped the mesh closer to the camera gets a 50% transparency and the color channel is added to the one thats underneath, making the first one look brighter.

Even worst, this also happens to overlapping faces of the same model:

Image


How do I fix this?

Or can you please, Nic, write a simple shader that i could use with no lighting? I am in the early stages of learning glsl, and this is way over my level. This snag keeps me from moving on into development.

Paul

Author:  marciano [ 20.05.2007, 22:06 ]
Post subject: 

This looks like additive blending. I think your shader is correct, it is probably a problem with the shader context. I have just realized that the skybox shader defines the LIGHTING context although AMBIENT would be better. Please make sure that your context is AMBIENT.

Which shader contexts are used is defined in the pipeline.xml file. The command ForEachLight_DrawGeometry automatically uses additive blending (this will be changed soon so that you can configure blending manually). In the default Chicago sample there is also a call DrawGeometry which draws the scene without blending using some sort of ambient lighting. So if you have defined a shader context LIGHTING for your shader and don't have the AMBIENT context, the geometry is just added to the scene and you get the effect shown in your screenshots.

Author:  SpOOky [ 21.05.2007, 10:54 ]
Post subject: 

Thanks! That did it! Back to work now

Image

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/