Game Development Community

MatInstance not a instance?

by Wesley Hopson · in Torque 3D Professional · 03/23/2017 (11:39 am) · 1 replies

I have been working on setting up a custom texture transform for shapes. I want to be able to individually alter the tex coords of common objects like rocks ect.. to vary them up a bit. I have run into a bit of a problem. Passing in a matrix to matinstance and the processed materials was not hard nor was getting it working using the same location as the Texture Animations.

The problem though is that changing one object changes all objects with the same material. Why is this I am storing the transform in matinstance and i have confirmed they are in fact all independently setting there transform. I have tried using the instancing material hook too with no real results.

Rendering is far from my expertise but from my playing around with it, it seems one of the set texture coordinates is overriding the rest. Creating a weird affect where the coordinates shift depending where the camera is. This leads me to think that though they are separately calling GFX->drawPrimitive that they are not getting drawn immediately resulting in the tex coordinates getting changed.

Any help would be appreciated this has been driving me bonkers for the past few days.

#1
03/23/2017 (1:09 pm)
Taking github.com/GarageGames/Torque3D/pull/1921/files into account? If not, as with that bug, it'll run with the last var sent down the pipe.