Advertisement Jump to content
Sign in to follow this  
TheSeb

question about HLSL possibilities

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

Hi, in a pixel shader, i have the pixel's color and i want to write this color to another texel which i have the coordinates. Is it possible with the HLSL ? because it is not the case with GLSL...

Share this post


Link to post
Share on other sites
Advertisement
It's not possible with either because your Pixel Shader calculates the output for this and only this pixel. If you could change the pixels location, parallel processing wouldn't be possible.

Share this post


Link to post
Share on other sites
In stream processing terms, you're talking about a "scatter" operation which isn't currently possible in a single pass on modern GPUs. Incidentally scatter can be implemented through dependent texture reads (albeit possibly in multiple passes). Do a google search for "stream scatter GPU" or something and you'll probably find more info. If not, check out GPGPU.org.

[Edit] I almost forgot - there's also a good chapter in GPU Gems 2 about it... see page 515 and onward.

Share this post


Link to post
Share on other sites
The problem is that the hardware is set up to write data for a specific pixel at the point where it's shaded -- if writing could go to any pixel, the latencies would be much higher, and performance much lower.

Share this post


Link to post
Share on other sites
Yes totally possible. All you need is a tangent-space matrix and a normal map. Parallax mapping itself is 3 lines of shader assembly and 1 line of HLSL if you're already doing per-pixel normal mapping.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!