Horde3D

Next-Generation Graphics Engine
It is currently 13.05.2024, 08:21

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Shader Trouble
PostPosted: 20.05.2007, 14:32 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 20.05.2007, 22:06 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 21.05.2007, 10:54 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
Thanks! That did it! Back to work now

Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group