Jump to content
  • Advertisement
Sign in to follow this  

Dynamic contour plotting in pixel shader 2.0

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


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!


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!