Jump to content
  • Advertisement
Sign in to follow this  
rob35

It seems that nobody here is smart enough, myself included...

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

There is a graphics maneuver that seems impossible to complete yet so basic... the very mention of it has put an end to this thread and this post 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 here) 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?

Share this post


Link to post
Share on other sites
Advertisement
You could just make the line narrower/thicker based on the normal and distance (ie if the slope is tangental to the plane of contour or camera is close, the line would be thicker so have a narrower criteria). I haven't tried this but I don't see why you couldn't mathematically work out the correct criteria.

Share this post


Link to post
Share on other sites
Render the world position to a second render target and calculate the contours in a screen space pass...

Share this post


Link to post
Share on other sites
Just set SM3 as your program's minimum hardware requirement and the problem goes away; you can then get on with being productive.

Seriously - SM2 is so old that you're doing yourself and your program a disservice by aiming so low. Even SM3 is quite ancient. 5 or 6 years ago this would have been a genuine problem, and that's an eternity in computing. Today SM3 capable hardware is ubiquitous (even Intel have had it since 2006); there's absolutely nothing that's "fancy" or "new" about it. Edited by mhagain

Share this post


Link to post
Share on other sites
My fairly low end laptop bought 4 years ago has SM3 still. Just use it.

Share this post


Link to post
Share on other sites
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.


Render the world position to a second render target and calculate the contours in a screen space pass...

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.

Share this post


Link to post
Share on other sites
The games I am working on this year are probably the last two big SM3 projects we will be doing. its all D3D11 with SM5 and SM4 profiles going forward . . .

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!