-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix RenderState Parameters Leaking Between Renders #2130
Conversation
Looks like this fixed the issue 👍🏽. |
Unless there's further substantive discussion, I plan to integrate this PR in about 48 hours. |
Oh hey, I just noticed that this PR includes a new file "TestShadows.java". That file needs a copy of the JME license at the top. It also needs javadoc describing the purpose of the test and how to determine whether the test passes or fails. |
I plan on deleting that test, because it doesn't really test anything other tests don't already cover. I built it so I could focus on the shadow debug without a bunch of other code cluttering things up. |
back on track for integration in about 45 hours. |
Hi guys, what do you think about writing the //Usage:
mergedRenderState = RenderState.copy( RenderState.DEFAULT, mergedRenderState );
//or
RenderState.copy( RenderState.DEFAULT, mergedRenderState ); public static RenderState copy(RenderState from, RenderState to) {
to.applyBlendMode = from.applyBlendMode;
to.applyColorWrite = from.applyColorWrite;
to.applyCullMode = from.applyCullMode;
to.applyDepthFunc = from.applyDepthFunc;
to.applyDepthTest = from.applyDepthTest;
to.applyDepthWrite = from.applyDepthWrite;
to.applyLineWidth = from.applyLineWidth;
to.applyPolyOffset = from.applyPolyOffset;
to.applyStencilTest = from.applyStencilTest;
to.applyWireFrame = from.applyWireFrame;
to.backStencilDepthFailOperation = from.backStencilDepthFailOperation;
to.backStencilDepthPassOperation = from.backStencilDepthPassOperation;
to.backStencilFunction = from.backStencilFunction;
to.backStencilMask = from.backStencilMask;
to.backStencilReference = from.backStencilReference;
to.backStencilStencilFailOperation = from.backStencilStencilFailOperation;
to.blendEquation = from.blendEquation;
to.blendEquationAlpha = from.blendEquationAlpha;
to.blendMode = from.blendMode;
to.cachedHashCode = from.cachedHashCode;
to.colorWrite = from.colorWrite;
to.cullMode = from.cullMode;
to.depthFunc = from.depthFunc;
to.depthTest = from.depthTest;
to.depthWrite = from.depthWrite;
to.dfactorAlpha = from.dfactorAlpha;
to.dfactorRGB = from.dfactorRGB;
to.frontStencilDepthFailOperation = from.frontStencilDepthFailOperation;
to.frontStencilDepthPassOperation = from.frontStencilDepthPassOperation;
to.frontStencilFunction = from.frontStencilFunction;
to.frontStencilMask = from.frontStencilMask;
to.frontStencilReference = from.frontStencilReference;
to.frontStencilStencilFailOperation = from.frontStencilStencilFailOperation;
to.lineWidth = from.lineWidth;
to.offsetEnabled = from.offsetEnabled;
to.offsetFactor = from.offsetFactor;
to.offsetUnits = from.offsetUnits;
to.sfactorAlpha = from.sfactorAlpha;
to.sfactorRGB = from.sfactorRGB;
to.stencilTest = from.stencilTest;
to.wireframe = from.wireframe;
return to;
} |
I'm not opposed to it, but |
The proposed static |
Unless there's further substantive discussion, I plan to integrate this PR in about 24 hours. |
Thank you @codex128 for your contribution to JME! |
This PR fixes shadows and other rendering issues caused by #2091 (github issue #2129), where render state parameters were leaking between render techniques because
RenderState#set
does not set all parameters.Unfortunately, I was unable to get spotlight shadows to work in my test class, but TestSpotLightShadows worked fine, so I'm assuming I simply set up spotlight shadows wrong.
Any testing is greatly appreciated.