Lourens Veen wrote:
On Monday 17 April 2006 17:03, Timothy Miller wrote:
Anyhow, it seems to me that we should look at some examples. There
are two things we can do here. Some people with experience can write
out, in high-level pseudo-code, some simple shader programs. And
someone else could look at the OGA "model" and convert that into the
pseudo code corresponding to how it would be fully implemented in a
programmable shader (some details can be left out).
Perhaps these could be useful?
http://www.lighthouse3d.com/opengl/glsl/index.php?shaders
uniform mat4 gl_ModelViewMatrix;
uniform mat4 gl_ProjectionMatrix;
attribute vec4 gl_Vertex;
void main()
{
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
}
==============================================================================
Pseudo Code (each token is enclosed in "<" ">"):
<void><main(><)>
<{>
<GL mat4><gl_Position><=><<uniform mat4><gl_ProjectionMatrix>
<*><uniform mat4><gl_ModelViewMatrix><*><attribute vec4>
<gl_Vertex><;>
<}>
NOTE that this can be improved by reordering the operations to RPN to
reduce the amount of op stack usage.
--
JRT
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)