qdtk / openshadinglanguage

Automatically exported from code.google.com/p/openshadinglanguage
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

provide renderer hints to shaders #40

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There are specific situations when the shader can (and should) do less work:

shadow rays
rays seen by indirect diffuse (or very glossy rays)
rays seen by SSS
Our initial hope was that we could somehow instruct the shader to do less work 
solely based on 
regexps. Before running a shader, we can look at what states will be allowed:

are diffuse transitions allowed?
are glossy transitions allowed?
is transparency allowed?
...
Based on this we could hint the shader to cut some of its calculations:

ignore_diffuse
ignore_glossy
ignore_tramission
ignore_emission
...
This sounds great in theory, but there are a few problems:

shader writers want to _change_ the material for these ray types
this implies custom labels in the regexp
custom label transitions can't be simulated in advance (combinatorial 
explosion!)
SSS is not defined by regexps alone - its a separate rendering pass
So at the moment we don't have any better ideas than to give shader writers 
what they had 
before:

isshadowray()
isindirect() (or isdiffuse()/isglossy()/etc...)
isfromSSS()
These only make sense for our current rendering algorithm, but its looking less 
and less likely 
that we'll get to implement something other than path tracing in the near 
future.

What do you guys think?

Original issue reported on code.google.com by rene.lim...@gmail.com on 11 Jan 2010 at 7:16

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by rene.lim...@gmail.com on 13 Jan 2010 at 12:57