Sign in to follow this  
mohandes_philip

get texture from Render Target

Recommended Posts

hi I have a question about texturing : I have a render target that some quads with non-square textures(texture with transparent color) render to it. Then i make another quad and set it's texture as render target's texture . When I render second quad in screen , transparent regions rendered as black color. How can i fix it...? let me explain my problem better: I want to make a tile layer that it's size is greater than screen dimentions. I want to put this tile layer on screen. for this i load a texture for tiles. this texture have some tiles with transparent regions. Then i makes quads as much as tiles and set their texture coordinates properly. After this i render tile quads with map data to a "render target" that is my tile layer. After this process i make a quad with screen dimention and set it's texture from render target's texture. then i render this quad to screen but after rendering transparent regions rendered as black. How can i fix it...? Thanks. [Edited by - mohandes_philip on November 28, 2008 10:47:08 PM]

Share this post


Link to post
Share on other sites
RDragon1    1205
Is the texture your rendering to writing alpha to the dest? Does it even have an alpha channel? Are you writing the correct alpha value for use in blending later? Are you writing color?

Are you rendering with alpha blending turned on during the 2nd pass?

Lots of stuff to try debugging.

Use PIX to help debug your render states and make sure stuff is what you expect it is when rendering.

Share this post


Link to post
Share on other sites
Quote:
Original post by RDragon1
Is the texture your rendering to writing alpha to the dest? Does it even have an alpha channel? Are you writing the correct alpha value for use in blending later? Are you writing color?

Are you rendering with alpha blending turned on during the 2nd pass?

Lots of stuff to try debugging.

Use PIX to help debug your render states and make sure stuff is what you expect it is when rendering.


yes. i have set alpha test and alpha blender. i have not any problem
with transparent textures. my problem is when i want to use
render target texture.

thank you.

Share this post


Link to post
Share on other sites
This happens to me all the time. Usually you are doing one of two things; not setting setting the new texture for the second pass, or the first pass isnt actually rendering anything.

First try a simple test to make sure the texture is actually being set for the second pass: clear the target, before the first pass, to something like rgb(255,0,0,1).. then in the sendin pass you can see if the texture is red or black.. if black then you are not setting the texture properly on the device.

If it is red, then you know you are not rendering anything in the first pass.

Share this post


Link to post
Share on other sites
Quote:
Original post by Matt Aufderheide
This happens to me all the time. Usually you are doing one of two things; not setting setting the new texture for the second pass, or the first pass isnt actually rendering anything.

First try a simple test to make sure the texture is actually being set for the second pass: clear the target, before the first pass, to something like rgb(255,0,0,1).. then in the sendin pass you can see if the texture is red or black.. if black then you are not setting the texture properly on the device.

If it is red, then you know you are not rendering anything in the first pass.


hi
i mean transparent region are black not all the region.

thank you.

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