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

Generalized immediate render callbacks? #548

Closed
NINE78 opened this issue Sep 17, 2011 · 1 comment
Closed

Generalized immediate render callbacks? #548

NINE78 opened this issue Sep 17, 2011 · 1 comment

Comments

@NINE78
Copy link
Contributor

NINE78 commented Sep 17, 2011

Hi group,

As per one of my previous posts, I've been working on a large mesh rendering pipeline using chunked LoD. I've heavily modified the code in the webglrenderer to treat my objects as immediate rendering objects, and hence initiate the rendering callback on each frame render pass... I'm doing quite a bit of optimization steps, such as reusing mesh vbos and morphing them in the vertex shaders, packing (interleaving) attributes together into larger buffers, ... This gives me a smooth 60fps across the board, but obviously means not much of the original renderBufferImmediate code remains the same.

So what I'd like to propose/implement is a more generalized immediate rendering mode, where the low-level control is available for these specialized cases, and each implementation basically provides its own renderBufferImmediate code. The big question I have however: is this even possible? For a custom render function to be registered into the WebGL renderer, that function would need access to the _gl context and such, which is passed in to the WebGL renderer functions by closure. Is there any way to expose this context in callback functions without extensive changes to the renderer (e.g. without making all of the relevant variables actual members of the renderer etc...)

thanks!

@525c1e21-bd67-4735-ac99-b4b0e5262290
Copy link
Contributor

FYI @NINE78 has patched this into dev in #592

@mrdoob mrdoob closed this as completed Sep 30, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants