Dark areas in Sphere with Cubemap…

Does anyone knows why happen this?


[java]MaterialDef Cube Texture {
MaterialParameters {
TextureCubeMap Texture
Vector3 CameraPosition
Boolean SphereMap
Technique {
VertexShader GLSL100 : Shaders/Reflection/Reflection.vert
FragmentShader GLSL100 : Shaders/Reflection/Reflection.frag

    WorldParameters {

    Defines {
        SPHERE_MAP : SphereMap


[java]uniform mat4 g_WorldViewProjectionMatrix;
uniform mat4 g_WorldMatrix;
uniform mat3 g_NormalMatrix;
uniform vec3 m_CameraPosition;

attribute vec3 inPosition;
attribute vec3 inNormal;

varying vec3 m_Reflection;

void main()
vec3 Normal = g_NormalMatrix * inNormal;
vec4 Position = g_WorldMatrix * vec4(inPosition,1.0);
m_Reflection = reflect(Position.xyz - m_CameraPosition, normalize(Normal));
m_Reflection = vec3(m_Reflection.x, -m_Reflection.yz);
gl_Position = g_WorldViewProjectionMatrix * vec4(inPosition, 1.0);

[java]uniform samplerCube m_Texture;

varying vec3 m_Reflection;

void main()
gl_FragColor = textureCube(m_Texture, m_Reflection);


Why happens what?

The dark areas in the sphere. When I move away from the sphere, it is more dark.

It’s important that your cameras position for rendering the cubemap is the center of the sphere.

The sphere and the camera are in vec3(0,0,0) location

what does your individual textures looks like?

Sorry, I can´t understand your question, Can you explain me what you say?

I’m sorry, I know my english is a little bad