I’ve got another scene replication question here.
When I do the following:
local material=Material:new()
material:SetShaderParameter("MatDiffColor",Variant(Vector4(.2,.2,.2,1)))
matInnerWheel=material
I get gray (nil) materials.
However, this works for scene replication:
matHull=cache:GetResource("Material", "Materials/Green.xml")
matHull:SetShaderParameter("MatDiffColor",Variant(Vector4(.05,.1,.05,1)))
Is there a reason for this? I’m using, as you can see, extremely simple coloring, so making a new material on the fly is preferred. It’s not a problem to make an .xml file beforehand for each color that I’d need, but in the future it’d be nice to create these via code.
Looks like I can pull up the xml file and then adjust the parameters afterward, though. Any reason this is requiring an actual file?