Skip to content

Feature Request: More Fine-Grained Control Over Texture Units #189

Open
@fweth

Description

@fweth

Hi, I often have the situation where there is a texture which should be available to all programs at all times and then I have two framebuffers between which I play ping-pong. My understanding is that in vanilla WebGL I would bind the texture to the first texture unit and the framebuffers to the second and third texture unit and then only call uniform1i to tell the programs which framebuffers they should be using. Or, if I have program A which reads from FB 0 and writes to FB 1 and then program B which reads from FB 1 and writes to FB 0, I wouldn't even need to change any uniforms in the render loop. Yet with TWGL, I haven't found a method to achieve this, as it will always put the first texture I add as a uniform in the first texture unit, and so on, with this process repeated for each program I set the uniforms, so I need to rebind textures in the render loop instead of just resetting uniforms. Again, that's just my understanding, maybe I'm wrong though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions