Note that there are some explanatory texts on larger screens.

plurals
  1. PODoes RenderMonkey have a bug in TEXCOORD stream mapping for GLSL?
    text
    copied!<p>For clarity, I start with my question:</p> <p>Is it possible to use (in the shader code) the <strong>custom attribute name</strong> which I set for the <strong>TEXCOORD usage</strong> in the (OpenGL) stream mapping in RenderMonkey 1.82 or do I have to use gl_MultiTexCoord0? (The question might be valid for the <strong>NORMAL usage</strong> too, i.e custom name or <strong>gl_Normal</strong>)</p> <p>Background:</p> <p>Using RenderMonkey version 1.82. I have successfully used the stream mapping to map the general vertex attribute "position" (and maybe "normal"), but the texture coordinates does not seem to be forwarded correctly. For the shader code, I use #version 330 and the "in" qualifier in GLSL, which should be OK since RM does not compile the shaders itself (the OpenGL driver do).</p> <p>I have tried both .obj and .3ds files (exported from blender), and when checking the wavefront .obj-file, all texture coordinate information is there, as well as the vertex positions and normals.</p> <p>If it is not possible, the stream mapping is broken and there is no point in naming the variables in the stream mapping editor (besides for the vertex position stream, which works), since one has to use the built-in variables anyway.</p> <p>Update: If using the deprecated built-in variables, one has to use compatibility mode in the shader e.g</p> <pre><code>#version 330 compatibility out vec2 vTexCoord; </code></pre> <p>and, in the main function:</p> <pre><code>vTexCoord = vec2(gl_MultiTexCoord0); </code></pre> <p>(Now I'm not sure about the stream mapping of normals either. As soon as I got the texture coordinates working, I had normal problems and had to revert to gl_Normal.)</p> <p>Here is a picture of a working solution, but with built-in variables (and yes, the commented texcoord variable in the picture does not have the same name as in the stream mapping dialog, but it had the same name when I tried to use it, so it's OK.): <img src="https://i.stack.imgur.com/2d5aF.png" alt="Stream mapping bypassed with built in variables"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload