Transparent textures again!
Hello!
There is a lot of questions and answers about transparency in DirectX 8.
As I understand, there is no way to use color keys to do transparent textures.
So I have to use alpha channel.
OK.
See following situation:
I have the first texture used as a render target, where I want to render some primitives.
And now I want to render this texture to backbuffer USING TRANSPARENCY, but specified texture has no alpha channel filled.
Maybe I can modify this alpha channel, but render target textures are not lockable.
I also have tryied to create another texture, where I CopyRects specified texture, update alpha channel and CopyRects back, but this method doesn't work, becaouse of error returned in CopyRects.
So HOW TO RENDER TRANSPARENT TEXTURES??? ...how to dynamically create transparent textures???
Please help!
Many thanx!!!
Rada
Edited by - radarada on January 3, 2002 11:18:41 AM
You mention color keys ...
Look into the D3DRS_ALPHATESTENABLE, D3DRS_ALPHAREF and D3DRS_ALPHAFUNC flags of the device render state. Also check out the Bulletin Board sample to see how it brands the ''black'' background of the tree textures as transparent without any special tricks.
This could be off the mark, I''m *not* sure if that will work when transfering a texture to another, or if it only works when rendering a frame for the display, but I''m curious if it may if you set the appropriate flags first prior to doing your texture manipulation. Worth some experimentation at least.
Look into the D3DRS_ALPHATESTENABLE, D3DRS_ALPHAREF and D3DRS_ALPHAFUNC flags of the device render state. Also check out the Bulletin Board sample to see how it brands the ''black'' background of the tree textures as transparent without any special tricks.
This could be off the mark, I''m *not* sure if that will work when transfering a texture to another, or if it only works when rendering a frame for the display, but I''m curious if it may if you set the appropriate flags first prior to doing your texture manipulation. Worth some experimentation at least.
I find the DX8 texture tool very useful for transparent texturing.
All the info is there in the SDK and it''s surprisingly well written.
~~tim
------------------------------
www.live3d.btinternet.co.uk
All the info is there in the SDK and it''s surprisingly well written.
~~tim
------------------------------
www.live3d.btinternet.co.uk
you may be able to use the texture cascade/pixel shaders to do what you want... similiar to using lightmaps, but have no intermediate colours (just white/black = transparent/no transparent)...
but I dont think it''s gonna be easy :o you''ve tried most of the things I would
Jack;
but I dont think it''s gonna be easy :o you''ve tried most of the things I would
Jack;
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement