Hi, i made a melty shader using this framework:
Now i wanted to port my code into the spring-engine, to use the melt shader on a lava-level. Which results in the fNormal not beeing calculated as in the threejs implementation.
fNormal = normalize(normalMatrix * normal); != fNormal = normalize(gl_NormalMatrix * gl_Normal.xyz);
I tryied several other variants and variations- and to be honest, i forgot quite a bit on what i was doing back then with the shadder.
So if anyone could give me a pointer to where three js normal calculations deviates from glsl normals, i woudl be glad.
Thanks and have a wonderful evening
Do you even have access to these two variables? Which version of OpenGL is this?
As far as shaders are concerned these are just simple uniforms that take data in. The way the normal matrix is calculated is probably exactly the same in every engine. There are many many different ways to compute and average normals. For this it might be best to read/port threes vertex normal generation code.
Current version is
#define SDL_VIDEO_RENDER_OGL 1 according to config.
This file has been truncated.
/* include/SDL_config.h. Generated from SDL_config.h.in by configure. */
Simple DirectMedia Layer
Copyright (C) 1997-2013 Sam Lantinga <email@example.com>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
There is a rewrite in progress for a more recent version of ogl.
Okay, will try to port this. I shall post results . Thanks for the fast reply.