Skip to main content
gamedev.net
🔒 Locked

True(er) bumpmapping...?

Started by OrangyTang 4 replies 450+ views
Original Post
OrangyTang
OrangyTang
Disclaimer: I''m not a graphics guru in any sense of the word, but i thought people might be interested in this idea, and i''m wondering how possible it is... The problem with bumpmapping at the moment is typically the silluette view, which remains completely flat I was wondering if using a pixel shader program could be used to add in the jagged edge when the tri is viewed at an angle. The problem with this is that it would involve shading the profile on the screen in an area outside of the triangle. So i''m thinking, how about a vertex shader to work hand in hand, which extends the far vertex/verticies slightly along the normal to provide the extra surface needed for the silluette edge? And could possibly be made to offload some other preprocessing required as well.. The only major problem i could see would be consistantly drawing the edge well enough and getting the whole thing to fit in the maximum shader size. (and plenty more i''ve overlooked). Odds are i''ll never get round to trying this, firstly becuse i''ve no shader experience, and mainly because i dont have any pixel shader hardware. Comments? abuse?
Ysaneya
Ysaneya
Hum yes: vertex shaders do not create additionnal vertices (nor destroy them), and pixel shaders cannot displace the pixels. So on the current hardware this is not possible. What you''re looking for is displacement mapping, which should be available in the next-generation hardware.

The ATI Radeons have capabilities to smooth out triangles by tesselating them according to the curvature (based on the normals at the vertices), but it generates a lot of additionnal vertices and the results are only good for certain type of meshes (like characters). If you''re into OpenGL, look for the ATI_pn_triangles extension.

Y.
OrangyTang
OrangyTang
Ah but i''m not suggesting adding verticies or displacing pixels outside their own triangle, my ideais to tweek the verticies with the first shader program and then use the extra space to render the edge with varying alpha to acheive a jagged edge consistant with the height/bumpmap
greeneggs
greeneggs
quote:
Original post by OrangyTang
Ah but i''m not suggesting adding verticies or displacing pixels outside their own triangle, my ideais to tweek the verticies with the first shader program and then use the extra space to render the edge with varying alpha to acheive a jagged edge consistant with the height/bumpmap


Yes, but how exactly do you tweak them? How does the program identify when there is a silhouette, and then how is it able to consistently draw the silhouette? If you have an idea here, do tell, but to me it seems impossible.
S1CA
S1CA
If you can write to or affect the Z buffer comparison per pixel (you can with some PS versions, 1.3 in D3D IIRC), then you can get a bumpy silhouette and per object interaction.

For just bumpy silhouettes you could even probably do it with alphatest, and even in fixed function (albeit with an extra stage as the overhead) - think E.N where E is the eye vector and N is a per pixel normal bunged into A

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
python_regious
python_regious
Just run it at a low res, aliasing will do the rest! Lol...

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.

Topic Locked

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

Sign in to reply to this topic.