Jump to content
  • Advertisement
Sign in to follow this  
Halsafar

Gradient a texture

This topic is 4870 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How are you suppose to apply a gradient to a texture. Mainly a greyscale cloud texture, I wish to fade blue around the dome the texture is wrapped on, except leaves the clouds in the texture untouched. I'm not quite sure where to start. Would this be more plausable with a pixel shader?

Share this post


Link to post
Share on other sites
Advertisement
I think it's easier when you use multitexturing. Use the blueish gradient as the base texture and the clouds as second. This way you can implement moving clouds later on.

As to your question:
Definitely use a pixel shader and use maybe the alpha mask of the cloud texture (or the cloud pixels right away) to blend sky and clouds together (black replaced by blue, gray with maybe 50% blue and 50%gray, white left untouched).

Share this post


Link to post
Share on other sites
Indeed, you have stated what I was somewhat theorizing.

Is it okay to use several different pixel shaders in one game?
Since I am very unfamiliar with ps/vs I am just curious if it is okay to have a few ps/vs loaded to use for different rendering.

Share this post


Link to post
Share on other sites
I believe you can use a few different ps/vs in the same game. I'm looking at using them in a game i'm working on, but am still working on finding out how to actually use them and write them. Its gonna be a long trip.

Share this post


Link to post
Share on other sites
LoL indeed.
I have been researching many articles found admist the pages of gamedev.net here.
I have started with Vertex shader and found it to be a nice mystery in a box.

After reading several poorly written articles on here, jumping between msdn and these articles backed up with other articles I have been able to achieve a rather moderate learning curve.

I still haven't gotten anything set and working tho :)



To answer this thread for myself: I am going to use a pixel shader, 4 textures. they will be 2 Cloud textures, 1 color gradient, 1 star field. Blending will be achieved based on the color gradient which will go from light-blue to dark-blue (almost black) in the course of the game... I believe pixel shader is the only way to achieve this look with flexibility and speed. Getting the gradiant to look its darkest above the player will be a fun task :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!