#Render Texture Nightmare

1 messages · Page 1 of 1 (latest)

placid cairn
#

Hello guys, I'm starting to get really annoyed by one Entities Graphics problem... The Render Texture, if provided by a Camera, need to be reassigned at runtime (the documentation says so).

I tried a few things from using a gameobject for updating the materials (didn't work) to trying to update from MeshArray and MeshMaterialInfo... But because the material was baked, I can't even access it...

So I guess the one thing left to do is to replace the Mesh Renderer baker with some custom stuff? Oh wait the material would still be baked.....

How do you do this .... thing ?
Please

#

Btw I also have the problem when I instanciate a gameobject in the system from a UnityObjectRef. Not sure if it's the same problem, that's weird.

placid cairn
#

Up (because I don't see the thread anymore in my interface)

modern verge
#

Tbh reading this I really have no idea what your problem is
No idea how camera rendertexture and entities are related here

placid cairn
sturdy igloo
#

Which is true for all assets btw, not just RenderTexture

placid cairn
sturdy igloo
#

both are present on baked renderer entities

placid cairn
sturdy igloo
#

yes, they have custom index system and you need to rely on methods which convert them to real array indices

#

don't remember exact API, so just use intellisense to figure which are those

#

it's on one of those types

placid cairn
#

I guess there is somewhere in the rendering system : the conversion or at least how it access the materials, I'll check

jade jasper
placid cairn
#

Do you know why I can access the system due to protection level ? I have a plugin who access it, but I don't see how.
I don't see any internal somewhere.

        `var registerMeshAndMaterialSystem = state.World.GetExistingSystemManaged<Unity.Rendering.RegisterMaterialsAndMeshesSystem>();`
jade jasper
#

if you have the entity with a materialmeshinfo you have both an index to the material (and the mesh), and you can use that to reassign your rendertexture after getting it from a rendermesharray. the examples dont have an exact replica of this but there should be basic examples of accessing both materialmeshinfo and rma

placid cairn
#

But if someone know how to override the default RenderMesh baking, it could be a workaround btw

jade jasper
#

hm did they retroactively make RegisterMaterialsAndMeshesSystem internal? if you use the asmref trick you can access it

placid cairn
#

Still it's frustrating when you see this par in the graphic System :

 BatchMaterialID materialID = materialMeshInfo.IsRuntimeMaterial
     ? materialMeshInfo.MaterialID
     : brgRenderMeshArray.GetMaterialID(materialMeshInfo);
modern verge
jade jasper
placid cairn
modern verge
#

Internal is default access modifier
if you don't assign one it becomes internal

placid cairn
modern verge
#

you basically inject AssemblyInfo with [assembly: InternalsVisibleTo("BovineLabs.Core")] into another assembly definition

placid cairn
#

ahh that's what the animation plugin did too

#

well I guess I'll go this way. A workaround for a know issue... that won't really surprise me if it's the best way to do it