Author Topic: Shaders  (Read 2736 times)

Offline AW999

  • int
  • **
  • Posts: 57
    • View Profile
Shaders
« on: July 26, 2010, 11:04:30 pm »
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
 

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Shaders
« Reply #1 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.

Offline AW999

  • int
  • **
  • Posts: 57
    • View Profile
Re: Shaders
« Reply #2 on: July 27, 2010, 01:43:56 am »
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? 

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Shaders
« Reply #3 on: July 27, 2010, 05:52:45 pm »
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.