Browse Source

Move GpuSceneParticleEmitter to its own array

Panagiotis Christopoulos Charitos 1 year ago
parent
commit
898ae65e2f

+ 1 - 0
AnKi/Renderer/Utils/Drawer.cpp

@@ -70,6 +70,7 @@ void RenderableDrawer::setState(const RenderableDrawerArguments& args, CommandBu
 	cmdb.bindStorageBuffer(ANKI_REG(ANKI_MATERIAL_REGISTER_RENDERABLES), GpuSceneArrays::Renderable::getSingleton().getBufferView());
 	cmdb.bindStorageBuffer(ANKI_REG(ANKI_MATERIAL_REGISTER_MESH_LODS), GpuSceneArrays::MeshLod::getSingleton().getBufferView());
 	cmdb.bindStorageBuffer(ANKI_REG(ANKI_MATERIAL_REGISTER_TRANSFORMS), GpuSceneArrays::Transform::getSingleton().getBufferView());
+	cmdb.bindStorageBuffer(ANKI_REG(ANKI_MATERIAL_REGISTER_PARTICLE_EMITTERS), GpuSceneArrays::ParticleEmitter::getSingleton().getBufferViewSafe());
 	cmdb.bindTexture(ANKI_REG(ANKI_MATERIAL_REGISTER_HZB_TEXTURE),
 					 (args.m_hzbTexture.isValid()) ? args.m_hzbTexture
 												   : TextureView(&getRenderer().getDummyTexture2d(), TextureSubresourceDesc::all()));

+ 1 - 1
AnKi/Renderer/Utils/GpuVisibility.cpp

@@ -425,7 +425,7 @@ void GpuVisibility::populateRenderGraphInternal(Bool distanceBased, BaseGpuVisib
 		cmdb.bindStorageBuffer(ANKI_REG(t1), GpuSceneArrays::Renderable::getSingleton().getBufferView());
 		cmdb.bindStorageBuffer(ANKI_REG(t2), GpuSceneArrays::MeshLod::getSingleton().getBufferView());
 		cmdb.bindStorageBuffer(ANKI_REG(t3), GpuSceneArrays::Transform::getSingleton().getBufferView());
-		cmdb.bindStorageBuffer(ANKI_REG(t4), GpuSceneBuffer::getSingleton().getBufferView());
+		cmdb.bindStorageBuffer(ANKI_REG(t4), GpuSceneArrays::ParticleEmitter::getSingleton().getBufferViewSafe());
 		if(gatherType & 1u)
 		{
 			cmdb.bindStorageBuffer(ANKI_REG(u0), out.m_legacy.m_renderableInstancesBuffer);

+ 1 - 0
AnKi/Scene/Components/ModelComponent.cpp

@@ -209,6 +209,7 @@ Error ModelComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 			gpuRenderable.m_uniformsOffset = m_patchInfos[i].m_gpuSceneUniformsOffset;
 			gpuRenderable.m_meshLodsIndex = m_patchInfos[i].m_gpuSceneMeshLods.getIndex() * kMaxLodCount;
 			gpuRenderable.m_boneTransformsOffset = (hasSkin) ? m_skinComponent->getBoneTransformsGpuSceneOffset() : 0;
+			gpuRenderable.m_particleEmitterIndex = kMaxU32;
 			if(!!(mtl.getRenderingTechniques() & RenderingTechniqueBit::kRtShadow))
 			{
 				const RenderingKey key(RenderingTechnique::kRtShadow, 0, false, false, false);

+ 2 - 2
AnKi/Scene/Components/ParticleEmitterComponent.cpp

@@ -396,11 +396,11 @@ Error ParticleEmitterComponent::update(SceneComponentUpdateInfo& info, Bool& upd
 		m_gpuSceneMeshLods.uploadToGpuScene(meshLods);
 
 		// Upload the GpuSceneRenderable
-		GpuSceneRenderable renderable;
+		GpuSceneRenderable renderable = {};
 		renderable.m_boneTransformsOffset = 0;
 		renderable.m_uniformsOffset = m_gpuSceneUniforms.getOffset();
 		renderable.m_meshLodsIndex = m_gpuSceneMeshLods.getIndex() * kMaxLodCount;
-		renderable.m_particleEmitterOffset = m_gpuSceneParticleEmitter.getGpuSceneOffset();
+		renderable.m_particleEmitterIndex = m_gpuSceneParticleEmitter.getIndex();
 		renderable.m_worldTransformsIndex = 0;
 		renderable.m_uuid = SceneGraph::getSingleton().getNewUuid();
 		if(!m_gpuSceneRenderable.isValid())

+ 13 - 0
AnKi/Scene/GpuSceneArray.h

@@ -127,6 +127,19 @@ public:
 		return {&GpuSceneBuffer::getSingleton().getBuffer(), getGpuSceneOffsetOfArrayBase(), getBufferRange()};
 	}
 
+	/// @note Thread-safe
+	BufferView getBufferViewSafe() const
+	{
+		PtrSize range = getBufferRange();
+		if(range == 0)
+		{
+			// Just set something
+			range = getElementSize();
+		}
+
+		return {&GpuSceneBuffer::getSingleton().getBuffer(), getGpuSceneOffsetOfArrayBase(), range};
+	}
+
 	/// Some bookeeping. Needs to be called once per frame.
 	/// @note Thread-safe
 	void flush()

+ 4 - 4
AnKi/Shaders/ForwardShadingParticles.ankiprog

@@ -34,9 +34,9 @@ struct VertOut
 
 VertOut main(VertIn input)
 {
-	const GpuSceneRenderableInstance renderable = unpackGpuSceneRenderableVertex(input.m_gpuSceneRenderable);
-	const GpuSceneParticleEmitter particles = g_gpuScene.Load<GpuSceneParticleEmitter>(renderable.m_boneTransformsOrParticleEmitterOffset);
-	const GpuSceneMeshLod meshLod = g_meshLods[renderable.m_meshLodIndex];
+	const GpuSceneRenderableInstance instance = unpackGpuSceneRenderableVertex(input.m_gpuSceneRenderable);
+	const GpuSceneParticleEmitter particles = g_particleEmitters[instance.m_boneTransformsOffsetOrParticleEmitterIndex];
+	const GpuSceneMeshLod meshLod = g_meshLods[instance.m_meshLodIndex];
 
 	const U32 particleId = input.m_svVertexId / meshLod.m_indexCount;
 	const U32 vertexId = g_unifiedGeom_R16_Uint[meshLod.m_firstIndex + input.m_svVertexId % meshLod.m_indexCount];
@@ -62,7 +62,7 @@ VertOut main(VertIn input)
 	output.m_svPosition = mul(g_globalUniforms.m_viewProjectionMatrix, Vec4(output.m_worldPos, 1.0));
 
 	output.m_alpha = particleAlpha;
-	output.m_uniformsOffset = renderable.m_uniformsOffset;
+	output.m_uniformsOffset = instance.m_uniformsOffset;
 
 	return output;
 }

+ 4 - 4
AnKi/Shaders/GBufferGeneric.ankiprog

@@ -265,7 +265,7 @@ VertOut main(VertIn input)
 
 	const U32 uniformsOffset = instance.m_uniformsOffset;
 	const U32 worldTransformsIndex = instance.m_worldTransformsIndex_25bit_meshletPrimitiveCount_7bit >> 7u;
-	const U32 boneTransformsOrParticleEmitterOffset = instance.m_boneTransformsOrParticleEmitterOffset;
+	const U32 boneTransformsOffset = instance.m_boneTransformsOffsetOrParticleEmitterIndex;
 
 #		if VISUALIZE_MESHLETS
 	output.m_meshletIndex = instance.m_meshletGeometryDescriptorIndex;
@@ -278,9 +278,9 @@ VertOut main(VertIn input)
 
 	const U32 uniformsOffset = instance.m_uniformsOffset;
 	const U32 worldTransformsIndex = instance.m_worldTransformsIndex;
-	const U32 boneTransformsOrParticleEmitterOffset = instance.m_boneTransformsOrParticleEmitterOffset;
+	const U32 boneTransformsOffset = instance.m_boneTransformsOffsetOrParticleEmitterIndex;
 #	endif // SW_MESHLETS
-	ANKI_MAYBE_UNUSED(boneTransformsOrParticleEmitterOffset);
+	ANKI_MAYBE_UNUSED(boneTransformsOffset);
 
 	const Mat3x4 worldTransform = g_transforms[worldTransformsIndex];
 	const Mat3x4 prevWorldTransform = g_transforms[worldTransformsIndex + 1u];
@@ -295,7 +295,7 @@ VertOut main(VertIn input)
 
 	// Do stuff
 #	if ANKI_BONES
-	skinning(vert, boneTransformsOrParticleEmitterOffset, vert.m_position, prevPos, vert.m_normal);
+	skinning(vert, boneTransformsOffset, vert.m_position, prevPos, vert.m_normal);
 #	endif
 
 	const Vec3 worldPos = mul(worldTransform, Vec4(vert.m_position, 1.0));

+ 1 - 1
AnKi/Shaders/GBufferGpuParticles.ankiprog

@@ -43,7 +43,7 @@ VertOut main(VertIn input)
 	VertOut output;
 
 	const GpuSceneRenderableInstance renderable = unpackGpuSceneRenderableVertex(input.m_gpuSceneRenderable);
-	const GpuSceneParticleEmitter particles = g_gpuScene.Load<GpuSceneParticleEmitter>(renderable.m_boneTransformsOrParticleEmitterOffset);
+	const GpuSceneParticleEmitter particles = g_particleEmitters[renderable.m_boneTransformsOffsetOrParticleEmitterIndex];
 
 	// Read vertex
 	const U32 particleId = input.m_svVertexId;

+ 4 - 4
AnKi/Shaders/GpuVisibility.ankiprog

@@ -35,7 +35,7 @@ StructuredBuffer<GpuSceneRenderableBoundingVolume> g_renderableBoundingVolumes :
 StructuredBuffer<GpuSceneRenderable> g_renderables : register(t1);
 StructuredBuffer<GpuSceneMeshLod> g_meshLods : register(t2);
 StructuredBuffer<Mat3x4> g_transforms : register(t3);
-ByteAddressBuffer g_gpuScene : register(t4);
+StructuredBuffer<GpuSceneParticleEmitter> g_particleEmitters : register(t4);
 
 #if GATHER_MDI
 // These 3 have the same size
@@ -162,7 +162,7 @@ RWStructuredBuffer<GpuVisibilityHash> g_hash : register(u7);
 	const U32 meshLodIndex = renderable.m_meshLodsIndex + lod;
 	const GpuSceneMeshLod meshLod = g_meshLods[meshLodIndex];
 
-	const Bool isParticleEmitter = renderable.m_particleEmitterOffset != 0;
+	const Bool isParticleEmitter = renderable.m_particleEmitterIndex < kMaxU32;
 	ANKI_MAYBE_UNUSED(isParticleEmitter);
 
 	const Bool usesMeshShaders = meshLod.m_meshletCount != 0u;
@@ -238,7 +238,7 @@ RWStructuredBuffer<GpuVisibilityHash> g_hash : register(u7);
 			}
 			else
 			{
-				const GpuSceneParticleEmitter emitter = g_gpuScene.Load<GpuSceneParticleEmitter>(renderable.m_particleEmitterOffset);
+				const GpuSceneParticleEmitter emitter = g_particleEmitters[renderable.m_particleEmitterIndex];
 
 				DrawIndirectArgsWithPadding indirect;
 				indirect.m_vertexCount = emitter.m_aliveParticleCount * meshLod.m_indexCount;
@@ -252,7 +252,7 @@ RWStructuredBuffer<GpuVisibilityHash> g_hash : register(u7);
 				instanceVertex.x = renderable.m_worldTransformsIndex;
 				instanceVertex.y = renderable.m_uniformsOffset;
 				instanceVertex.z = meshLodIndex;
-				instanceVertex.w = renderable.m_particleEmitterOffset;
+				instanceVertex.w = renderable.m_particleEmitterIndex;
 				g_instanceRateRenderables[indirectIdx] = instanceVertex;
 			}
 		}

+ 2 - 2
AnKi/Shaders/GpuVisibilityMeshlet.ankiprog

@@ -125,8 +125,8 @@ ANKI_PUSH_CONSTANTS(Consts, g_unis)
 				instance.m_worldTransformsIndex_25bit_meshletPrimitiveCount_7bit = renderable.m_worldTransformsIndex << 7u;
 				instance.m_worldTransformsIndex_25bit_meshletPrimitiveCount_7bit |= meshletBoundingVol.m_primitiveCount;
 				instance.m_uniformsOffset = renderable.m_uniformsOffset;
-				instance.m_boneTransformsOrParticleEmitterOffset =
-					(renderable.m_boneTransformsOffset) ? renderable.m_boneTransformsOffset : renderable.m_particleEmitterOffset;
+				instance.m_boneTransformsOffsetOrParticleEmitterIndex =
+					(renderable.m_boneTransformsOffset) ? renderable.m_boneTransformsOffset : renderable.m_particleEmitterIndex;
 
 				g_meshletInstances[g_unis.m_firstMeshlet + instanceIdx] = instance;
 			}

+ 2 - 2
AnKi/Shaders/Include/GpuSceneFunctions.h

@@ -15,7 +15,7 @@ inline GpuSceneRenderableInstance unpackGpuSceneRenderableVertex(UVec4 x)
 	o.m_worldTransformsIndex = x[0];
 	o.m_uniformsOffset = x[1];
 	o.m_meshLodIndex = x[2];
-	o.m_boneTransformsOrParticleEmitterOffset = x[3];
+	o.m_boneTransformsOffsetOrParticleEmitterIndex = x[3];
 	return o;
 }
 
