Skip to content

GLRenderer unexpectedly generates mipmaps of the previous framebuffer #1788

@riccardobl

Description

@riccardobl

When a new framebuffer is set as current, the renderer will try to generate mipmaps for the attachments of the previous framebuffer if they are set to use mipmaps. This is an hack made probably for Filters but it is unexpected (setting a framebuffer shouldn't create mipmaps of another framebuffer...) and breaks when the previous framebuffer is used to render on a mipmap level, since this code will replace the rendered mipmap with one autogenerated from the first level.

https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java#L2078-L2097

I am not sure on how to fix this without breaking current code that relies on this behavior, maybe there should be a flag to tell the renderer if a framebuffer needs automatic mipmaps, but this might lead a developer to think that by setting it, the mipmaps will be generated after the framebuffer is used, while in truth they are generated only after another framebuffer is set in place of the one that needs the mipmaps

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that is supposed to work, but doesn't. More severe than a "defect".

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions