Main Menu

Shaders

Started by AW999, July 26, 2010, 11:04:30 PM

Previous topic - Next topic

AW999

I've noticed that many programs use extremely complicated shader code in order to extrapolate geometry from a small number of polygons, thereby reducing the number of polys but presumably slowing performance to a crawl?  Unless I'm missing something, wouldn't it be far better just to generate a larger number of detailed polys ?  To give a example of what I'm referring to, here's a video of a program which renders waterfalls and uses pixel shaders to extrapolate the rock details, creating extremely elaborate rock formations from just a few rough polys - amazing programming, but it seems like an unnecessarily slow way of doing it ? Click on the top video, labeled "Cascades: Technical Overview"  - http://www.nzone.com/object/nzone_cascades_videos.html

EgonOlsen

Usually shaders are faster albeit using real geometry would be the better solution overall. Modern DX11 hardware can create real geometry on the fly by using tesselation. Shaders don't really extrapolate geometry, they just "fake" it.

AW999

Quote from: EgonOlsen on July 26, 2010, 11:24:44 PM
Usually shaders are faster albeit using real geometry would be the better solution overall. Modern DX11 hardware can create real geometry on the fly by using tesselation. Shaders don't really extrapolate geometry, they just "fake" it.

   And pixel shaders fake it by using nothing but some basic information (color, position, etc) about that pixel, correct? So how is it possible to fake an elaborate, curving rockface just from that, without any information about nearby polys? 

EgonOlsen

You usually encode the normal informations from more detailed objects into the normal map and use that in the shader to compute the lighting on a per pixel base. That fools the eye in a way that it looks more detailed than it actually is. It fails on edges, where the low poly object remains flat, because there's no real depth added. That's what tesselation fixes.