@@ -25,7 +25,7 @@ inline GpuSceneMeshletInstance unpackGpuSceneMeshletInstance(UVec4 x)
 	o.m_worldTransformsIndex_25bit_meshletPrimitiveCount_7bit = x[0];
 	o.m_uniformsOffset = x[1];
 	o.m_meshletGeometryDescriptorIndex = x[2];
-	o.m_boneTransformsOrParticleEmitterOffset = x[3];
+	o.m_boneTransformsOffsetOrParticleEmitterIndex = x[3];
 	return o;
 }
 

+ 3 - 3
AnKi/Shaders/Include/GpuSceneTypes.h

@@ -23,7 +23,7 @@ struct GpuSceneRenderable
 	U32 m_uniformsOffset;
 	U32 m_meshLodsIndex; ///< Points to the array of GpuSceneMeshLod. kMaxLodCount are reserved for each renderable.
 	U32 m_boneTransformsOffset; ///< Array of Mat3x4 or 0 if its not a skin.
-	U32 m_particleEmitterOffset; ///< Offset to GpuSceneParticleEmitter or 0 if it's not an emitter.
+	U32 m_particleEmitterIndex; ///< Index to the GpuSceneParticleEmitter array or kMaxU32 if it's not an emitter.
 	U32 m_rtShadowsShaderHandleIndex; ///< The index of the shader handle in the array of library's handles.
 	U32 m_uuid;
 };
