Jump to content

  • Log In with Google      Sign In   
  • Create Account


TheFallenOne

Member Since 28 Oct 2010
Offline Last Active Oct 01 2013 02:09 AM

#5017928 Skybox Rendering Issue

Posted by TheFallenOne on 05 January 2013 - 05:29 PM

A cube map isn't sampled using uv(w)s (in the range [0.0, 1.0]), but using an (un)normalized vector, usually a (reflected) vertex surface normal.

Since you are drawing the map unto cube, you can simple use the cube's object space vertices to sample the cube map.

e.g. left top far vertex:

pVertex[0].fU = -50000.0f;
pVertex[0].fV = 50000.0f;
pVertex[0].fW = 50000.0f;

VS: output.Position = float4(TexCoords + xCameraPos, 1.0);
PS: output.Color = texCUBE(TextureSampler, TexCoords);

 

Awesome, this solved the issue! Thanks a million. :D

 

Sad, because I read that it uses a vector to determine texture coordinates in several different places... I guess it just never clicked.

 

Thanks to you other two as well!!




PARTNERS