Open GoogleCodeExporter opened 9 years ago
Original comment by ShadowIs...@gmail.com
on 18 Jul 2009 at 4:07
How is this information going to be exposed to an arbitrary shader?
One solution is to define UserWorldParameters inside the material which would
specify
what kind of user globals the shader can take. The world uniform updater checks
which
are exposed in the system and if there are any matches between the material and
exposed vars then they are sent as uniforms.
How will these globals be exposed and what classes are allowed to expose them?
The class responsible for assigning these globals to the materials will contain
them
and accept requests from user code to add them to the list. Classes like
SceneProcessor should be allowed to set them. Singlepass shadow-supporting
shaders
will accept ug_ShadowMap[] for example, ShadowSceneProcesor generates shadow
maps for
scene and exposes ug_ShadowMap[].
What about fog?
This is a fixed-pipeline state that is stored inside RenderState. How will the
user
specify fog? In the Material definition, RenderState ONLY contains whether the
material should be fogged or not. No other fog-related state is allowed to be
set
inside the material. There must be a way to set the other fog-state through the
Renderer since it may or may not be using fixed-pipeline. Renderers only
supporting
shaders will set the g_FogParams and g_FogColor depending on the params the user
specified. While Renderers only supporting fixed-pipeline will set these
parameters
using glFog and such and achieve the same result.
Reformulation: Material techniques that use shaders must expose g_FogParams and
g_FogColor, while Material techniques that do not use shaders must specify Fog
Off
inside the RenderState block to disable fogging for the material.
Original comment by ShadowIs...@gmail.com
on 20 Sep 2009 at 5:27
Original comment by e.so...@gmail.com
on 25 Mar 2010 at 8:39
Original comment by e.so...@gmail.com
on 25 Mar 2010 at 8:48
Original comment by ShadowIs...@gmail.com
on 24 Sep 2010 at 3:36
Original comment by ShadowIs...@gmail.com
on 6 Sep 2012 at 5:31
Original issue reported on code.google.com by
ShadowIs...@gmail.com
on 25 Jun 2009 at 2:07