@@ -34,7 +34,7 @@ struct GpuSceneRenderableInstance
 	U32 m_worldTransformsIndex;
 	U32 m_uniformsOffset;
 	U32 m_meshLodIndex; ///< Points to a single GpuSceneMeshLod in the mesh lods.
-	U32 m_boneTransformsOrParticleEmitterOffset;
+	U32 m_boneTransformsOffsetOrParticleEmitterIndex;
 };
 static_assert(sizeof(GpuSceneRenderableInstance) == sizeof(UVec4));
 
@@ -51,7 +51,7 @@ struct GpuSceneMeshletInstance
 	U32 m_worldTransformsIndex_25bit_meshletPrimitiveCount_7bit;
 	U32 m_uniformsOffset;
 	U32 m_meshletGeometryDescriptorIndex; ///< Index in the UGB.
-	U32 m_boneTransformsOrParticleEmitterOffset;
+	U32 m_boneTransformsOffsetOrParticleEmitterIndex;
 };
 static_assert(kMaxPrimitivesPerMeshlet < ((1u << 7u) - 1));
 

+ 10 - 9
AnKi/Shaders/Include/MaterialTypes.h

@@ -35,22 +35,23 @@ static_assert(sizeof(MaterialGlobalUniforms) == 16 * sizeof(Vec4));
 #define ANKI_MATERIAL_REGISTER_MESHLET_GROUPS t3
 #define ANKI_MATERIAL_REGISTER_RENDERABLES t4
 #define ANKI_MATERIAL_REGISTER_MESH_LODS t5
