Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skybox doesn't work with extreme frustum values #481

Closed
cmacisaac opened this issue Mar 1, 2013 · 5 comments
Closed

Skybox doesn't work with extreme frustum values #481

cmacisaac opened this issue Mar 1, 2013 · 5 comments
Assignees
Labels

Comments

@cmacisaac
Copy link

I have a perspective camera set up. The lens.far value is 2500 and the lens.near value is 1500. I did this in order to get a higher quality shadow map. The lens.fov is 12 as well. These are all fairly extreme values.

The problem is in SkyBox.as at line 133.

The code
var size : Number = camera.lens.far / Math.sqrt(2) * .5;
produces the number 883.8 which is well below the near clipping plane of 1500.

I modified the code as such
var size : Number = ((camera.lens.far - camera.lens.near) / 2) + camera.lens.near;
Which puts the skybox in the correct location, but the corners get cut off when the camera rotates around.

Not sure how to fix this exactly, but the skybox should always be visible on the background regardless of the clipping space.

@ghost ghost assigned ringodotnl and DerSchmale Mar 22, 2013
@DerSchmale
Copy link
Member

This seems to be related to the master branch. Does the problem still exist in dev?

@cmacisaac
Copy link
Author

I believe so. I'm using the 4.1 Alpha code, if that matters.

@DerSchmale
Copy link
Member

Fixed in dev by projecting skybox with a dedicated projection matrix

@alihm
Copy link

alihm commented Jul 20, 2013

The problem still persists, My lens.far value is 40000 and I get clipped corners on 4.1.4, I don't have the problem on 4.0.9.

I tried fixing it by adding a slight change(* 0.9) in DefaultRenderer.as line 159:

var a:Number = (q.x_p.x + q.y_p.y + q.z_p.z + q.w_p.w)/(cx_q.x + cy_q.y + cz_q.z + cw_q.w) * 0.9;

@62316e
Copy link

62316e commented Dec 18, 2014

Same on 4.1.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants