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

threejs example reports an error or does not load properly after using postprocessing #457

Closed
aile1997 opened this issue Mar 7, 2023 · 4 comments
Labels
support User support and general help

Comments

@aile1997
Copy link

aile1997 commented Mar 7, 2023

Description of the bug

I've had problems with both of the examples I've used so far, water and lensflares.

To Reproduce

https://threejs.org/examples/#webgl_lensflares
https://threejs.org/examples/?q=water#webgl_water

Expected behavior

They load normally when using threejs' built-in post-processing

Screenshots

image
image

Library versions used

  • Three:0.150.1
  • Post Processing: 6.30.1
@aile1997 aile1997 changed the title threejs example is invalid or an error is reported after postprocessing is used threejs example reports an error or does not load properly after using postprocessing Mar 7, 2023
@vanruesc
Copy link
Member

Three's postprocessing passes are not compatible with this library. You might get them to work if you tinker with their render methods:

THREE.VelocityDepthNormalPass.prototype = Object.assign(THREE.VelocityDepthNormalPass.prototype, {
	initialize: function() {},
	setRenderer: function() {},
	getDepthTexture: function() {},
	setDepthTexture: function() {},
	originalRender: THREE.VelocityDepthNormalPass.prototype.render,
  	render: function(renderer, inputBuffer, outputBuffer, delta, maskActive) {
		this.originalRender(renderer, outputBuffer, inputBuffer, delta, maskActive);
	}
});

@vanruesc
Copy link
Member

Closing this as answered.

@vanruesc vanruesc added the support User support and general help label Mar 22, 2023
@aile1997
Copy link
Author

Sorry, I just saw it. Thank you very much for your answer. Could you please give me a more detailed example? Or is there a simple way I could render these effects through another channel without any post-processing?

@vanruesc
Copy link
Member

vanruesc commented Mar 30, 2023

Lens flares are on the roadmap #279, but there are currently no plans to add an alternative for water rendering.

Having that said, three's water objects should work with postprocessing no problem. The error you're getting is likely related to a misconfiguration since updateFlow doesn't really do anything special. I'm also not sure what VelocityDepthNormalPass is and what it's doing, but it might also be causing problems.

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

No branches or pull requests

2 participants