]> git.tdb.fi Git - libs/gl.git/commit
Entirely new system for building standard shaders
authorMikko Rasa <tdb@tdb.fi>
Wed, 29 Aug 2012 21:48:58 +0000 (00:48 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 29 Aug 2012 21:48:58 +0000 (00:48 +0300)
commit9034e81679eeeaa3d1d5d643d3f924d9edb45a68
tree92a4d128e3c4e157fd572f9ac2b6b2e7d265e60c
parent9733137499a84f44c29d06d2551d41a903de1112
Entirely new system for building standard shaders

The old one was becoming such a huge mess that I had to spend two minutes
doing boolean analysis to figure out the conditions for a multiplication
operator.  The logic parser was also insufficient for expressing
sophisticated relationships between variables.

The new one operates with expression, starting from a target variable and
pulling in others to compute its value.  The logic parser is still there,
buts its burden is greatly reduced, as most of the work is done by the
dependency resolver.

Reflections are missing at the moment, but will be added back soon.  They
were pretty broken in the old system anyway, with the assumption that the
environment map is in eye space.

The generated shader code is rather verbose, containing a lot more local
variables than are needed.  An optimizer will be implemented in the near
future.
demos/cubemap.cpp
demos/shaders.cpp
source/program.cpp
source/program.h
source/programbuilder.cpp [new file with mode: 0644]
source/programbuilder.h [new file with mode: 0644]