-#define ANKI_MATERIAL_REGISTER_TRANSFORMS t6
-#define ANKI_MATERIAL_REGISTER_HZB_TEXTURE t7
+#define ANKI_MATERIAL_REGISTER_PARTICLE_EMITTERS t6
+#define ANKI_MATERIAL_REGISTER_TRANSFORMS t7
+#define ANKI_MATERIAL_REGISTER_HZB_TEXTURE t8
 #define ANKI_MATERIAL_REGISTER_NEAREST_CLAMP_SAMPLER s1
 
 // For FW shading:
 #define ANKI_MATERIAL_REGISTER_LINEAR_CLAMP_SAMPLER s2
 #define ANKI_MATERIAL_REGISTER_SHADOW_SAMPLER s3
-#define ANKI_MATERIAL_REGISTER_SCENE_DEPTH t8
-#define ANKI_MATERIAL_REGISTER_LIGHT_VOLUME t9
+#define ANKI_MATERIAL_REGISTER_SCENE_DEPTH t9
+#define ANKI_MATERIAL_REGISTER_LIGHT_VOLUME t10
 #define ANKI_MATERIAL_REGISTER_CLUSTER_SHADING_UNIFORMS b1
-#define ANKI_MATERIAL_REGISTER_CLUSTER_SHADING_POINT_LIGHTS t10
-#define ANKI_MATERIAL_REGISTER_CLUSTER_SHADING_SPOT_LIGHTS t11
-#define ANKI_MATERIAL_REGISTER_SHADOW_ATLAS t12
-#define ANKI_MATERIAL_REGISTER_CLUSTERS t13
+#define ANKI_MATERIAL_REGISTER_CLUSTER_SHADING_POINT_LIGHTS t11
+#define ANKI_MATERIAL_REGISTER_CLUSTER_SHADING_SPOT_LIGHTS t12
+#define ANKI_MATERIAL_REGISTER_SHADOW_ATLAS t13
+#define ANKI_MATERIAL_REGISTER_CLUSTERS t14
 
 // Always last because it's variable. Texture buffer bindings pointing to unified geom buffer:
