• Advertisement

rob35

Member
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

78 Neutral

About rob35

  • Rank
    Newbie
  1. Thank you everybody for your responses; Hodgeman - I had not thought of that and will try it, thank you. SM2.0 is unfortunately the minimum for my project, but I agree that that is stupid. [quote name='japro' timestamp='1341063896' post='4954309'] Render the world position to a second render target and calculate the contours in a screen space pass... [/quote] I am quite sure you seem to have more experience than I in this field; could you elaborate on this technique because it sounds to me like the best way of doing it. Thank you.
  2. There is a graphics maneuver that seems impossible to complete yet so basic... the very mention of it has put an end to [url="http://www.gamedev.net/topic/608918-dynamic-contour-plotting-in-pixel-shader-20/page__p__4851508#entry4851508"]this thread[/url] and [url="http://www.gamedev.net/topic/529926-terrain-contour-lines-using-pixel-shader/page__p__4926133#entry4926133"]this post[/url] on this forum. I'll ask again: is there ANY way for Shader Model 2.0 cards to draw Contour Lines - not by crappily applying a 1d texture (that will look horrible... again, look at the first post [url="http://www.gamedev.net/topic/529926-terrain-contour-lines-using-pixel-shader/page__p__4926133"]here[/url]) but by using the screen-space derivative functions to do it properly? That functions (ddy, ddx, etc.) do NOT exist on SM 2.0 cards. How do I proceed? I experimented using a derivative map that I passed along to the shader in a different texture channel, but there were two problems: 1. didn't completely standardize the widths of the lines and they became huge and pixelated when zoomed in (probably a precision problem) and 2. I am going to be animating datasets and interpolating along the time axis; perhaps I implemented it wrong, but it went bonkers when I tried this presumably because the derivate maps can't just be linearly interpolated.. (but shouldn't they be able to?)... there must be a simpler way to draw something as simple as contour lines over a texture! If I color the texture with a palette I can see the boundaries/edges where I want lines, so how do I get LINES?
  3. [quote name='mr_hell' timestamp='1238722086' post='4431886'] How to rewrite this shader for SM 2.0? (does not support ddx ddy operations - i have to emulate gradiants by myself). its necessary for me! [Edited by - mr_hell on April 3, 2009 8:28:30 AM] [/quote] Yes, how do we get this to work on HLSL SM 2.0 cards? There's no ddx/ddy functions in any graphics cards but the new super-duper ones that many people don't have. It is so frustrating to think that it is impossible to have real contour lines without a SM 3.0 card! If anyone could figure out how to implement this on SM 2.0, they'd be a genius, but it seems that it is impossible unless you have the fancy ddx/ddy functions.
  4. Hello, I registered an account at this wonderful site to hopefully get help with my problem: I need to do exactly what [url="http://www.gamedev.net/topic/529926-terrain-contour-lines-using-pixel-shader/"]this guy[/url] 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
  • Advertisement