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

2 issues with the SmarkBakedModel #11

Open
Da-Technomancer opened this issue Mar 26, 2017 · 0 comments
Open

2 issues with the SmarkBakedModel #11

Da-Technomancer opened this issue Mar 26, 2017 · 0 comments

Comments

@Da-Technomancer
Copy link

Da-Technomancer commented Mar 26, 2017

Both of these are lighting related. Firstly, because the model is not a full block, it can cause intermittent rendering issues in certain chunks where the conduit is very dark unless builder.setApplyDiffuseLighting(false); is called from within the createQuad method. In the tutorial, it isn't.

Secondly, there is a small error in the calculation of the normal vector. This error isn't noticeable with the example model because the example is not opaque. However, the calculation produces a vector pointing in the exact opposite direction. The normal vector is used by the lighting engine to darken certain block faces, and because it is the opposite direction, the light level adjacent to the top face affects only the bottom face, and so on. However, this isn't noticeable in this case because it isn't opaque and light can pass though. The fix is simple, instead of using Vec3d normal = v1.subtract(v2).crossProduct(v3.subtract(v2)); use Vec3d normal = v3.subtract(v2).crossProduct(v1.subtract(v2)); (the difference is swapping v3 and v1). Other than these 2 subtle things, the tutorial seems to be correct.

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

No branches or pull requests

1 participant