Hello everybody, i got a “strange” bug.
Context : i am using the endless terrain generation, i wanted to add a light thing on it, so i switched from the HeightBasedTerrain.j3md to the TerrainLighting.j3md. Except for textures parameters (i had to change them), it works.
But, when i set one or more “NormalMap”, i got an error:
The strange thing is the “language=GLSL100” in the message, and we have “// NOTE: Doesn’t support OpenGL1” at the beginning of the file. I am maybe doing something wrong, but i don’t think that the error comes from me.
BTW, any news about a heightbased shader (for terrains) that supports lighting ? I know that the author of the existing height-based shader didn’t finish his shader (and will likely never finish it) but maybe someone else did an other one ? Anyway, this is not the topic, don’t bother with this last question.
It would be useful to see line 640 in that “huge piece of code”. The reason the whole shader gets logged is so that the error line number can be matched to the actual shader line number after the includes, etc. have been expanded.
@bubuche said:
well, the line 640 is blank, so ...
you already have the code (it’s the code in jme, in the jme-terrain.jar file, in Common/MatDefs/Terrain/TerrainLighting.frag ).
Well, i’ll keep investigating on this.
I think you misunderstand. The code as in svn is useless unless I run it and get the same error.
The dump of the code in the log has expanded all of the included libraries, etc. and so the line numbers help track down the error that the shader compiler gives. I can guarantee you 10000% that line 640 was not blank.
Though I guess the “Undeclared identifier: calculateNormal” is pretty clear. We might have to see the whole dump so as to compare it to the unexpanded shader to see what #defines or whatever are wrong.
if you still don’t have enough information, i’ll use pastebin.
btw, i tried (now) to enable the triplanar, and i get the same error (except the line that point to
[java]
vec3 normal = calculateNormalTriPlanar(wNormal, wVertex, texCoord);
[/java])
the incrimined function “calculatenormal” is defined in the file as i said, but it’s definition only occurs when an alpha map is defined… for a reason i don’t really understand.
to make it clear :
you have this
[java] #ifdef ALPHAMAP
…
vec3 calculateNormal(in vec2 texCoord) {
…
}
… #endef
[java]
now i need to test if everything is fine, especially if the normal map is correctly applied. I think that yes, but i really need to make 2 screenshot to compare them back to bakc to avoid the “placebo” effect.
But i am very tired right now (8:28 am, i worked all the night ) so i’ll do more test this evening.
And i think that it could deserves either a fix or some documentation