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;
.
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.
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.