TextureBlending & Light

BlitzMax Forums/MiniB3D Module/TextureBlending & Light

Banshee(Posted 2008) [#1]
Hello Scooby Gang! I need some help investigating the machievillain world of texture blending!

I've got this planet, and this sun, and they're both happy with each other, the planet is comprised of a texture layer for the surface, and 2 additional texture layers applied using blend mode 3, the 'ghosting' effect.

The problem is that on the dark side of my planet the clouds are still being drawn in full brightness, to some extent I can turn a blind eye and pretend it's the atsmosphere trapping in light - I was almost willing to let it slide, until I coded solar eclipses in from other planetary objects using negative light.

So now i'm stuck, and I dont quite know what to do to hide my clouds on the dark side of the planet.

Has anyone else achieved a cloud effect they are happy with?



I'd be grateful for any suggestions of things to try, so that the people of planet Zorgion can live under my regime of darkness and persecution.

Thanks :).


Banshee(Posted 2008) [#2]
YAY fixed it, sometimes I swear asking the question is more important than getting an answer :).


boomboom(Posted 2008) [#3]
Can you post a brief explination of how you solved it? I don't personally need it, but it helps future searchers etc.


Banshee(Posted 2008) [#4]
Here's a video
http://uk.youtube.com/watch?v=08Xsx3NqEqI

I went one step further than just solving the clouds, instead of using the multiply operator I used the and operator on the blend, the result is like a weather system - it's really neet.

To support doing this without getting the base texture of the entity tangled up with the fancy weather effect I created a second entity with the same vertice/position/rotation etc data as the planet.

The textures where then applied with alpha.

The Blitz manual advises staying away from alpha when doing multi-texturing so I can only hope that it will be OK on all graphics cards for now - otherwise I may have to code an alternative effect, but i'll worry about that when I start alpha testing.


simonh(Posted 2008) [#5]
That advice probably isn't relevent anymore, virtually all cards should be fine with alpha blending now.