Commit df761809 authored by Jan Möbius's avatar Jan Möbius
Browse files

Added Block diagrams for shader construction

parent 30eea56a
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
<svg fill-opacity="1" xmlns:xlink="http://www.w3.org/1999/xlink" color-rendering="auto" color-interpolation="auto" stroke="black" text-rendering="auto" stroke-linecap="square" width="2270" stroke-miterlimit="10" stroke-opacity="1" shape-rendering="auto" fill="black" stroke-dasharray="none" font-weight="normal" stroke-width="1" viewBox="180 460 2270 1230" height="1230" xmlns="http://www.w3.org/2000/svg" font-family="&apos;Dialog&apos;" font-style="normal" stroke-linejoin="miter" font-size="12" stroke-dashoffset="0" image-rendering="auto"
><!--Generated by the Batik Graphics2D SVG Generator--><defs id="genericDefs"
/><g
><defs id="defs1"
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath1"
><path d="M0 0 L2147483647 0 L2147483647 2147483647 L0 2147483647 L0 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath2"
><path d="M0 0 L0 140 L430 140 L430 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath3"
><path d="M0 0 L0 560 L430 560 L430 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath4"
><path d="M0 0 L0 450 L380 450 L380 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath5"
><path d="M0 0 L0 150 L190 150 L190 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath6"
><path d="M0 0 L0 250 L410 250 L410 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath7"
><path d="M0 0 L0 310 L410 310 L410 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath8"
><path d="M0 0 L0 270 L310 270 L310 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath9"
><path d="M0 0 L0 120 L200 120 L200 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath10"
><path d="M0 0 L0 450 L370 450 L370 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath11"
><path d="M0 0 L0 320 L1270 320 L1270 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath12"
><path d="M0 0 L0 290 L1170 290 L1170 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath13"
><path d="M0 0 L0 340 L340 340 L340 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath14"
><path d="M0 0 L0 160 L800 160 L800 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath15"
><path d="M0 0 L0 260 L160 260 L160 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath16"
><path d="M0 0 L0 30 L160 30 L160 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath17"
><path d="M0 0 L0 280 L130 280 L130 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath18"
><path d="M0 0 L0 30 L130 30 L130 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath19"
><path d="M0 0 L0 190 L160 190 L160 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath20"
><path d="M0 0 L0 290 L590 290 L590 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath21"
><path d="M0 0 L0 180 L150 180 L150 0 Z"
/></clipPath
></defs
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(1490,1420)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="428.5" height="138.5" y="0.5" clip-path="url(#clipPath2)" stroke="none"
/></g
><g transform="translate(1490,1420)"
><rect fill="none" x="0.5" width="428.5" height="138.5" y="0.5" clip-path="url(#clipPath2)"
/><text x="151" font-size="14" y="17.9688" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Fragment End Code</text
><path fill="none" d="M1 23.9688 L429 23.9688" clip-path="url(#clipPath2)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>outFragment = sg_cColor;</text
><text x="5" font-size="14" y="86.8438" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // mods</text
><text x="5" font-size="14" y="102.8125" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(1490,830)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="428.5" height="558.5" y="0.5" clip-path="url(#clipPath3)" stroke="none"
/></g
><g transform="translate(1490,830)"
><rect fill="none" x="0.5" width="428.5" height="558.5" y="0.5" clip-path="url(#clipPath3)"
/><text x="146" font-size="14" y="17.9688" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Fragment Begin Code</text
><path fill="none" d="M1 23.9688 L429 23.9688" clip-path="url(#clipPath3)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec4 sg_vPosCS = SG_INPUT_POSCS;</text
><text x="5" font-size="14" y="70.875" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec2 sg_vScreenPos = sg_vPosCS.xy / sg_vPosCS.w * 0.5 + 0.5;</text
><text x="5" font-size="14" y="102.8125" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#ifdef SG_INPUT_POSVS</text
><text x="5" font-size="14" y="118.7812" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec4 sg_vPosVS = SG_INPUT_POSVS;</text
><text x="5" font-size="14" y="134.75" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#endif</text
><text x="5" font-size="14" y="166.6875" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#ifdef SG_INPUT_NORMALVS</text
><text x="5" font-size="14" y="182.6562" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 sg_vNormalVS = SG_INPUT_NORMALVS;</text
><text x="5" font-size="14" y="198.625" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#endif</text
><text x="5" font-size="14" y="230.5625" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec4 sg_cColor = vec4(g_cEmissive, SG_ALPHA);</text
><text x="5" font-size="14" y="262.5" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#if use vertex color</text
><text x="5" font-size="14" y="278.4688" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>sg_cColor = SG_INPUT_VERTEXCOLOR;</text
><text x="5" font-size="14" y="294.4375" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#endif</text
><text x="5" font-size="14" y="342.3438" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#if phong shading</text
><text x="5" font-size="14" y="358.3125" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
><text x="5" font-size="14" y="374.2812" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#endif</text
><text x="5" font-size="14" y="406.2188" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#if textured</text
><text x="5" font-size="14" y="422.1875" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec4 sg_cTex = texture(g_Texture0, SG_INPUT_TEXCOORD);</text
><text x="5" font-size="14" y="454.125" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>sg_cColor *= sg_cTex;</text
><text x="5" font-size="14" y="470.0938" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#endif</text
><text x="5" font-size="14" y="502.0312" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // mods</text
><text x="5" font-size="14" y="518" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(2050,830)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="378.5" height="448.5" y="0.5" clip-path="url(#clipPath4)" stroke="none"
/></g
><g transform="translate(2050,830)"
><rect fill="none" x="0.5" width="378.5" height="448.5" y="0.5" clip-path="url(#clipPath4)"
/><text x="116" font-size="14" y="17.9688" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Fragment Shader Code</text
><path fill="none" d="M1 23.9688 L379 23.9688" clip-path="url(#clipPath4)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // IO block</text
><text x="5" font-size="14" y="70.875" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
><text x="5" font-size="14" y="102.8125" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec4 outFragment; // output</text
><text x="5" font-size="14" y="134.75" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // default uniform block</text
><text x="5" font-size="14" y="150.7188" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
><text x="5" font-size="14" y="198.625" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // main function</text
><text x="5" font-size="14" y="230.5625" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>void main()</text
><text x="5" font-size="14" y="246.5312" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>{</text
><text x="5" font-size="14" y="262.5" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
> SG_FRAGMENT_BEGIN;</text
><text x="5" font-size="14" y="422.1875" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
> SG_FRAGMENT_END;</text
><text x="5" font-size="14" y="438.1562" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>}</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(200,1210)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="188.5" height="148.5" y="0.5" clip-path="url(#clipPath5)" stroke="none"
/></g
><g transform="translate(200,1210)"
><rect fill="none" x="0.5" width="188.5" height="148.5" y="0.5" clip-path="url(#clipPath5)"
/><text x="45" font-size="14" y="17.9688" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Shader Modifier</text
><path fill="none" d="M1 23.9688 L189 23.9688" clip-path="url(#clipPath5)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>modifyVertexBeginCode()</text
><text x="5" font-size="14" y="70.875" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>modifyVertexEndCode()</text
><text x="5" font-size="14" y="102.8125" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>modifyFragmentBeginCode()</text
><text x="5" font-size="14" y="118.7812" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>modifyFragmentEndCode()</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(490,1320)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="408.5" height="248.5" y="0.5" clip-path="url(#clipPath6)" stroke="none"
/></g
><g transform="translate(490,1320)"
><rect fill="none" x="0.5" width="408.5" height="248.5" y="0.5" clip-path="url(#clipPath6)"
/><text x="151" font-size="14" y="17.9688" clip-path="url(#clipPath6)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Vertex End Code</text
><path fill="none" d="M1 23.9688 L409 23.9688" clip-path="url(#clipPath6)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath6)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#if gouraud or flat shading</text
><text x="5" font-size="14" y="70.875" clip-path="url(#clipPath6)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
><text x="5" font-size="14" y="86.8438" clip-path="url(#clipPath6)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#endif</text
><text x="5" font-size="14" y="118.7812" clip-path="url(#clipPath6)" font-family="sans-serif" stroke="none" xml:space="preserve"
>gl_Position = sg_vPosPS;</text
><text x="5" font-size="14" y="150.7188" clip-path="url(#clipPath6)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // default outputs</text
><text x="5" font-size="14" y="166.6875" clip-path="url(#clipPath6)" font-family="sans-serif" stroke="none" xml:space="preserve"
>SG_OUTPUT_X = ..; </text
><text x="5" font-size="14" y="182.6562" clip-path="url(#clipPath6)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // example SG_OUTPUT_POSVS = sg_vPosVS;</text
><text x="5" font-size="14" y="214.5938" clip-path="url(#clipPath6)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // mods</text
><text x="5" font-size="14" y="230.5625" clip-path="url(#clipPath6)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(490,980)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="408.5" height="308.5" y="0.5" clip-path="url(#clipPath7)" stroke="none"
/></g
><g transform="translate(490,980)"
><rect fill="none" x="0.5" width="408.5" height="308.5" y="0.5" clip-path="url(#clipPath7)"
/><text x="146" font-size="14" y="17.9688" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Vertex Begin Code</text
><path fill="none" d="M1 23.9688 L409 23.9688" clip-path="url(#clipPath7)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec4 sg_vPosPS = g_mWVP * SG_INPUT_POSOS;</text
><text x="5" font-size="14" y="70.875" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec4 sg_vPosVS = g_mWV * SG_INPUT_POSOS;</text
><text x="5" font-size="14" y="102.8125" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#ifdef SG_INPUT_NORMALOS</text
><text x="5" font-size="14" y="118.7812" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 sg_vNormalOS = SG_INPUT_NORMALOS;</text
><text x="5" font-size="14" y="134.75" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 sg_vNormalVS = g_mWVIT * SG_INPUT_NORMALOS;</text
><text x="5" font-size="14" y="150.7188" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#endif</text
><text x="5" font-size="14" y="182.6562" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#ifdef SG_INPUT_TEXCOORD</text
><text x="5" font-size="14" y="198.625" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vecD sg_vTexCoord = inTexCoord;</text
><text x="5" font-size="14" y="214.5938" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
>#endif</text
><text x="5" font-size="14" y="246.5312" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec4 sg_cColor = vec4(g_cEmissive, SG_ALPHA);</text
><text x="5" font-size="14" y="278.4688" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // mods</text
><text x="5" font-size="14" y="294.4375" clip-path="url(#clipPath7)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(1430,480)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="308.5" height="268.5" y="0.5" clip-path="url(#clipPath8)" stroke="none"
/></g
><g transform="translate(1430,480)"
><rect fill="none" x="0.5" width="308.5" height="268.5" y="0.5" clip-path="url(#clipPath8)"
/><text x="102" font-size="14" y="17.9688" clip-path="url(#clipPath8)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Default Uniforms</text
><path fill="none" d="M1 23.9688 L309 23.9688" clip-path="url(#clipPath8)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath8)" font-family="sans-serif" stroke="none" xml:space="preserve"
>mat4 g_mWVP; // world view proj</text
><text x="5" font-size="14" y="70.875" clip-path="url(#clipPath8)" font-family="sans-serif" stroke="none" xml:space="preserve"
>mat4 g_mWV; // world view</text
><text x="5" font-size="14" y="86.8438" clip-path="url(#clipPath8)" font-family="sans-serif" stroke="none" xml:space="preserve"
>mat3 g_mWVIT; // world view inverse transpose</text
><text x="5" font-size="14" y="102.8125" clip-path="url(#clipPath8)" font-family="sans-serif" stroke="none" xml:space="preserve"
>mat4 g_mP; // proj</text
><text x="5" font-size="14" y="134.75" clip-path="url(#clipPath8)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 g_vCamPos; // cam-pos in world</text
><text x="5" font-size="14" y="150.7188" clip-path="url(#clipPath8)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 g_vCamDir; // cam-dir in world</text
><text x="5" font-size="14" y="182.6562" clip-path="url(#clipPath8)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 g_cDiffuse; // diffuse color</text
><text x="5" font-size="14" y="198.625" clip-path="url(#clipPath8)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 g_cAmbient; // ambient color</text
><text x="5" font-size="14" y="214.5938" clip-path="url(#clipPath8)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 g_cEmissive; // emissive color</text
><text x="5" font-size="14" y="230.5625" clip-path="url(#clipPath8)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 g_cSpecular; // specular color</text
><text x="5" font-size="14" y="246.5312" clip-path="url(#clipPath8)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec4 g_vMaterial; // (shininess, alpha, 0, 0)</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(1080,690)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="198.5" height="118.5" y="0.5" clip-path="url(#clipPath9)" stroke="none"
/></g
><g transform="translate(1080,690)"
><rect fill="none" x="0.5" width="198.5" height="118.5" y="0.5" clip-path="url(#clipPath9)"
/><text x="37" font-size="14" y="17.9688" clip-path="url(#clipPath9)" font-family="sans-serif" stroke="none" xml:space="preserve"
>IO stage processing</text
><path fill="none" d="M1 23.9688 L199 23.9688" clip-path="url(#clipPath9)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath9)" font-family="sans-serif" stroke="none" xml:space="preserve"
>standard in/out defines</text
><text x="5" font-size="14" y="70.875" clip-path="url(#clipPath9)" font-family="sans-serif" stroke="none" xml:space="preserve"
>shader mod IO / uniforms</text
><text x="5" font-size="14" y="86.8438" clip-path="url(#clipPath9)" font-family="sans-serif" stroke="none" xml:space="preserve"
>template code</text
><text x="5" font-size="14" y="102.8125" clip-path="url(#clipPath9)" font-family="sans-serif" stroke="none" xml:space="preserve"
>shader mod includes</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(1030,830)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="368.5" height="448.5" y="0.5" clip-path="url(#clipPath10)" stroke="none"
/></g
><g transform="translate(1030,830)"
><rect fill="none" x="0.5" width="368.5" height="448.5" y="0.5" clip-path="url(#clipPath10)"
/><text x="121" font-size="14" y="17.9688" clip-path="url(#clipPath10)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Vertex Shader Code</text
><path fill="none" d="M1 23.9688 L369 23.9688" clip-path="url(#clipPath10)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath10)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // IO block</text
><text x="5" font-size="14" y="70.875" clip-path="url(#clipPath10)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
><text x="5" font-size="14" y="102.8125" clip-path="url(#clipPath10)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // default uniform block</text
><text x="5" font-size="14" y="118.7812" clip-path="url(#clipPath10)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
><text x="5" font-size="14" y="166.6875" clip-path="url(#clipPath10)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // main function</text
><text x="5" font-size="14" y="198.625" clip-path="url(#clipPath10)" font-family="sans-serif" stroke="none" xml:space="preserve"
>void main()</text
><text x="5" font-size="14" y="214.5938" clip-path="url(#clipPath10)" font-family="sans-serif" stroke="none" xml:space="preserve"
>{</text
><text x="5" font-size="14" y="230.5625" clip-path="url(#clipPath10)" font-family="sans-serif" stroke="none" xml:space="preserve"
> SG_VERTEX_BEGIN;</text
><text x="5" font-size="14" y="390.25" clip-path="url(#clipPath10)" font-family="sans-serif" stroke="none" xml:space="preserve"
> SG_VERTEX_END;</text
><text x="5" font-size="14" y="406.2188" clip-path="url(#clipPath10)" font-family="sans-serif" stroke="none" xml:space="preserve"
>}</text
></g
><g transform="translate(240,1350)"
><path fill="none" d="M1250.5 170.5 L1210.5 170.5" clip-path="url(#clipPath11)"
/><path fill="none" d="M1210.5 170.5 L1210.5 290.5" clip-path="url(#clipPath11)"
/><path fill="none" d="M1210.5 290.5 L10.5 300.5" clip-path="url(#clipPath11)"
/><path fill="none" d="M10.5 300.5 L10.5 10.5" clip-path="url(#clipPath11)"
/><path fill="none" d="M1239.2417 164 L1250.5 170.5 L1239.2417 177" clip-path="url(#clipPath11)"
/></g
><g transform="translate(340,1340)"
><path fill="none" d="M1150.5 10.5 L1080.5 10.5" clip-path="url(#clipPath12)"
/><path fill="none" d="M1080.5 10.5 L1080.5 260.5" clip-path="url(#clipPath12)"
/><path fill="none" d="M1080.5 260.5 L10.5 270.5" clip-path="url(#clipPath12)"
/><path fill="none" d="M10.5 270.5 L10.5 20.5" clip-path="url(#clipPath12)"
/><path fill="none" d="M1139.2417 4 L1150.5 10.5 L1139.2417 17" clip-path="url(#clipPath12)"
/></g
><g transform="translate(1730,660)"
><path fill="none" d="M320.5 320.5 L250.5 320.5" clip-path="url(#clipPath13)"
/><path fill="none" d="M250.5 320.5 L250.5 10.5" clip-path="url(#clipPath13)"
/><path fill="none" d="M250.5 10.5 L10.5 10.5" clip-path="url(#clipPath13)"
/><path fill="none" d="M309.2417 314 L320.5 320.5 L309.2417 327" clip-path="url(#clipPath13)"
/></g
><g transform="translate(1270,750)"
><path fill="none" d="M780.5 140.5 L680.5 140.5" clip-path="url(#clipPath14)"
/><path fill="none" d="M680.5 140.5 L680.5 50.5" clip-path="url(#clipPath14)"
/><path fill="none" d="M680.5 50.5 L90.5 50.5" clip-path="url(#clipPath14)"
/><path fill="none" d="M90.5 50.5 L90.5 10.5" clip-path="url(#clipPath14)"
/><path fill="none" d="M90.5 10.5 L10.5 10.5" clip-path="url(#clipPath14)"
/><path fill="none" d="M769.2417 134 L780.5 140.5 L769.2417 147" clip-path="url(#clipPath14)"
/></g
><g transform="translate(1910,1230)"
><path fill="none" d="M140.5 10.5 L70.5 10.5" clip-path="url(#clipPath15)"
/><path fill="none" d="M70.5 10.5 L70.5 240.5" clip-path="url(#clipPath15)"
/><path fill="none" d="M70.5 240.5 L10.5 240.5" clip-path="url(#clipPath15)"
/><path fill="none" d="M129.2417 4 L140.5 10.5 L129.2417 17" clip-path="url(#clipPath15)"
/></g
><g transform="translate(1910,1080)"
><path fill="none" d="M140.5 10.5 L10.5 10.5" clip-path="url(#clipPath16)"
/><path fill="none" d="M129.2417 4 L140.5 10.5 L129.2417 17" clip-path="url(#clipPath16)"
/></g
><g transform="translate(380,1280)"
><path fill="none" d="M110.5 260.5 L60.5 260.5" clip-path="url(#clipPath17)"
/><path fill="none" d="M60.5 260.5 L60.5 10.5" clip-path="url(#clipPath17)"
/><path fill="none" d="M60.5 10.5 L10.5 10.5" clip-path="url(#clipPath17)"
/><path fill="none" d="M99.2417 254 L110.5 260.5 L99.2417 267" clip-path="url(#clipPath17)"
/></g
><g transform="translate(380,1260)"
><path fill="none" d="M110.5 10.5 L10.5 10.5" clip-path="url(#clipPath18)"
/><path fill="none" d="M99.2417 4 L110.5 10.5 L99.2417 17" clip-path="url(#clipPath18)"
/></g
><g transform="translate(890,1200)"
><path fill="none" d="M140.5 10.5 L70.5 10.5" clip-path="url(#clipPath19)"
/><path fill="none" d="M70.5 10.5 L70.5 170.5" clip-path="url(#clipPath19)"
/><path fill="none" d="M70.5 170.5 L10.5 170.5" clip-path="url(#clipPath19)"
/><path fill="none" d="M129.2417 4 L140.5 10.5 L129.2417 17" clip-path="url(#clipPath19)"
/></g
><g transform="translate(890,1050)"
><path fill="none" d="M140.5 10.5 L10.5 10.5" clip-path="url(#clipPath16)"
/><path fill="none" d="M129.2417 4 L140.5 10.5 L129.2417 17" clip-path="url(#clipPath16)"
/></g
><g transform="translate(860,670)"
><path fill="none" d="M170.5 270.5 L10.5 270.5" clip-path="url(#clipPath20)"
/><path fill="none" d="M10.5 270.5 L10.5 10.5" clip-path="url(#clipPath20)"
/><path fill="none" d="M10.5 10.5 L570.5 10.5" clip-path="url(#clipPath20)"
/><path fill="none" d="M159.2417 264 L170.5 270.5 L159.2417 277" clip-path="url(#clipPath20)"
/></g
><g transform="translate(950,740)"
><path fill="none" d="M80.5 160.5 L10.5 160.5" clip-path="url(#clipPath21)"
/><path fill="none" d="M10.5 160.5 L10.5 10.5" clip-path="url(#clipPath21)"
/><path fill="none" d="M10.5 10.5 L130.5 10.5" clip-path="url(#clipPath21)"
/><path fill="none" d="M69.2417 154 L80.5 160.5 L69.2417 167" clip-path="url(#clipPath21)"
/></g
></g
></svg
>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
<svg fill-opacity="1" xmlns:xlink="http://www.w3.org/1999/xlink" color-rendering="auto" color-interpolation="auto" stroke="black" text-rendering="auto" stroke-linecap="square" width="1020" stroke-miterlimit="10" stroke-opacity="1" shape-rendering="auto" fill="black" stroke-dasharray="none" font-weight="normal" stroke-width="1" viewBox="320 200 1020 830" height="830" xmlns="http://www.w3.org/2000/svg" font-family="&apos;Dialog&apos;" font-style="normal" stroke-linejoin="miter" font-size="12" stroke-dashoffset="0" image-rendering="auto"
><!--Generated by the Batik Graphics2D SVG Generator--><defs id="genericDefs"
/><g
><defs id="defs1"
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath1"
><path d="M0 0 L2147483647 0 L2147483647 2147483647 L0 2147483647 L0 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath2"
><path d="M0 0 L0 270 L310 270 L310 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath3"
><path d="M0 0 L0 70 L190 70 L190 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath4"
><path d="M0 0 L0 120 L200 120 L200 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath5"
><path d="M0 0 L0 450 L370 450 L370 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath6"
><path d="M0 0 L0 200 L200 200 L200 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath7"
><path d="M0 0 L0 40 L70 40 L70 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath8"
><path d="M0 0 L0 40 L200 40 L200 0 Z"
/></clipPath
><clipPath clipPathUnits="userSpaceOnUse" id="clipPath9"
><path d="M0 0 L0 180 L210 180 L210 0 Z"
/></clipPath
></defs
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(470,740)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="308.5" height="268.5" y="0.5" clip-path="url(#clipPath2)" stroke="none"
/></g
><g transform="translate(470,740)"
><rect fill="none" x="0.5" width="308.5" height="268.5" y="0.5" clip-path="url(#clipPath2)"
/><text x="55" font-size="14" y="17.9688" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Geometry Shader Template File</text
><path fill="none" d="M1 23.9688 L309 23.9688" clip-path="url(#clipPath2)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // custom IO, uniforms, includes etc.</text
><text x="5" font-size="14" y="70.875" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
><text x="5" font-size="14" y="102.8125" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // main function</text
><text x="5" font-size="14" y="134.75" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>void main()</text
><text x="5" font-size="14" y="150.7188" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>{</text
><text x="5" font-size="14" y="182.6562" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // shader code</text
><text x="5" font-size="14" y="198.625" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
> [..]</text
><text x="5" font-size="14" y="214.5938" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>}</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(340,250)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="188.5" height="68.5" y="0.5" clip-path="url(#clipPath3)" stroke="none"
/></g
><g transform="translate(340,250)"
><rect fill="none" x="0.5" width="188.5" height="68.5" y="0.5" clip-path="url(#clipPath3)"
/><text x="45" font-size="14" y="17.9688" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Shader Modifier</text
><path fill="none" d="M1 23.9688 L189 23.9688" clip-path="url(#clipPath3)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath3)" font-family="sans-serif" stroke="none" xml:space="preserve"
>modifyGeometryIO()</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(470,410)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="308.5" height="268.5" y="0.5" clip-path="url(#clipPath2)" stroke="none"
/></g
><g transform="translate(470,410)"
><rect fill="none" x="0.5" width="308.5" height="268.5" y="0.5" clip-path="url(#clipPath2)"
/><text x="102" font-size="14" y="17.9688" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Default Uniforms</text
><path fill="none" d="M1 23.9688 L309 23.9688" clip-path="url(#clipPath2)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>mat4 g_mWVP; // world view proj</text
><text x="5" font-size="14" y="70.875" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>mat4 g_mWV; // world view</text
><text x="5" font-size="14" y="86.8438" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>mat3 g_mWVIT; // world view inverse transpose</text
><text x="5" font-size="14" y="102.8125" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>mat4 g_mP; // proj</text
><text x="5" font-size="14" y="134.75" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 g_vCamPos; // cam-pos in world</text
><text x="5" font-size="14" y="150.7188" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 g_vCamDir; // cam-dir in world</text
><text x="5" font-size="14" y="182.6562" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 g_cDiffuse; // diffuse color</text
><text x="5" font-size="14" y="198.625" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 g_cAmbient; // ambient color</text
><text x="5" font-size="14" y="214.5938" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 g_cEmissive; // emissive color</text
><text x="5" font-size="14" y="230.5625" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec3 g_cSpecular; // specular color</text
><text x="5" font-size="14" y="246.5312" clip-path="url(#clipPath2)" font-family="sans-serif" stroke="none" xml:space="preserve"
>vec4 g_vMaterial; // (shininess, alpha, 0, 0)</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(570,220)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="198.5" height="118.5" y="0.5" clip-path="url(#clipPath4)" stroke="none"
/></g
><g transform="translate(570,220)"
><rect fill="none" x="0.5" width="198.5" height="118.5" y="0.5" clip-path="url(#clipPath4)"
/><text x="37" font-size="14" y="17.9688" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>IO stage processing</text
><path fill="none" d="M1 23.9688 L199 23.9688" clip-path="url(#clipPath4)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>standard in/out defines</text
><text x="5" font-size="14" y="70.875" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>shader mod IO / uniforms</text
><text x="5" font-size="14" y="86.8438" clip-path="url(#clipPath4)" font-family="sans-serif" stroke="none" xml:space="preserve"
>shader mod includes</text
></g
><g fill="rgb(255,255,255)" fill-opacity="0" transform="translate(950,370)" stroke-opacity="0" stroke="rgb(255,255,255)"
><rect x="0.5" width="368.5" height="448.5" y="0.5" clip-path="url(#clipPath5)" stroke="none"
/></g
><g transform="translate(950,370)"
><rect fill="none" x="0.5" width="368.5" height="448.5" y="0.5" clip-path="url(#clipPath5)"
/><text x="111" font-size="14" y="17.9688" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>Geometry Shader Code</text
><path fill="none" d="M1 23.9688 L369 23.9688" clip-path="url(#clipPath5)"
/><text x="5" font-size="14" y="54.9062" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // IO block</text
><text x="5" font-size="14" y="70.875" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
><text x="5" font-size="14" y="102.8125" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // default uniform block</text
><text x="5" font-size="14" y="118.7812" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
><text x="5" font-size="14" y="150.7188" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // (helper) passthrough IO mapping</text
><text x="5" font-size="14" y="166.6875" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>void sg_MapIO(const int inIdx)</text
><text x="5" font-size="14" y="182.6562" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>{</text
><text x="5" font-size="14" y="198.625" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
> gl_Position = gl_in[inIdx].gl_Position;</text
><text x="5" font-size="14" y="214.5938" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
> gl_PrimitiveID = gl_PrimitiveIDIn;</text
><text x="5" font-size="14" y="230.5625" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
> SG_OUTPUT_X = SG_INPUT_X[inIdx];</text
><text x="5" font-size="14" y="246.5312" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>}</text
><text x="5" font-size="14" y="278.4688" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
> // template code</text
><text x="5" font-size="14" y="294.4375" clip-path="url(#clipPath5)" font-family="sans-serif" stroke="none" xml:space="preserve"
>[..]</text
></g
><g transform="translate(770,650)"
><path fill="none" d="M180.5 10.5 L120.5 10.5" clip-path="url(#clipPath6)"
/><path fill="none" d="M120.5 10.5 L120.5 180.5" clip-path="url(#clipPath6)"
/><path fill="none" d="M120.5 180.5 L10.5 180.5" clip-path="url(#clipPath6)"
/><path fill="none" d="M169.2417 4 L180.5 10.5 L169.2417 17" clip-path="url(#clipPath6)"
/></g
><g transform="translate(520,270)"
><path fill="none" d="M50.5 20.5 L10.5 20.5" clip-path="url(#clipPath7)"
/><path fill="none" d="M39.2417 14 L50.5 20.5 L39.2417 27" clip-path="url(#clipPath7)"
/></g
><g transform="translate(770,460)"
><path fill="none" d="M180.5 20.5 L10.5 20.5" clip-path="url(#clipPath8)"
/><path fill="none" d="M169.2417 14 L180.5 20.5 L169.2417 27" clip-path="url(#clipPath8)"
/></g
><g transform="translate(760,280)"
><path fill="none" d="M190.5 160.5 L120.5 160.5" clip-path="url(#clipPath9)"
/><path fill="none" d="M120.5 160.5 L120.5 10.5" clip-path="url(#clipPath9)"
/><path fill="none" d="M120.5 10.5 L10.5 10.5" clip-path="url(#clipPath9)"
/><path fill="none" d="M179.2417 154 L190.5 160.5 L179.2417 167" clip-path="url(#clipPath9)"
/></g
></g