Skip to main content
GameDev.net gamedev.net
🔒 Locked

same texture for read and render?

Started by DuckMaestro Jul 5, 2004 at 7:33 PM 0 replies 450+ views
Original Post
DuckMaestro
DuckMaestro
i am wondering if it is possible (in dx9 and ps13+) to use a renderable texture as a source texture as well as the render target at the same time during the execution of a single pixel shader? my intent is to be able to draw images using different blending modes other than simple transparency... i wish to be able to draw images using add, multiply, hue, etc... thx -duck
Duck
neneboricua19
neneboricua19
Quote:
Original post by DuckMaestro
i am wondering if it is possible (in dx9 and ps13+) to use a renderable texture as a source texture as well as the render target at the same time during the execution of a single pixel shader?

Although D3D will not flag this as an error (the Debug Runtime will generate a warning, however), on most hardware, this produces "unexpected results". Depending on the hardware, driver, position of the moon, alignment of the planets, and whether or not you've made your daily sacrifice to the programming gods, this may or may not work. Both ATI and NVIDIA technical relations representatives have advised against attempting to do this in discussions in the DirectXDev mailing list because the results are not guaranteed to be consistant. If you talk to driver people about doing this, they will cringe and curse your name. :)

There is usually a way to achieve the same result by rendering to texture first and then performing another pass. The blending modes in D3D are pretty flexible. If you're using pixel shaders, then blending is even simpler. What is it you're trying to do? Perhaps people on the board could suggest alternative approaches.

neneboricua

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.