Ogre Version: 14.3
Operating System: Windows
Render System: OpenGL
Hello,
We have finally migrated from OGRE 1.8.2 to 14.3 and we got most the code working as expected, minus 2 things:
The shadow rendering seems much slower in 14.3 than it was in 1.8.2 (additive and modulative mode). Is there something expected or may be there is a flag to speed up like in the 1.8.2 may be with some quality drawback ?
We have a GLSL shader which should takes the closest light of an object, it was working in 1.8.2 but in 14.3 it now takes always the first light. Is something changed in light management for shaders ? Here is the shader code
vertex:
Code: Select all
#version 130
uniform mat4 P25;//+25
uniform vec4 P80;//+80
uniform vec4 P46;//+46 0
uniform vec4 P43;//+43 0
uniform vec4 P32;//+32
varying vec3 oviewdir;
varying vec3 olightdir;
varying vec3 onormal;
varying vec4 ovcolor;
varying float olightatt;
varying float ofogf;
void main()
{
oviewdir=normalize(P80.xyz-gl_Vertex.xyz);
olightdir=normalize(P46.xyz-gl_Vertex.xyz);
gl_Position=P25*gl_Vertex;
onormal=gl_Normal;
float Dist=distance(P46,gl_Vertex);
olightatt=1/(P43.y+P43.z*Dist+P43.w*Dist*Dist);
ovcolor=gl_Color;
ofogf=P32.z>0?min(abs(gl_Position.z)*P32.w,1):0;
}
fragment:
Code: Select all
#version 130
uniform vec4 P71;//+71 0
uniform vec4 P72;//+72 0
uniform vec4 P69;//+69 0
uniform float P37;//+37
uniform vec4 P31;//+31
varying vec3 oviewdir;
varying vec3 olightdir;
varying vec3 onormal;
varying vec4 ovcolor;
varying float olightatt;
varying float ofogf;
void main()
{
vec3 normal=normalize(onormal);if(gl_FrontFacing==false)normal*=-1;
vec3 viewdir=normalize(oviewdir);
vec3 lightdir=normalize(olightdir);
float dif=max(dot(lightdir,normal),0)*olightatt;
float spe=pow(max(dot(normalize(lightdir+viewdir),normal),0),P37);
vec4 color=(P69+P71*dif)+P72*spe;
gl_FragColor=mix(color,P31,ofogf);
}
Thanks !