-#define ANKI_MATERIAL_REGISTER_UNIFIED_GEOMETRY_START t14
+#define ANKI_MATERIAL_REGISTER_UNIFIED_GEOMETRY_START t15
 
 ANKI_END_NAMESPACE

+ 1 - 0
AnKi/Shaders/MaterialShadersCommon.hlsl

@@ -29,6 +29,7 @@ StructuredBuffer<GpuSceneMeshLod> g_meshLods : register(ANKI_MATERIAL_REGISTER_M
 StructuredBuffer<Mat3x4> g_transforms : register(ANKI_MATERIAL_REGISTER_TRANSFORMS);
 Texture2D<Vec4> g_hzbTexture : register(ANKI_MATERIAL_REGISTER_HZB_TEXTURE);
 SamplerState g_nearestClampSampler : register(ANKI_MATERIAL_REGISTER_NEAREST_CLAMP_SAMPLER);
+StructuredBuffer<GpuSceneParticleEmitter> g_particleEmitters : register(ANKI_MATERIAL_REGISTER_PARTICLE_EMITTERS);
 
 // FW shading specific
 #if defined(FORWARD_SHADING)

BIN
Samples/PhysicsPlayground/Assets/Icosphere_834d64c142beaa13.ankimesh


+ 54 - 54
Samples/PhysicsPlayground/Assets/Scene.lua

@@ -1,4 +1,4 @@
--- Generated by: C:\src\anki\out\build\x64-Debug\Bin\GltfImporter.exe PhysicsPlayground.gltf C:/src/anki/Samples/PhysicsPlayground/Assets/ -rpath Assets -texrpath Assets -v
+-- Generated by: C:\src\anki\out\build\x64-Debug\Binaries\GltfImporter.exe PhysicsPlayground.gltf C:/src/anki/Samples/PhysicsPlayground/Assets/ -rpath Assets -texrpath Assets -v
 local scene = getSceneGraph()
 local events = getEventManager()
 
@@ -9,7 +9,7 @@ trf:setOrigin(Vec4.new(25.411236, 3.345554, 28.742823, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.912920)
+trf:setScale(Vec4.new(1.912920, 1.912920, 1.912920, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -22,7 +22,7 @@ trf:setOrigin(Vec4.new(25.411236, 3.316930, 22.637743, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.264235)
+trf:setScale(Vec4.new(1.264235, 1.264235, 1.264235, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -35,7 +35,7 @@ trf:setOrigin(Vec4.new(30.798492, 2.376611, -6.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -48,7 +48,7 @@ trf:setOrigin(Vec4.new(29.798492, 1.376611, -6.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -61,7 +61,7 @@ trf:setOrigin(Vec4.new(28.798492, 0.376611, -6.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -74,7 +74,7 @@ trf:setOrigin(Vec4.new(31.798492, 3.376611, -6.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -87,7 +87,7 @@ trf:setOrigin(Vec4.new(32.798492, 4.376611, -6.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -100,7 +100,7 @@ trf:setOrigin(Vec4.new(33.798492, 5.376611, -6.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -113,7 +113,7 @@ trf:setOrigin(Vec4.new(39.798492, 6.376611, 0.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -126,7 +126,7 @@ trf:setOrigin(Vec4.new(39.798492, 6.376611, -6.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -139,7 +139,7 @@ trf:setOrigin(Vec4.new(39.798492, 6.376611, 6.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -152,7 +152,7 @@ trf:setOrigin(Vec4.new(39.798492, 6.376611, 12.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -165,7 +165,7 @@ trf:setOrigin(Vec4.new(42.271385, 2.886189, 0.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -178,7 +178,7 @@ trf:setOrigin(Vec4.new(42.271385, 2.886189, -6.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -191,7 +191,7 @@ trf:setOrigin(Vec4.new(42.271385, 2.886189, 6.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -204,7 +204,7 @@ trf:setOrigin(Vec4.new(42.271385, 2.886189, 12.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -217,7 +217,7 @@ trf:setOrigin(Vec4.new(37.271385, 2.886189, 12.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -230,7 +230,7 @@ trf:setOrigin(Vec4.new(37.271385, 2.886189, 6.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -243,7 +243,7 @@ trf:setOrigin(Vec4.new(37.271385, 2.886189, -6.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -256,7 +256,7 @@ trf:setOrigin(Vec4.new(37.271385, 2.886189, 0.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -269,7 +269,7 @@ trf:setOrigin(Vec4.new(179.044937, 9.701135, 0.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -282,7 +282,7 @@ trf:setOrigin(Vec4.new(0.000000, -5.068616, 0.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -298,7 +298,7 @@ trf:setOrigin(Vec4.new(4.076245, 74.444725, -1.005454, 0))
 rot = Mat3x4.new()
 rot:setAll(0.649201, -0.658183, -0.381226, 0.000000, 0.506372, 0.000000, 0.862315, 0.000000, -0.567562, -0.752858, 0.333286, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 
 node = scene:newSceneNode("Camera_Orientation")
@@ -310,7 +310,7 @@ trf:setOrigin(Vec4.new(7.481132, 7.870111, 6.507640, 0))
 rot = Mat3x4.new()
 rot:setAll(0.685921, -0.324013, 0.651558, 0.000000, 0.000000, 0.895396, 0.445271, 0.000000, -0.727676, -0.305421, 0.614170, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 
 node = scene:newSceneNode("Cube.021")
@@ -320,7 +320,7 @@ trf:setOrigin(Vec4.new(39.798492, 6.376611, -12.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -333,7 +333,7 @@ trf:setOrigin(Vec4.new(42.271385, 2.886189, -12.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -346,7 +346,7 @@ trf:setOrigin(Vec4.new(37.271385, 2.886189, -12.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -359,7 +359,7 @@ trf:setOrigin(Vec4.new(39.798492, 6.376611, -18.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -372,7 +372,7 @@ trf:setOrigin(Vec4.new(42.271385, 2.886189, -18.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -385,7 +385,7 @@ trf:setOrigin(Vec4.new(37.271385, 2.886189, -18.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -398,7 +398,7 @@ trf:setOrigin(Vec4.new(34.761005, 2.886189, -21.498241, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -411,7 +411,7 @@ trf:setOrigin(Vec4.new(44.761005, 2.886189, -21.498241, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -424,7 +424,7 @@ trf:setOrigin(Vec4.new(47.271385, 2.886189, -25.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -437,7 +437,7 @@ trf:setOrigin(Vec4.new(32.271385, 2.886189, -25.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -450,7 +450,7 @@ trf:setOrigin(Vec4.new(32.271385, 2.886189, -31.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -463,7 +463,7 @@ trf:setOrigin(Vec4.new(47.271385, 2.886189, -31.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -476,7 +476,7 @@ trf:setOrigin(Vec4.new(44.761005, 2.886189, -34.498241, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -489,7 +489,7 @@ trf:setOrigin(Vec4.new(38.761005, 2.886189, -34.498241, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -502,7 +502,7 @@ trf:setOrigin(Vec4.new(34.761005, 2.886189, -34.498241, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(0.995130)
+trf:setScale(Vec4.new(0.995130, 0.995130, 0.995130, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -515,7 +515,7 @@ trf:setOrigin(Vec4.new(34.798492, 6.376611, -32.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -528,7 +528,7 @@ trf:setOrigin(Vec4.new(34.798492, 6.376611, -24.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -541,7 +541,7 @@ trf:setOrigin(Vec4.new(34.798492, 6.398044, -28.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -554,7 +554,7 @@ trf:setOrigin(Vec4.new(44.798492, 6.376611, -32.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -567,7 +567,7 @@ trf:setOrigin(Vec4.new(44.798492, 6.376611, -24.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -580,7 +580,7 @@ trf:setOrigin(Vec4.new(44.798492, 6.398044, -28.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -593,7 +593,7 @@ trf:setOrigin(Vec4.new(39.798492, 6.334259, -31.947594, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -606,7 +606,7 @@ trf:setOrigin(Vec4.new(39.798492, 6.334259, -23.947592, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -619,7 +619,7 @@ trf:setOrigin(Vec4.new(39.798492, 6.355691, -27.947592, 0))
 rot = Mat3x4.new()
 rot:setAll(0.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 comp = node:newBodyComponent()
 comp:setMeshFromModelComponent()
@@ -634,7 +634,7 @@ trf:setOrigin(Vec4.new(-0.068372, 9.192602, -0.126609, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 
 node = scene:newSceneNode("refl_probe")
@@ -645,7 +645,7 @@ trf:setOrigin(Vec4.new(0.000000, 9.113202, 0.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 
 node = scene:newSceneNode("Cube.045")
@@ -656,17 +656,17 @@ trf:setOrigin(Vec4.new(39.731613, 2.915391, -28.049887, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)
 
 node = scene:newSceneNode("Skybox")
 comp = node:newSkyboxComponent()
 comp:loadImageResource("EngineAssets/DefaultSkybox.ankitex")
-comp:setMaxFogDensity("0.100000")
+comp:setMaxFogDensity(0.100000)
 trf = Transform.new()
 trf:setOrigin(Vec4.new(-3.710423, 69.685875, 0.000000, 0))
 rot = Mat3x4.new()
 rot:setAll(1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)
 trf:setRotation(rot)
-trf:setScale(1.000000)
+trf:setScale(Vec4.new(1.000000, 1.000000, 1.000000, 0))
 node:setLocalTransform(trf)

BIN
Samples/PhysicsPlayground/Assets/Suzanne_e3526e1428c0763c.ankimesh


+ 16 - 26
Samples/PhysicsPlayground/Assets/dynamic_f238b379a41079ff.ankimtl

@@ -1,36 +1,26 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ImporterMaterial.cpp -->
 <material shadows="1">
-	<shaderPrograms>
-		<shaderProgram name="GBufferGeneric">
-			<mutation>
-				<mutator name="DIFFUSE_TEX" value="0"/>
-				<mutator name="SPECULAR_TEX" value="0"/>
-				<mutator name="ROUGHNESS_TEX" value="0"/>
-				<mutator name="METAL_TEX" value="0"/>
-				<mutator name="NORMAL_TEX" value="0"/>
-				<mutator name="PARALLAX" value="0"/>
-				<mutator name="EMISSIVE_TEX" value="0"/>
-				<mutator name="ALPHA_TEST" value="0"/>
-			</mutation>
-		</shaderProgram>
-		
-		<shaderProgram name="RtShadowsHit">
-			<mutation>
-				<mutator name="ALPHA_TEXTURE" value="0"/>
-			</mutation>
-		</shaderProgram>
-
-	</shaderPrograms>
+	<shaderProgram name="GBufferGeneric">
+		<mutation>
+			<mutator name="DIFFUSE_TEX" value="0"/>
+			<mutator name="SPECULAR_TEX" value="0"/>
+			<mutator name="ROUGHNESS_METALNESS_TEX" value="0"/>
+			<mutator name="NORMAL_TEX" value="0"/>
+			<mutator name="PARALLAX" value="0"/>
+			<mutator name="EMISSIVE_TEX" value="0"/>
+			<mutator name="ALPHA_TEST" value="0"/>
+		</mutation>
+	</shaderProgram>
 
 	<inputs>
 		
-		<input name="m_diffColor" value="0.097887 0.273263 0.800000"/>
-		<input name="m_specColor" value="0.040000 0.040000 0.040000"/>
-		<input name="m_roughness" value="0.000000"/>
-		<input name="m_metallic" value="0.609091"/>
+		<input name="m_diffuseScale" value="0.097887 0.273263 0.800000 1.000000"/>
+		<input name="m_specularScale" value="0.040000 0.040000 0.040000"/>
+		<input name="m_roughnessScale" value="0.000000"/>
+		<input name="m_metalnessScale" value="0.609091"/>
 		
-		<input name="m_emission" value="0.000000 0.000000 0.000000"/>
+		<input name="m_emissionScale" value="0.000000 0.000000 0.000000"/>
 		<input name="m_subsurface" value="0.000000"/>
 		
 	</inputs>

BIN
Samples/PhysicsPlayground/Assets/floor_71cbd2644e53ab8c.ankimesh


BIN
Samples/PhysicsPlayground/Assets/wall_87565b500719f7c4.ankimesh


+ 18 - 26
Samples/PhysicsPlayground/Assets/walls.001_2469a4d42c8d129c.ankimtl

@@ -1,36 +1,28 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ImporterMaterial.cpp -->
 <material shadows="1">
-	<shaderPrograms>
-		<shaderProgram name="GBufferGeneric">
-			<mutation>
-				<mutator name="DIFFUSE_TEX" value="1"/>
-				<mutator name="SPECULAR_TEX" value="0"/>
-				<mutator name="ROUGHNESS_TEX" value="1"/>
-				<mutator name="METAL_TEX" value="0"/>
-				<mutator name="NORMAL_TEX" value="1"/>
-				<mutator name="PARALLAX" value="0"/>
-				<mutator name="EMISSIVE_TEX" value="0"/>
-				<mutator name="ALPHA_TEST" value="0"/>
-			</mutation>
-		</shaderProgram>
-		
-		<shaderProgram name="RtShadowsHit">
-			<mutation>
-				<mutator name="ALPHA_TEXTURE" value="0"/>
-			</mutation>
-		</shaderProgram>
-
-	</shaderPrograms>
+	<shaderProgram name="GBufferGeneric">
+		<mutation>
+			<mutator name="DIFFUSE_TEX" value="1"/>
+			<mutator name="SPECULAR_TEX" value="0"/>
+			<mutator name="ROUGHNESS_METALNESS_TEX" value="1"/>
+			<mutator name="NORMAL_TEX" value="1"/>
+			<mutator name="PARALLAX" value="0"/>
+			<mutator name="EMISSIVE_TEX" value="0"/>
+			<mutator name="ALPHA_TEST" value="0"/>
+		</mutation>
+	</shaderProgram>
 
 	<inputs>
 		
-		<input name="m_diffTex" value="Assets/Stone_Wall_007_COLOR.ankitex"/>
-		<input name="m_specColor" value="0.040000 0.040000 0.040000"/>
-		<input name="m_roughnessTex" value="Assets/Stone_Wall_007_ROUGH.ankitex"/>
-		<input name="m_metallic" value="0.000000"/>
+		<input name="m_diffuseTex" value="Assets/Stone_Wall_007_COLOR.ankitex"/>
+		<input name="m_diffuseScale" value="1.000000 1.000000 1.000000 1.000000"/>
+		<input name="m_specularScale" value="0.040000 0.040000 0.040000"/>
+		<input name="m_roughnessMetalnessTex" value="Assets/Stone_Wall_007_ROUGH.ankitex"/>
+		<input name="m_roughnessScale" value="1.000000"/>
+		<input name="m_metalnessScale" value="0.000000"/>
 		<input name="m_normalTex" value="Assets/Stone_Wall_007_NORM.ankitex"/>
-		<input name="m_emission" value="0.000000 0.000000 0.000000"/>
+		<input name="m_emissionScale" value="0.000000 0.000000 0.000000"/>
 		<input name="m_subsurface" value="0.000000"/>
 		
 	</inputs>

+ 18 - 26
Samples/PhysicsPlayground/Assets/walls_9619132fa258d22d.ankimtl

@@ -1,36 +1,28 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!-- This file is auto generated by ImporterMaterial.cpp -->
 <material shadows="1">
-	<shaderPrograms>
-		<shaderProgram name="GBufferGeneric">
-			<mutation>
-				<mutator name="DIFFUSE_TEX" value="1"/>
-				<mutator name="SPECULAR_TEX" value="0"/>
-				<mutator name="ROUGHNESS_TEX" value="1"/>
-				<mutator name="METAL_TEX" value="0"/>
-				<mutator name="NORMAL_TEX" value="1"/>
-				<mutator name="PARALLAX" value="0"/>
-				<mutator name="EMISSIVE_TEX" value="0"/>
-				<mutator name="ALPHA_TEST" value="0"/>
-			</mutation>
-		</shaderProgram>
-		
-		<shaderProgram name="RtShadowsHit">
-			<mutation>
-				<mutator name="ALPHA_TEXTURE" value="0"/>
-			</mutation>
-		</shaderProgram>
-
-	</shaderPrograms>
+	<shaderProgram name="GBufferGeneric">
+		<mutation>
+			<mutator name="DIFFUSE_TEX" value="1"/>
+			<mutator name="SPECULAR_TEX" value="0"/>
+			<mutator name="ROUGHNESS_METALNESS_TEX" value="1"/>
+			<mutator name="NORMAL_TEX" value="1"/>
+			<mutator name="PARALLAX" value="0"/>
+			<mutator name="EMISSIVE_TEX" value="0"/>
+			<mutator name="ALPHA_TEST" value="0"/>
+		</mutation>
+	</shaderProgram>
 
 	<inputs>
 		
-		<input name="m_diffTex" value="Assets/Asphalt_004_COLOR.ankitex"/>
-		<input name="m_specColor" value="0.040000 0.040000 0.040000"/>
-		<input name="m_roughnessTex" value="Assets/Asphalt_004_ROUGH.ankitex"/>
-		<input name="m_metallic" value="0.000000"/>
+		<input name="m_diffuseTex" value="Assets/Asphalt_004_COLOR.ankitex"/>
+		<input name="m_diffuseScale" value="1.000000 1.000000 1.000000 1.000000"/>
+		<input name="m_specularScale" value="0.040000 0.040000 0.040000"/>
+		<input name="m_roughnessMetalnessTex" value="Assets/Asphalt_004_ROUGH.ankitex"/>
+		<input name="m_roughnessScale" value="1.000000"/>
+		<input name="m_metalnessScale" value="0.000000"/>
 		<input name="m_normalTex" value="Assets/Asphalt_004_NRM.ankitex"/>
-		<input name="m_emission" value="0.000000 0.000000 0.000000"/>
+		<input name="m_emissionScale" value="0.000000 0.000000 0.000000"/>
 		<input name="m_subsurface" value="0.000000"/>
 		
 	</inputs>