Vadi said:I have a question: What techniques are used to do displacement mapping with shaders? I hadn't believed it's feasable until I saw screenshots of this. I stand corrected .
Thank you!
edit: One more question : Is it possible to do ambient occlusion with shaders?
Definitely. ATI has it in their Crowd demo.Vadi said:edit: One more question : Is it possible to do ambient occlusion with shaders?
Simple displacement mapping is done by displacing each vertex of the mesh by a displacement value got by looking up a texture using that vertex's texture coordinates. This would take just 2 lines of shader code.What techniques are used to do displacement mapping with shaders
Ostsol said:Definitely. ATI has it in their Crowd demo.Vadi said:edit: One more question : Is it possible to do ambient occlusion with shaders?
That which is rendered and that which is used by the physics engine need not have anything in common with each other. Anyway, the geometry created by displacement mapping is generated dynamically, never passing the AGP/PCI-Express bus; and the collision hull's geometry must be static or generated in software. Because of this it makes no difference whether vertex or pixel displacement mapping is used. The same data may be used for collision either way.radar1200gs said:Pixel shader based "virtual displacement" mapping may be able to be used in many games on vertical surfaces, but it is no substitute for proper vertex displacement mapping.
Consider the example of a ball rolling down a rough road. With virtual displacement the ball will roll smoothly along no matter how rough the road gets or what obstacles block its path. Hardly realistic (lets not forget the physics engines being built into games nowadays to help realism).
With proper vertex displacement mapping the ball will be affected by the rough road since it is interacting with real, rough geometry, not a flat plane that simply looks bumpy.
991060 said:relief mapping:
http://bbs.gzeasy.com/uploads/post-44469-1096730981.jpg
the effect is stunning, yet the performance drop is also significant(relief mapping needs aroung 200 instructions in fragment program to work correctly).
BTW, the original discussion is here, in case you're interested in the detail:
http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=012454
Ostsol said:That which is rendered and that which is used by the physics engine need not have anything in common with each other. Anyway, the geometry created by displacement mapping is generated dynamically, never passing the AGP/PCI-Express bus; and the collision hull's geometry must be static or generated in software. Because of this it makes no difference whether vertex or pixel displacement mapping is used. The same data may be used for collision either way.radar1200gs said:Pixel shader based "virtual displacement" mapping may be able to be used in many games on vertical surfaces, but it is no substitute for proper vertex displacement mapping.
Consider the example of a ball rolling down a rough road. With virtual displacement the ball will roll smoothly along no matter how rough the road gets or what obstacles block its path. Hardly realistic (lets not forget the physics engines being built into games nowadays to help realism).
With proper vertex displacement mapping the ball will be affected by the rough road since it is interacting with real, rough geometry, not a flat plane that simply looks bumpy.
hovz said:wrong again radar!!!
radar1200gs said:Not wrong.
You use vertex based collision and feed the rsults of that into your physics engine.
One quad, yes, but it's the fillrate that matters. I imagine that using such a technique would warrant an initial z-only pass to help eliminate overdraw.bloodbob said:991060 said:relief mapping:
http://bbs.gzeasy.com/uploads/post-44469-1096730981.jpg
the effect is stunning, yet the performance drop is also significant(relief mapping needs aroung 200 instructions in fragment program to work correctly).
BTW, the original discussion is here, in case you're interested in the detail:
http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=012454
100Fps on current tech I probably wouldn't call it significant ( yeah I do realise its only one quad ).
No, I did NOT say vertex or pixel.bloodbob said:radar1200gs said:Not wrong.
You use vertex based collision and feed the rsults of that into your physics engine.
You said VERTEX or PIXEL.
If your feeding the results into your physics system its going to have to cross the bus on the way back isn't it? So now you definately are wrong.