Jump to content

Skybox clipped by higher camera near range


Go to solution Solved by Josh,

Recommended Posts

Posted

if you set the near range of a camera > 0.3 the skybox get clipped by the frustum and if > 0.5 it is not visible at all. 

 image.thumb.png.48962879aa8d402a03ddb94603ace76a.png

  • Thanks 1
  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
  • Solution
Posted

Easy shader fix in Sky.vert

void main()
{
	texCoords = normalize(VertexPosition.xyz);
	mat4 cameraMatrix = ExtractEntityMatrix(CameraID);
	vec4 pos = VertexPosition;
	pos.xyz *= CameraRange.x + (CameraRange.y - CameraRange.x) * 0.5f;
	pos.xyz += cameraMatrix[3].xyz;
	gl_Position = CameraProjectionViewMatrix * pos;
	gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5f;
}

 

Let's build cool stuff and have fun. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...