Skip to content

Conversation

@Ali-RS
Copy link
Member

@Ali-RS Ali-RS commented Feb 4, 2021

This should fix the issues with using InstancedGeometry and shadow filter reported on the forum: https://hub.jmonkeyengine.org/t/npe-with-instancednode-and-shadow-filter/44240

  • Now if all instances of an InstancedGeometry are removed the InstancedGeometry will be properly detached as well and its internal buffer will be cleared.
  • Instead of returning a null bound in InstancedGeometry (when it is empty) it will return a bounding box with zero extents. (following the same approach in Node class)
  • Renamed getActualNumInstances to a more meaningful name getNumVisibleInstances
  • Fixed a bug in visible instances count calculation that was causing com.jme3.renderer.RendererException: Attempting to upload empty buffer (limit = 0), that's an error when used with shadow filter.
  • Two test classes are added that demonstrates using instancing with raycasting and shadow. (thanks @duncanj for providing tests)
  • Fixed an issue where the LOD level was being ignored by InstancedGeometry!

@Ali-RS Ali-RS added this to the Future Release milestone Feb 8, 2021
@Ali-RS
Copy link
Member Author

Ali-RS commented Feb 11, 2021

Going to merge this in 24h, in case someone still wants to review this.

@stephengold
Copy link
Member

I don't understand instancing well enough to comment on the changes. I notice you've added some tests---thank you for that!
A small request: please update the copyright dates of the source files you modify, to at least include 2021.

@Ali-RS
Copy link
Member Author

Ali-RS commented Feb 11, 2021

please update the copyright dates of the source files you modify, to at least include 2021.

Sure, will do.

@Ali-RS Ali-RS merged commit 58f9ee9 into jMonkeyEngine:master Feb 12, 2021
@stephengold stephengold modified the milestones: Future Release, v3.4.0 Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants