renderList with all meshes

Is it possible to set the renderList of a mesh texture (e.g. reflectionTexture) to automatically include all meshes?
I guess a potential problem could be the mesh to which the texture is attached, but since this is rendered from the inside, it is probably automatically excluded correct.
So if there is a global renderList, which automatically keeps track of all meshes, one could possibly just assing this list as the renderList?
I am asking since it is a bit cumbersome to keep track of all meshes to insert them into renderlists of others, particularly, if these meshes are generated one by one in a scriptable way.

ā€¦ tried to at least use the same renderList for all such reflecting objects, but this does not seem to work. Neither by an empty Vector [] not by making a dummy refection object from which to borrow the render-list. As it seems renderLists cannot be assigned and they cannot be shared between meshes?
See this example:

You can simply set renderList to null to automatically use all the active meshes.

This is what I tried before, but it does not seem to work:

except the very first one (the ground) works, but all other reflections are gone.

Thereā€™s no setter for the renderList property on ReflectionProbe, only a getter.

If you want to set the value, you must do it through the texture: probe.cubeTexture.renderList = null;.

1 Like

Wow. This is the type of problem, which can cost you many hours to fix in JavaScriptā€¦
Thanks. Indeed it works:

For some reason the ground material has no CubeTexture, but the others do. Maybe one should implement a setter to avoid this problem?

Indeed, hereā€™s a PR that adds the setter:

Note that you have an error in your PG:

Thatā€™s because you canā€™t use a texture in your shader that you are currently rendering into.

1 Like

Thanks for pointing this out. But this means, that the null assignment is useless after all?
Yet it still somehow works, even with that error.
Should not the PR also automatically eliminate the mesh with the rendering texture from the render list?

In your case, yes, the mesh with a material which is using the render target texture must not be pushed in the renderList of that render target texture.

You canā€™t rely on that behavior, as itā€™s an error to do it this way. And in WebGPU, you donā€™t have any rendering.

The PR simply letā€™s you assign a value to renderList. When the render target is rendered, we donā€™t check if a material would use the same texture than the render target texture: it would take too much time to check all materials each time we render. Itā€™s the user responsibility to manage the list.