Controlling transparency

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Wiz
Posts: 7
Joined: Sat May 20, 2006 8:22 pm

Controlling transparency

Post by Wiz »

First of all, I've gone through all the tutorials and I've browsed the forums, with no luck in figuring out my problem.

The problem is simple enough. I'm trying to use shaders to simulate the effects of water:

Image

It looks fine enough from a distance (a little too transparent, but otherwise fine), however, when you get closer to the surface of the water the transparency starts fading:
Image

By the time you're by the waterline, the water has disappeared altogether.

Is there a way to turn this off and make the transparency consistent? And is there a way in general to control just how transparent my mesh is supposed to be, instead of just settling with the default "Pretty damn transparent"?

I'd really appreciate any help you can offer. :)
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

I'm not really sure, but if you have a look at the shader demo (example 10) you'll see that the transparency depands to the brightnes of the texture...
Watch the two rotating (shaded) cubes...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Wiz
Posts: 7
Joined: Sat May 20, 2006 8:22 pm

Post by Wiz »

Acki wrote:I'm not really sure, but if you have a look at the shader demo (example 10) you'll see that the transparency depands to the brightnes of the texture...
Watch the two rotating (shaded) cubes...
I've tried using a darker texture, it's slightly less transparent but retains the same problem with fading when I approach it.
Post Reply