hey ho,
I want to display a cubemap in ogre on a mesh
in the shader it looks like this
float3 viewReflectionVec = normalize(reflect(-Input.CamVec, bumpNormal));
float4 mysupercubereflection = texCUBE(EnvironmentMap, viewReflectionVec);
Problem is that I get a visual break in the cube reflection at every uv seam.
on a sphere where every uv-edge is split it looks like that
edit: ok this is not right.. I need some space between the split uv chunks to make the seam visible.. some intern welding?!
Am I stupid or is this how cubemap reflections work?!
Replies
edit: ok it gets even more strange.. I get seams at a cylinder but there are not uv seams and just one smoothing group... wtf
edit2: ok this one is fixed.. it was ogremax and the setting "merge duplicate vertices" fixed it
So the summary till now: why do I see the uv edges in ogre but not in max
Btw.. rotating the uv's by 90° changes the intensity I see horizontal or vertical the borders
But here's a few thoughts:
- if the boundaries of the facets and the faces of your mesh match, why use a normal map? The problem would then be extremely simple on the shader side (and making it 'uv independent').
-if they don't and you use a normal map, why not storing every facet information in it? You then need to instantiate a highres facet on the surface of the sphere and bake everything at once.
The problem seems that there is a slight difference how the cube pixels are calculated and if then a bright and a dark spot of the cube moves over the seams you get something like this:
In the end I had to normalize the viewDir inside of the fragment shader before calculating the reflection vector.
It's an extra normalize, which sucks, but it fixed the problem.
The problem even appears if you create a sphere in max, mirror one half of the uvs onto the other half and put an direct x shader with cubemap support on it.
Use a pure empty normalmap as test.
As soon as you mirror the uvs the whole cubemap thing moves a tiny bit.
and this gets ugly on more complex parts of the model
The problem in the first image is now fixed (image taken from the ogre engine) as I had calculated the cubemap from tangent vectors what was quite super stupid. (correct would be to use would space vectors)
but the error in the 2nd and 3rd image are from max with xoliul shader (1.6) and also with my own toon shader.
So this seems to be a strangeness from max not connected with my initial problem.