Skip to main content
GameDev.net gamedev.net
🔒 Locked

Perez function with alpha ?

Started by Mythar Jan 24, 2007 at 12:41 PM 1 replies 850+ views
Original Post
Mythar
Mythar
Im useing the PerezFunction to color my GradientSkyDome, I was wondering how to add an Alpha value to the color, so that I can fade in a background star map ?
Lord_Evil
Lord_Evil
I don't know the perez function, but if you're using shaders, apply your alpha depending on the color/brightness of a pixel or vertex. Remember that color is a 4 component (rgba) vector (float4 in Cg). The 4th component (a) is your alpha component.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
y2kiah
y2kiah
just a quick thought but do you even need the alpha component to accomplish this? If your starmap is essentially black, you could use additive blending based on source and destination color to add the sky color on top of the star map. As the sky color becomes darker by time of day or altitude, more of the stars will show through.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.