Jump to content
  • Advertisement
Sign in to follow this  
BillCruse

Sample RenderTarget texture problem

This topic is 4850 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

Sorry for my English. I do some things as follows: 1. Create two render-target texture S(scene) and B(bump). 2. Render scene to S texture. 3. Render some objects(object's texture only has red and green) to B texture. 4. Use B to offset S's texcoord for producing distort effect. (I used ps 2.0) In shader,sample B is ok,But use B(texcoord) to sample S don't correct for some pixel. I change S to normal texture (I read data from image file.) do step 3~4 ,result is ok. Who can tell me,how to solve the problem. //DirectX 9.0c //Geforce 5200 Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Hi,

did you try debugging your shader in Visual Studio and see the exact values you read? Maybe that could help you find the soultion. Also, if you post some relevant parts of your source code, we could help you better!
Hope you will find your bug..

kp


Share this post


Link to post
Share on other sites
Thx your reply!!

My Vs and PS codes as follws:
////////////////////
vs_2_0
dcl_position0 v0;
dcl_position1 v1;
mov oPos,v0;
mov oT0.xy,v1;
///////////////////
//c0 [scale_x,scale_y,0,0] => scale bump offset
ps_2_0;
dcl_2d s0; //Scene Texture(ocean box)
dcl_2d s1; //Bump Texture(four spheres)
dcl t0;
dcl t1;
texld r0,t0,s1;
mad r0.xy,r0,c0,t0;
texld r0,r0,s0;
mov oC0,r0;
///////////////////

if "S"(ocean box) and "B"(four spheres) are RenderTarget,result is as follows:
http://61.63.96.118/error.jpg

Then I changed "S" to normal texture(read data from image file),result is as follows:
http://61.63.96.118/ok.jpg

I don't use two rendertarget texture at the same time?

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!