Jump to content

  • Log In with Google      Sign In   
  • Create Account

pixel shader displacement mapping (sortof)


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
10 replies to this topic

#1 RipTorn   Members   -  Reputation: 722

Like
Likes
Like

Posted 20 November 2003 - 11:24 PM

I thought I''d share something, The other day I saw an article on opengl.org about per-pixel displacement mapping (here), which looked mighty impressive and I wanted to try it out. It''s just that it a), it didn''t run, and b), needed absolutly massive ''4d'' textures.. So I decided to try and write my own. (Using just the height stored in the alpha of the normal map). Although I bumped into the limits of my radeon (and therefor couldn''t get things as accurate as I want) this is the result (two triangles). I''m quite happy. it doesn''t slow things down too much either (about 15% slower over normal PPL lighting). If enough people want a description of how I did it I suppose I can write something up. Anyway. Just thought I''d share some fun I had. :D | - Project-X - On hold (kindof ).. - | - adDeath - | - email me - |

Sponsor:

#2 Per Ohlsson   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 November 2003 - 03:13 AM

I definatly want to know how.

#3 Ready4Dis   Members   -  Reputation: 180

Like
Likes
Like

Posted 21 November 2003 - 03:32 AM

I'm going to see about playing with those, but I have a feeling my graphics board may just be a tad to old .


--- Edit ---
By the way, I'd be interested in your method and/or a demo to see if it'll work on my radeon 9100.

[edited by - Ready4Dis on November 21, 2003 10:33:23 AM]

#4 Nik02   Crossbones+   -  Reputation: 3707

Like
Likes
Like

Posted 21 November 2003 - 04:02 AM

The textures seem to contain the pattern''s normals for every possible viewing angle (of course, not _every_ angle; hence simplification to 2d), so that the inter-occlusion(sp?) of the shapes can be presented to the pixel shader.

Note that effectively implementation almost requires that the same pattern is used over the entire surface. I say "almost" because i have a tingling feeling in my mind that this could be more generalized.

Not magic, but clever

-Nik

#5 Pragma   Members   -  Reputation: 395

Like
Likes
Like

Posted 21 November 2003 - 07:56 AM

I would be interested to see if you could adapt it to arbitrary curvature, as they did in the siggraph paper. The reduction in texture space is great, since the siggraph images were really low-res but took up huge amounts of video ram.

Are you doing multiple lookups into a height map (raytracing style), or something more tricky than that?

"Math is hard" -Barbie

#6 RipTorn   Members   -  Reputation: 722

Like
Likes
Like

Posted 21 November 2003 - 12:32 PM

yes I am doing multiple lookups into a height map, my video card (a radeon 9500) doesn''t seem to have the felxibility to do more than 5 (shown) - I expected more to be possible as the texture coords are generated in the vertex shader not the pixel shader, I have a couple of ideas how to make these more accurate, and reduce artifacts that occur at really low angles, but I can''t since the shaders I write to try these ideas don''t compile (Cg) and I''m not sure for what reason. (I could probably cut out the lighting calculations I guess)

as for the radeon 9100 thing, I have seen a similar thing done on my old radeon 9000 a long time ago, but very was pretty rough (simply an offset based on a single heightmap, so at low angles things blew up badly - unlike this where things only slightly blow up )


the ftp I use isn''t responding so I can''t put up a couple of pics I want to... will do later on...

| - Project-X - On hold (kindof ).. - | - adDeath - | - my windows XP theme - | - email me - |

#7 RipTorn   Members   -  Reputation: 722

Like
Likes
Like

Posted 21 November 2003 - 01:30 PM

ok.

here is what the normal map looks like, so it''s just simply using alpha for height...

in game..

what it looks like when it blows up..



yeah if anyone wants a detailed description thats fine. but I gather it''s pretty obvious...

| - Project-X - On hold (kindof ).. - | - adDeath - | - my windows XP theme - | - email me - |

#8 JonnyQuest   Members   -  Reputation: 331

Like
Likes
Like

Posted 21 November 2003 - 03:25 PM

Wow, those images look gorgeous. Good work, man. I can''t play with it because I haven''t upgraded from my Radeon 8500 yet, but I''m looking forward to getting my hands on a 9800XT now.

If you can''t be bothered to do a detailed description, how about the shader source?

- JQ

#9 RipTorn   Members   -  Reputation: 722

Like
Likes
Like

Posted 21 November 2003 - 04:35 PM

I think I will write something up...

It was great fun to write, and didn''t need any new code which was nice.

I''m going up to talk with a few docs later in the week about some work I might be doing.. so I think I''ll have a talk about this too.l

| - Project-X - On hold (kindof ).. - | - adDeath - | - my windows XP theme - | - email me - |

#10 wolf   Members   -  Reputation: 848

Like
Likes
Like

Posted 22 November 2003 - 09:01 AM

That''s looks good. I am looking forward to read your description.

- Wolf

#11 LarsMiddendorf   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 November 2003 - 09:33 AM

I would also like to see some explanations.Thanks.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.




PARTNERS