Project Rembrandt: Difference between revisions

Jump to navigation Jump to search
Undo revision 49085 by Hooray (talk) ; PLEASE FIX THE SYNTAX HIGHLIGHT CSS BEFORE - FONT IS TOOOOOOOO SMALL
m (→‎Usage: fix syntax highlighting (xml & glsl))
(Undo revision 49085 by Hooray (talk) ; PLEASE FIX THE SYNTAX HIGHLIGHT CSS BEFORE - FONT IS TOOOOOOOO SMALL)
Line 235: Line 235:
For material shaders, it is necessary to provide both <tt>gbuffer-functions.frag</tt> and <tt>gbuffer-encode.frag</tt> in the effect file, like this :
For material shaders, it is necessary to provide both <tt>gbuffer-functions.frag</tt> and <tt>gbuffer-encode.frag</tt> in the effect file, like this :


<syntaxhighlight lang="xml">
<pre >
<program>
<program>
<vertex-shader>Shaders/ubershader.vert</vertex-shader>
<vertex-shader>Shaders/ubershader.vert</vertex-shader>
Line 242: Line 242:
<fragment-shader>Shaders/gbuffer-encode.frag</fragment-shader>
<fragment-shader>Shaders/gbuffer-encode.frag</fragment-shader>
</program>
</program>
</syntaxhighlight>
</pre>


For fullscreen passes shaders, only <tt>gbuffer-functions.frag</tt> should be provided, like this :
For fullscreen passes shaders, only <tt>gbuffer-functions.frag</tt> should be provided, like this :


<syntaxhighlight lang="xml">
<pre >
<program>
<program>
<vertex-shader>Shaders/sunlight.vert</vertex-shader>
<vertex-shader>Shaders/sunlight.vert</vertex-shader>
Line 252: Line 252:
<fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
<fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
</program>
</program>
</syntaxhighlight>
</pre>


In the main function of the shader, the functions referenced need to be declared first. With no #include files, the whole function prototype needs to be typed :
In the main function of the shader, the functions referenced need to be declared first. With no #include files, the whole function prototype needs to be typed :
 
<pre>
 
void encode_gbuffer(vec3 normal, vec3 color, int mId, float specular, float shininess, float emission, float depth);
void encode_gbuffer(vec3 normal, vec3 color, int mId, float specular, float shininess, float emission, float depth);


<syntaxhighlight lang="glsl">
main() {
main() {
     vec3 normal;
     vec3 normal;
Line 273: Line 271:
     encode_gbuffer(normal, color, mId, specular, shininess, emission, depth);
     encode_gbuffer(normal, color, mId, specular, shininess, emission, depth);
}
}
</syntaxhighlight>
</pre>


=== Geometry Stage ===
=== Geometry Stage ===
269

edits

Navigation menu