View Full Version : DX9 Alpha Transparency
ElysiumGX 01-29-2006, 05:20 PM I use one of the DirectX9 Factory Presets from Netview for Pixel Lighting. I simply plug in my Normal, Color, and Specular maps. It gives me an idea of how my object will look in a game, such as Quake4.
Here is my usual setup.
http://www.elysiumvisions.com/images/self/SelfDX9.jpg
Now I'm curious if anyone knows of a way to use the Alpha Channel of the Color map to control transparency. This would be helpful in creating textured faces to use as hair. I've tried a few things, but I'm not a programmer, and have no idea what I'm doing. I found documentation on how to do this with OpenGL blending, but not DX9. Is there another arrangement of nodes I can use, and keep saved as a preset?
|
|
adam|zeliasz
02-04-2006, 11:48 PM
Did you ever figure this out?
adam|zeliasz
02-04-2006, 11:57 PM
Im still trying to learn how to use real time shaders. Im using XSI v5, which preset did you use to have then render tree layout like that with the normal map channel?
softmonkey
02-05-2006, 01:20 AM
In reply to the the first question if you open the fragment(pixel) shader you will see a bunch of code...
at the bottom, before the "return outcolor;" line you need to make the following addition so you end up with this as the last few lines of your main function....
//...
outcolor = Ambient + Diffuse + Specular; // this line might be slightly different depending on which shader you edit
outcolor.a = difmap.a ;
return outcolor;
}
Here we are fetching the alpha channel from the texture and writing it out to the result. So the line to add is "outcolor.a = difmap.a ;"
Then in the DXDraw node you can enable blending and choose "source alpha" and "inverted source alpha". You may also want to play with the culling modes as well.
that should to it. Save a preset so you don't need to do it again. This is made really simple through the netview interface - just click on the link "Add Prest" and fill out the form.
ElysiumGX
02-07-2006, 03:56 AM
Oh, replies.
adam|zeliasz: that setup is a present under Netview. I described which one in the first post. I haven't found time to learn the shaders.
to answer your question, no. But, I did find out how to render all my maps correctly, including the normal map, using Mental Ray. I used the D3_Normalmap shader, and it rendered properly. I also mixed a Constant image in to create a glow map. It's not realtime, but it's close enough and looks great. It'll help now that I'm creating more advanced game models for the next gen engines.
softmonkey: that looks too simple. I'll give it a try soon and see how it works. thanks for the advice. if it works, I'll definately save a preset.
CGTalk Moderation
02-07-2006, 03:56 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.