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

WebGLRenderer render type definition #19563

Closed
martinRenou opened this issue Jun 5, 2020 · 2 comments · Fixed by #19564
Closed

WebGLRenderer render type definition #19563

martinRenou opened this issue Jun 5, 2020 · 2 comments · Fixed by #19564

Comments

@martinRenou
Copy link
Contributor

martinRenou commented Jun 5, 2020

Description of the problem

When using ThreeJS in JavaScript I was able to render only one mesh (without using a Scene) doing:

renderer.setRenderTarget(my_target);
renderer.clear();

renderer.render(my_mesh, camera);

This is very useful for doing some pre-processing things (in my case, rendering water caustics in shaders using a water mesh as input).

My issue is that I cannot perform the same in TypeScript, the render method takes a Scene as first argument, so my code does not compile.

Should I open a PR fixing the type definition? I don't see any documentation specifying that my code is valid (that the render method can actually take a mesh as input).

Three.js version

r112

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 5, 2020

Yes, please update the TS file and docs. It was lately discussed that your approach is valid, see #19477.

@martinRenou
Copy link
Contributor Author

martinRenou commented Jun 5, 2020

Perfect. I will do that today. Thank you

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

Successfully merging a pull request may close this issue.

2 participants