The shadows of leaves are rendered as if they were at the origin (and not at the instanced position). The shadows of branches are rendered at the correct position.
I couldn’t get the LodSwitchControl working with instancing. All trees are always rendered at highest detail (skinned 3d mesh instead of flat billboards).
An example project where the problems can be seen is here: https://github.com/andilem/tree-test . The left trees are without instancing, the right trees use instancing.
I tried it, but I cannot see any tree shadows at all in the IsoSurfaceDemo. But I also don’t know how to get a mouse pointer to click on the GUI controls, perhaps something needs to be enabled there.
I would like to get instanced trees working again. I sort of feel like some JME version broke them (vague recollection)… but I don’t don’t what is actually wrong.
I also have limited time over the next couple of weeks. I might could look into it next weekend but I can’t make any promises.
If you poke into it and learn anything new then let me know. In the mean time, having this post on the forum, maybe someone else has also encountered this and has a work-around. I know SimArboreal trees are used in a few projects but I don’t know if they are instancing them.
Oh… looking at your code, I see that you are trying to use this with JME’s regular instance node or whatever. I’m not sure I ever tested it that way because I don’t use JME’s instancing node. I have a pretty strong guess that they might be incompatible.
I’m like 75% sure I setup my buffers differently.
You can see how IsoSurfaceDemo does it here:
If I’m not going to support JME’s default way of doing it (which I found kind of ugly for the ‘pre-batched’ case) then I should probably add a utility method to set it up.
Maybe you can unravel what I’m doing there in the mean time.
Considering the LoD problems, I think the InstancedNode just doesn’t support changing the culling. I will probably have to write my own instancing code similar to yours.