-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Generate lightProbe from CubeCamera #17282
Generate lightProbe from CubeCamera #17282
Conversation
cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas, also OffscreenCanvas.getContext("webgl"), but not OffscreenCanvas.getContext("2d")!
Is there a reason why you do not pass in a See how |
I could have only pass the renderTarget but the method is named fromCubeCamera so semanthically this is better to pass the CubeCamera |
Examples always need to be added to files.js. Otherwise they do not appear in the menu side bar. |
You can change the name, no? Can you reuse the existing method? See how |
Your environment map is a Cornell box with colors of the form |
You are getting there, but there is still something wrong with the way you handle colorspace. These should produce the same light probe, and it should be in linear colorspace. lightProbe.copy( LightProbeGenerator.fromRenderTargetCube( renderer, cubeCamera.renderTarget ) );
lightProbe.copy( LightProbeGenerator.fromCubeTexture( cubeTexture ) ); The helper should be rendered in gamma-corrected colorspace. |
@@ -116,6 +116,105 @@ THREE.LightProbeGenerator = { | |||
|
|||
return new THREE.LightProbe( sh ); | |||
|
|||
}, | |||
|
|||
fromCubeRenderTarget: function ( renderer, renderTarget ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fromRenderTargetCube: function ( renderer, renderTargetCube ) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what is wrong for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think color correction in threejs is a little bit messy.
So i should simply assume that the renderTarget is linear. What do you think?
Color correction should be applied as a render pass if the user wants it.
It would be more simple to understand and all buffer would be in linear color space has it should be without wondering in which color space we are working on!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can follow the same pattern in your method I used in #17385 and decode to linear based on the encoding of the WebGLRenderTargetCube
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the function signature should be
fromRenderTargetCube: function ( renderer, renderTargetCube ) {
The texture files are not needed in this PR, right? |
|
||
var imageWidth = renderTarget.width; // assumed to be square | ||
var data = new Uint8Array(imageWidth * imageWidth * 4); | ||
renderer.readRenderTargetPixels(renderTarget, 0, 0, imageWidth, imageWidth, data, faceIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace formatting -- multiple places...
> ./node_modules/.bin/eslint --fix <filename>
JSM: Update modules.
Cleanup Geometry and DirectGeometry TS
Examples: Remove usage of BufferAttribute.setArray().
Loader: Remove Handlers.
PointerLockControls: Clean up.
…ra' into lightprobegenerator_fromCubeCamera
I think this PR got messed up... |
Ouch, i accidently merge instead of rebase dev branch, sorry... |
@nipmarsh Would you be willing to redo a clean PR? |
I already rebased the PR softly, is it still messed up?
… Le 13 oct. 2019 à 03:15, WestLangley ***@***.***> a écrit :
@nipmarsh <https://github.com/nipmarsh> Would you be willing to redo a clean PR?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#17282?email_source=notifications&email_token=AEVJSXVF7QJJI4SYSD5BGSLQOJZCFA5CNFSM4IM6MMXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCL2PA#issuecomment-541375804>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEVJSXQ7QNTQCJDM4SSKO53QOJZCFANCNFSM4IM6MMXA>.
|
Add a method to generate a lightProbe from a cubeCamera.
It assumes that the cubeCamera renderTarget is RGBA