Sign in to follow this  
ramy

transparent bump mapping effect

Recommended Posts

hey guys, i am using the bump mapping shader from : http://www.pieterg.com/Tutorials/bump_normal.php and im getting it working fone. but i wanted to add an alpha value to it. meaning that i want it to be alittle transparent yet with bump map! can somebody help me out on this! thx in advanced. [Edited by - ramy on November 4, 2005 5:23:14 PM]

Share this post


Link to post
Share on other sites
Check out these tutorials on CodeSampler. There are a couple of them on alpha-blending, so that should set you on your way.

I'm not quite sure what you want exactly, but if you just want the object to be transparent, just modify the alpha component of your output color in the pixel shader. Also, enable the ALPHABLENDENABLE renderstate, and you should be good.

Share this post


Link to post
Share on other sites
I'm assuming that you want to do is to make your entire model (or rendered object) consistently transparent with bump-mapping. If what you mean is that only certain parts are transparent or you have varying transparency, the following would need to be modified (ex. like using an alpha texture or something). Anyway, on the to answer:
You are probably using a pixel shader to draw your object. This returns a 4x4 color float. That is, ARBG. You want to create a value (either static or variable) for the alpha channel. For instance, if you set this to 0.5 you will get 50% transparency. Next, you need to enable alpha-blending. I wont go into exactly how to set that up here, but it's not hard to find (EDIT: Refer to what circlesoft said above). Finally, you might want to consider how this is going to affect the appearance of your rendered model, because if you do not have backface culling on it may reveal an effect you're not quite looking for. On the other hand, if you do disable backface culling ( ie. CullMode = None; in your shader pass) for this effect, you must consider that you're increasing your draw call by all the backfacing triangles -- which can potentially double the triangles rendered.

(NOTE: This will be a pure "see-through" effect. If you want something like a glassy effect, you will also need to include refraction and the like.)
Feel free to reply with any questions. I appologize for any mistakes -- it's late [wink]

Share this post


Link to post
Share on other sites
that is my goal, to get the entire object transparent, of semi-transparent. so i guess i have to difflde arround with the alpha value in the color in the shaders. but my problem is, i dont have any handout, or article or anything that tells me the keywords to use in shaders. :( if anybody has such thing, please point me out to it please.

i need it for instance, to set the alphablendenabled in the shader to true, and all of these things.

thx

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this