Happenstance Posted July 6, 2018 Posted July 6, 2018 So zOffset for ScatterSky has been broken for a while. I looked through the git history and the relevant change was going from this in 3.8: Point3F camPos2 = state->getCameraPosition(); MatrixF xfm(true); xfm.setPosition(camPos2 - Point3F( 0, 0, mZOffset)); GFX->multWorld(xfm); MatrixF xform(proj);//GFX->getProjectionMatrix()); xform *= GFX->getViewMatrix(); xform *= GFX->getWorldMatrix(); to this as part of rextimmy's D3D11 commit (41e5caf): Point3F camPos2 = state->getCameraPosition(); MatrixF xfm(true); GFX->multWorld(xfm); MatrixF xform(proj);//GFX->getProjectionMatrix()); xform *= GFX->getViewMatrix(); xform *= GFX->getWorldMatrix(); if(state->isReflectPass()) { static MatrixF rotMat(EulerF(0.0, 0.0, M_PI_F)); xform.mul(rotMat); rotMat.set(EulerF(M_PI_F, 0.0, 0.0)); xform.mul(rotMat); } xform.setPosition(xform.getPosition() - Point3F(0, 0, mZOffset)); I can get zOffset working again by removing:xform.setPosition(xform.getPosition() - Point3F(0, 0, mZoffset)); and replacing it with: xfm.setPosition(camPos2 - Point3F(0, 0, mZoffset)); but matrices are not my strong suit so I feel like I'm overlooking something (probably breaking reflections somehow?).Anyone see anything wrong this? Quote
Timmy Posted July 6, 2018 Posted July 6, 2018 That change was from the commit before d3d11 but anyways your changes look fine, that is what it was originally, i am not sure why it was changed. Might have to check with @Azaezel who made the change, he must have run into something to change it? Quote
Timmy Posted July 7, 2018 Posted July 7, 2018 @Happenstance feel free to send a PR with that fix through, that way you get the credit for finding and fixing it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.