Giter Site home page Giter Site logo

Comments (7)

clayjohn avatar clayjohn commented on August 19, 2024 1

Reclassifying this as a documentation issue. The behaviour is certainly annoying, but its not a bug per se. Godot uses the AABB of the particles to determine what area the particles will reach. Because of the disconnect between GPU data and CPU data, it is possible to create particles that extend outside there AABB.

This creates numerous problems:

  1. As described here, particles won't register with the collision shape and so the particles will fail to collide
  2. Particles won't register with lights and so they won't cast shadows
  3. Particles will become invisible if the AABB is not on screen

MRP where the camera is looking slightly down
image

All these issues come down to the same fundamental problem: if the AABB isn't an accurate representation of the area covered by your particle effect, then things will break.

I think we should document this problem in more places so that users are aware that they need to manually tweak the AABB when working on custom particle effects

from godot.

derkork avatar derkork commented on August 19, 2024

Well interestingly enough if you use a height field collision, it will work even if you don't increase the AABB. At least the behaviour should be consistent there, shouldn't it?

from godot.

clayjohn avatar clayjohn commented on August 19, 2024

Well interestingly enough if you use a height field collision, it will work even if you don't increase the AABB. At least the behaviour should be consistent there, shouldn't it?

The behaviour should be consistent, yes. The AABB of the heightfield collider needs to overlap the AABB of the Particles node.

I ran a quick test and can confirm that the height field collision AABB does indeed need to overlap the Particles AABB, just like the other Collision shapes.

Using the same size as the box collider
Screenshot 2024-06-24 at 6 28 39 PM

Overlapping AABBs
Screenshot 2024-06-24 at 6 28 54 PM

from godot.

derkork avatar derkork commented on August 19, 2024

Thank you very much for the explanation! I was referring to this setup, where the particle system AABB and the height field size overlap, but the collision point is actually outside of the particle system AAAB. In this case the collision seemingly still seems to work:

image

Until the AABB leaves the camera at which time the particle simulation seems to be partially halted (note how the particles are not drawn anymore but their shadows are).

2024-06-25_09-04-58.mp4

So maybe a checklist for the developer could look like this:

  • Make sure your particle system AABB is large enough to enclose all surfaces that you want your particles to interact with.
  • If you use a height field, its size and positioning should match the AABB of your particle system.

There are probably some other items on the list for tweaking the FPS to prevent tunneling, and I'm also not sure about the the SDF based collision yet, but I'll clarify these in #93570 as to not convolute the discussion here. Again thanks a lot for explaining this!

from godot.

derkork avatar derkork commented on August 19, 2024

Another question related to that is how AABBs of subemitters are handled. Should they have the same AABB as their parent emitter or do they "inherit" their parent's AABB and their own AABB doesn't matter?

from godot.

Calinou avatar Calinou commented on August 19, 2024

Another question related to that is how AABBs of subemitters are handled. Should they have the same AABB as their parent emitter or do they "inherit" their parent's AABB and their own AABB doesn't matter?

I just tested this, and subemitters need to have their AABBs correctly configured, just like their parent. They do not inherit their parent's AABB.

from godot.

derkork avatar derkork commented on August 19, 2024

That is good to know, thank you very much!

from godot.

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.