Giter Club home page Giter Club logo

Comments (6)

simbleau avatar simbleau commented on August 22, 2024 1

@dannymcgee Let me know if I'm offbase from your needs.

Likewise, I'm adding @musjj and @nixon-voxell because they had a similar issue on voxell-tech/bevy_motiongfx#40. Please feel free to give thoughts.

from bevy_vello.

dannymcgee avatar dannymcgee commented on August 22, 2024

So it looks like Bevy UI also ignores RenderLayers. 😂 Upon further inspection, there's actually a TargetCamera component in Bevy UI that serves this purpose. That doesn't fix my issue with non-UI stuff rendering to the UI camera, but I guess I'll have to come up with another solution for that. Closing this since it matches Bevy's behavior.

EDIT: Just kidding, Bevy does respect the render layers.

from bevy_vello.

simbleau avatar simbleau commented on August 22, 2024

This is definitely something I'd love to accept in a PR, or get to as time permits.

from bevy_vello.

simbleau avatar simbleau commented on August 22, 2024

Up to this point, RenderLayer was something I've never worked with. Currently bevy_vello ignores RenderLayers entirely, so at first it was unclear why adding a RenderLayer::layer(1) component to a VelloSceneBundle would make it not render.

I understand this a little better now and I'm committed to pushing this across the finish line.

Here's what I understand, for others:

  • Changing the camera order will change the ordering of rendering cameras. This is a possible way to make bevy_vello render on top or on bottom of your 3d space. (camera order 1 or -1 respectively should do the trick).
    image
  • Render layers are used to tell a camera what it can and can't see. An entity on Render Layer 0 is never seen by a camera on Render Layer 1.

Re: The situation where a camera has a RenderLayer: I believe having multiple cameras with different RenderLayers would mean internally we would need a new framebuffer for every camera. Then we would need a check to ensure each camera is only rendering the items in its render layer.

from bevy_vello.

ChristopherBiscardi avatar ChristopherBiscardi commented on August 22, 2024

I'll add the reason I was looking into this as well:

I have a Camera2d where I want to render all ui from a bevy_vello powered ui crate, and a Camera3d where I want to render "everything else" (gltf scenes, gizmos, effects, etc. game stuff).

If the Camera2d doesn't have a RenderLayers specified, then it will render a bunch of "extra" stuff, such as gizmos I'm using in the 3d camera. So ideally I would be able to order +1 on Camera2d, which places it over the 3d camera, and use RenderLayers to target all vello content to the Camera2d. I believe this still fits the "one pass" model of vello as it is only one layer.

from bevy_vello.

simbleau avatar simbleau commented on August 22, 2024

Fixed via #68 - Please re-open a new issue if there are further render layer issues.

There is also a new example for render layers.

from bevy_vello.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.