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

Dynamic contour plotting in pixel shader 2.0

Started by rob35 Aug 20, 2011 at 7:10 AM 0 replies 1.7k views
Original Post
rob35
rob35
Hello,

I registered an account at this wonderful site to hopefully get help with my problem: I need to do exactly what this guy needed to. The last post in that thread was him asking how to rewrite the code for SM 2.0, which I need to do. The fwidth function that the other poster uses generates an error in ps_2_0.

Computing line vertices is not an option for me - I am blending flat textures together that are mapped to a color palette to visualize gridded data. (This is entirely 2D, but you can think of the value at each spot in the texture as the third dimension) Basically, I am visualizing a dataset as an animation: each frame represents each hour. The program interpolates between data frames in the shader and is therefore showing something different at every screen update. I can't compute the lines that fast (30-60FPS), which is why I must do it in the shader.

Like the guy in the thread I linked to tried, if I just fill a range with color, it is too wide/thin at times. I'm not sure if I can get the effect I want (constant width pixels) unless the shader can compare its output at one pixel to the output at the next. SM 2 isn't letting me use any of the ddx/ddy functions to do this.

Shader model 2 is the maximum I can use for this project: can anybody help me get dynamic constant width contours on top of these textures?

Thank you very much; I appreciate the help!

~Rob

Topic Locked

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

Sign in to reply to this topic.