Project Rembrandt: Difference between revisions

Jump to navigation Jump to search
Syntax highlight seems to work
(Revert unreadable font)
(Syntax highlight seems to work)
Line 69: Line 69:
If you are seeing error messages during startup or FlightGear doesn't start up properly, it's probably because you don't have enough free video memory. Reduce the size of the shadow map in preferences.xml by locating  
If you are seeing error messages during startup or FlightGear doesn't start up properly, it's probably because you don't have enough free video memory. Reduce the size of the shadow map in preferences.xml by locating  


<pre>
<syntaxhighlight lang="xml">
  <map-size type="int">8192</map-size>
  <map-size type="int">8192</map-size>
</pre>
</syntaxhighlight>


And put 4096 or 2048 instead.
And put 4096 or 2048 instead.
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 :


<pre >
<syntaxhighlight lang="xml">
<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>
</pre>
</syntaxhighlight>


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 :


<pre >
<syntaxhighlight lang="xml">
<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>
</pre>
</syntaxhighlight>


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>
<syntaxhighlight lang="glsl">
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);


Line 271: Line 271:
     encode_gbuffer(normal, color, mId, specular, shininess, emission, depth);
     encode_gbuffer(normal, color, mId, specular, shininess, emission, depth);
}
}
</pre>
</syntaxhighlight>


=== Geometry Stage ===
=== Geometry Stage ===
Line 372: Line 372:
{|cellpadding=10|
{|cellpadding=10|
|valign=top|
|valign=top|
<pre>
<syntaxhighlight lang="xml">
<animation>
<animation>
   <type>light</type>
   <type>light</type>
Line 428: Line 428:
   <far-m>39</far-m>
   <far-m>39</far-m>
  </animation>
  </animation>
</pre>
</syntaxhighlight>
|valign=top|
|valign=top|
{| class="wikitable" cellpadding="3"
{| class="wikitable" cellpadding="3"
Line 488: Line 488:
{|cellpadding=10|
{|cellpadding=10|
|valign=top|
|valign=top|
<pre>
<syntaxhighlight lang="xml">
<animation>
<animation>
   <type>light</type>
   <type>light</type>
Line 537: Line 537:
   <far-m>39</far-m>
   <far-m>39</far-m>
  </animation>
  </animation>
</pre>
</syntaxhighlight>
|valign=top|
|valign=top|
{| class="wikitable" cellpadding="3"
{| class="wikitable" cellpadding="3"
269

edits

Navigation menu