-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
Move EffectComposer "Pass" into its own file #14795
Conversation
Is there a way to inline the code if it is not defined so existing fiddles will continue to work? Can you swap the order? <script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/Pass.js"></script>
<script src="js/postprocessing/ShaderPass.js"></script>
<script src="js/postprocessing/MaskPass.js"></script> |
I could do that by copy / pasting the code from
You can swap the order and everything will work but the warning will print if Pass is included after EffectComposer. I tried putting the warning inside of the EffectComposer constructor but other code would fail from the missing Pass definition before the EffectComposer was created in the examples so the warning would never get printed, making kinda useless. Is there a better way to handle the printed warning? |
I suppose I could wrap the log in a |
/ping @mrdoob @WestLangley Any further thoughts on what I should do here? Should I copy the Thanks! |
Sorry, I am not sure of the preferred way to handle this... |
+1 For this PR ! It will allow to remove a patch from three-full. In my view Pass should be in his own file, clearly. |
What Changed
THREE.Pass
definition frompostprocessing/EffectComposer.js
topostprocessing/Pass.js
THREE.Pass
isn't defined to notify users of the changeWhy
I'm looking into making a script to convert all the example scripts into es6 module files and this file was proving troublesome because it creates cyclic dependencies:
EffectComposer (EffectComposer.js)
depends onShaderPass
which depends onPass (EffectComposer.js)
.So EffectComposer.js imports ShaderPass before it has defined Pass, yet, which causes ShaderPass to throw an undefined variable error. Moving Pass out the EffectComposer file removes the cyclic dependency.