Skip to content

Commit

Permalink
#123 Apply customize shader & control customize material on editor
Browse files Browse the repository at this point in the history
  • Loading branch information
ducphamhong committed Jun 24, 2022
1 parent 46fc90e commit 6662525
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<uniform name="uMvpMatrix" type="WORLD_VIEW_PROJECTION" value="0" float="16" matrix="true"/>
<uniform name="uWorldMatrix" type="WORLD" value="0" float="16" matrix="true"/>
<uniform name="uView" type="DEFERRED_VIEW" value="0" float="16" matrix="true"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0,1.0,0.0,0.0" float="4"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0, 1.0, 0.0, 0.0" float="4"/>
</vs>
<fs>
<uniform name="uTexDiffuse" type="DEFAULT_VALUE" value="0" float="1" directX="false"/>
Expand All @@ -20,6 +20,7 @@
</ui>
<ui control="UIGroup" name="Customize">
<ui control="UIColor" name="uColor"/>
<ui control="UIFloat4" name="uUVScale" elementName="UV ScaleX;UV ScaleY;UV OffsetX;UV OffsetY"/>
<ui control="UIFloat2" name="uSpecGloss" elementName="Specular;Glossiness" min="0" max="1"/>
</ui>
</customUI>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<uniform name="uMvpMatrix" type="WORLD_VIEW_PROJECTION" value="0" float="16" matrix="true"/>
<uniform name="uWorldMatrix" type="WORLD" value="0" float="16" matrix="true"/>
<uniform name="uView" type="DEFERRED_VIEW" value="0" float="16" matrix="true"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0,1.0,0.0,0.0" float="4"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0, 1.0, 0.0, 0.0" float="4"/>
</vs>
<fs>
<uniform name="uTexDiffuse" type="DEFAULT_VALUE" value="0" float="1" directX="false"/>
Expand All @@ -22,6 +22,7 @@
</ui>
<ui control="UIGroup" name="Customize">
<ui control="UIColor" name="uColor"/>
<ui control="UIFloat4" name="uUVScale" elementName="UV ScaleX;UV ScaleY;UV OffsetX;UV OffsetY"/>
<ui control="UIFloat2" name="uSpecGloss" elementName="Specular;Glossiness" min="0" max="1"/>
</ui>
</customUI>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<uniform name="uMvpMatrix" type="WORLD_VIEW_PROJECTION" value="0" float="16" matrix="true"/>
<uniform name="uWorldMatrix" type="WORLD" value="0" float="16" matrix="true"/>
<uniform name="uView" type="DEFERRED_VIEW" value="0" float="16" matrix="true"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0,1.0,0.0,0.0" float="4"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0, 1.0, 0.0, 0.0" float="4"/>
</vs>
<fs>
<uniform name="uTexDiffuse" type="DEFAULT_VALUE" value="0" float="1" directX="false"/>
Expand All @@ -24,6 +24,7 @@
</ui>
<ui control="UIGroup" name="Customize">
<ui control="UIColor" name="uColor"/>
<ui control="UIFloat4" name="uUVScale" elementName="UV ScaleX;UV ScaleY;UV OffsetX;UV OffsetY"/>
<ui control="UIFloat2" name="uGloss" elementName=";Glossiness" min="0" max="1"/>
</ui>
</customUI>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<uniform name="uMvpMatrix" type="WORLD_VIEW_PROJECTION" value="0" float="16" matrix="true"/>
<uniform name="uWorldMatrix" type="WORLD" value="0" float="16" matrix="true"/>
<uniform name="uView" type="DEFERRED_VIEW" value="0" float="16" matrix="true"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0,1.0,0.0,0.0" float="4"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0, 1.0, 0.0, 0.0" float="4"/>
</vs>
<fs>
<uniform name="uTexDiffuse" type="DEFAULT_VALUE" value="0" float="1" directX="false"/>
Expand All @@ -23,6 +23,7 @@
</ui>
<ui control="UIGroup" name="Customize">
<ui control="UIColor" name="uColor"/>
<ui control="UIFloat4" name="uUVScale" elementName="UV ScaleX;UV ScaleY;UV OffsetX;UV OffsetY"/>
</ui>
</customUI>
<shader type="GLSL" vs="GLSL/SpecularGlossinessVS.glsl" fs="GLSL/SpecularGlossinessFS.glsl"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<uniform name="uMvpMatrix" type="WORLD_VIEW_PROJECTION" value="0" float="16" matrix="true"/>
<uniform name="uWorldMatrix" type="WORLD" value="0" float="16" matrix="true"/>
<uniform name="uView" type="DEFERRED_VIEW" value="0" float="16" matrix="true"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0,1.0,0.0,0.0" float="4"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0, 1.0, 0.0, 0.0" float="4"/>
</vs>
<fs>
<uniform name="uTexDiffuse" type="DEFAULT_VALUE" value="0" float="1" directX="false"/>
Expand All @@ -26,6 +26,7 @@
</ui>
<ui control="UIGroup" name="Customize">
<ui control="UIColor" name="uColor"/>
<ui control="UIFloat4" name="uUVScale" elementName="UV ScaleX;UV ScaleY;UV OffsetX;UV OffsetY"/>
<ui control="UIFloat" name="uCutoff" elementName="Cutoff" min="0" max="1"/>
</ui>
</customUI>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ uniform sampler2D uTexSpecular;
uniform samplerCube uTexReflect;

uniform vec4 uLightColor;
unfform vec4 uColor;
uniform vec4 uSHConst[4];

in vec2 vTexCoord0;
Expand Down Expand Up @@ -46,7 +47,7 @@ float solveMetallic(vec3 diffuse, vec3 specular, float oneMinusSpecularStrength)

void main(void)
{
vec4 diffuseMap = texture(uTexDiffuse, vTexCoord0.xy);
vec4 diffuseMap = texture(uTexDiffuse, vTexCoord0.xy) * uColor;
vec3 normalMap = texture(uTexNormal, vTexCoord0.xy).xyz;
vec3 specMap = texture(uTexSpecular, vTexCoord0.xy).xyz;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ uniform sampler2D uTexNormal;
uniform sampler2D uTexSpecular;
uniform samplerCube uTexReflect;
uniform vec4 uLightColor;
unfform vec4 uColor;
uniform vec4 uSHConst[4];
in vec2 vTexCoord0;
in vec3 vWorldNormal;
Expand Down Expand Up @@ -44,7 +45,7 @@ float solveMetallic(vec3 diffuse, vec3 specular, float oneMinusSpecularStrength)
}
void main(void)
{
vec4 diffuseMap = texture(uTexDiffuse, vTexCoord0.xy);
vec4 diffuseMap = texture(uTexDiffuse, vTexCoord0.xy) * uColor;
vec3 normalMap = texture(uTexNormal, vTexCoord0.xy).xyz;
vec3 specMap = texture(uTexSpecular, vTexCoord0.xy).xyz;
mat3 rotation = mat3(vWorldTangent, vWorldBinormal, vWorldNormal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ uniform mat4 uMvpMatrix;
uniform mat4 uWorldMatrix;
uniform vec4 uCameraPosition;
uniform vec4 uLightDirection;
uniform vec4 uUVScale;
uniform mat4 uBoneMatrix[64];

out vec2 vTexCoord0;
Expand Down Expand Up @@ -47,7 +48,7 @@ void main(void)
skinNormal = (skinMatrix * vec4(inNormal, 0.0)).xyz;
skinTangent = (skinMatrix * vec4(inTangent, 0.0)).xyz;

vTexCoord0 = inTexCoord0;
vTexCoord0 = inTexCoord0 * uUVScale.xy + uUVScale.zw;
vTangentW = inTangentW.x;

vec4 worldPos = uWorldMatrix * skinPosition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ uniform mat4 uMvpMatrix;
uniform mat4 uWorldMatrix;
uniform vec4 uCameraPosition;
uniform vec4 uLightDirection;
uniform vec4 uUVScale;

out vec2 vTexCoord0;
out vec3 vWorldNormal;
Expand All @@ -23,7 +24,7 @@ out vec3 vWorldPosition;

void main(void)
{
vTexCoord0 = inTexCoord0;
vTexCoord0 = inTexCoord0 * uUVScale.xy + uUVScale.zw;
vTangentW = inTangentW.x;

vec4 worldPos = uWorldMatrix * inPosition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct PS_INPUT
cbuffer cbPerFrame
{
float4 uLightColor;
float4 uColor;
float4 uSHConst[4];
};

Expand Down Expand Up @@ -54,7 +55,7 @@ float solveMetallic(float3 diffuse, float3 specular, float oneMinusSpecularStren

float4 main(PS_INPUT input) : SV_TARGET
{
float4 diffuseMap = uTexDiffuse.Sample(uTexDiffuseSampler, input.tex0);
float4 diffuseMap = uTexDiffuse.Sample(uTexDiffuseSampler, input.tex0) * uColor;
float3 normalMap = uTexNormalMap.Sample(uTexNormalMapSampler, input.tex0).xyz;
float3 specMap = uTexSpecularMap.Sample(uTexSpecularMapSampler, input.tex0).xyz;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct PS_INPUT
cbuffer cbPerFrame
{
float4 uLightColor;
float4 uColor;
float4 uSHConst[4];
};
static const float gamma = 2.2;
Expand Down Expand Up @@ -52,7 +53,7 @@ float solveMetallic(float3 diffuse, float3 specular, float oneMinusSpecularStren
}
float4 main(PS_INPUT input) : SV_TARGET
{
float4 diffuseMap = uTexDiffuse.Sample(uTexDiffuseSampler, input.tex0);
float4 diffuseMap = uTexDiffuse.Sample(uTexDiffuseSampler, input.tex0) * uColor;
float3 normalMap = uTexNormalMap.Sample(uTexNormalMapSampler, input.tex0).xyz;
float3 specMap = uTexSpecularMap.Sample(uTexSpecularMapSampler, input.tex0).xyz;
float3x3 rotation = float3x3(input.worldTangent, input.worldBinormal, input.worldNormal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ cbuffer cbPerObject
float4x4 uWorldMatrix;
float4 uCameraPosition;
float4 uLightDirection;
float4 uUVScale;
float4x4 uBoneMatrix[64];
};

Expand Down Expand Up @@ -66,7 +67,7 @@ VS_OUTPUT main(VS_INPUT input)

output.pos = mul(skinPosition, uMvpMatrix);

output.tex0 = input.tex0;
output.tex0 = input.tex0 * uUVScale.xy + uUVScale.zw;
output.tangentw = input.tangentw.x;

float4 worldPos = mul(skinPosition, uWorldMatrix);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cbuffer cbPerObject
float4x4 uWorldMatrix;
float4 uCameraPosition;
float4 uLightDirection;
float4 uUVScale;
};

VS_OUTPUT main(VS_INPUT input)
Expand All @@ -37,7 +38,7 @@ VS_OUTPUT main(VS_INPUT input)

output.pos = mul(input.pos, uMvpMatrix);

output.tex0 = input.tex0;
output.tex0 = input.tex0 * uUVScale.xy + uUVScale.zw;
output.tangentw = input.tangentw.x;

float4 worldPos = mul(input.pos, uWorldMatrix);
Expand Down
7 changes: 6 additions & 1 deletion Assets/BuiltIn/Shader/SpecularGlossiness/Forward/SG.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
<uniform name="uWorldMatrix" type="WORLD" value="0" float="16" matrix="true"/>
<uniform name="uCameraPosition" type="CAMERA_POSITION" value="0" float="4"/>
<uniform name="uLightDirection" type="WORLD_LIGHT_DIRECTION" value="0" float="4"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0, 1.0, 0.0, 0.0" float="4"/>
</vs>
<fs>
<uniform name="uTexDiffuse" type="DEFAULT_VALUE" value="0" float="1" directX="false"/>
<uniform name="uTexNormal" type="DEFAULT_VALUE" value="1" float="1" directX="false"/>
<uniform name="uTexSpecular" type="DEFAULT_VALUE" value="2" float="1" directX="false"/>
<uniform name="uTexReflect" type="DEFAULT_VALUE" value="3" float="1" directX="false"/>

<uniform name="uLightColor" type="LIGHT_COLOR" value="1.0,1.0,1.0,1.0" float="4"/>
<uniform name="uColor" type="MATERIAL_PARAM" valueIndex="1" value="1.0, 1.0, 1.0, 1.0" float="4"/>
<uniform name="uSHConst" type="SH_CONST" value="0" float="4" array="4"/>
</fs>
</uniforms>
Expand All @@ -25,6 +26,10 @@
<ui control="UITexture" name="uTexNormal" autoReplace="_norm.;_Normal.;_N."/>
<ui control="UITexture" name="uTexSpecular" autoReplace="_spec.;_Specular.;_S."/>
</ui>
<ui control="UIGroup" name="Customize">
<ui control="UIColor" name="uColor"/>
<ui control="UIFloat4" name="uUVScale" elementName="UV ScaleX;UV ScaleY;UV OffsetX;UV OffsetY"/>
</ui>
</customUI>
<shader type="GLSL" vs="GLSL/SGVS.glsl" fs="GLSL/SGLitFS.glsl" fs_source="GLSL/SGLitFS.d.glsl"/>
<shader type="HLSL" vs="HLSL/SGVS.hlsl" fs="HLSL/SGLitFS.hlsl" fs_source="HLSL/SGLitFS.d.hlsl"/>
Expand Down
6 changes: 6 additions & 0 deletions Assets/BuiltIn/Shader/SpecularGlossiness/Forward/SGSkin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<uniform name="uWorldMatrix" type="WORLD" value="0" float="16" matrix="true"/>
<uniform name="uCameraPosition" type="CAMERA_POSITION" value="0" float="4"/>
<uniform name="uLightDirection" type="WORLD_LIGHT_DIRECTION" value="0" float="4"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0, 1.0, 0.0, 0.0" float="4"/>
<uniform name="uBoneMatrix" type="BONE_MATRIX" value="0" float="16" array="64" matrix="true"/>
</vs>
<fs>
Expand All @@ -14,6 +15,7 @@
<uniform name="uTexReflect" type="DEFAULT_VALUE" value="3" float="1" directX="false"/>

<uniform name="uLightColor" type="LIGHT_COLOR" value="1.0,1.0,1.0,1.0" float="4"/>
<uniform name="uColor" type="MATERIAL_PARAM" valueIndex="1" value="1.0, 1.0, 1.0, 1.0" float="4"/>
<uniform name="uSHConst" type="SH_CONST" value="0" float="4" array="4"/>
</fs>
</uniforms>
Expand All @@ -26,6 +28,10 @@
<ui control="UITexture" name="uTexNormal" autoReplace="_norm.;_Normal.;_N."/>
<ui control="UITexture" name="uTexSpecular" autoReplace="_spec.;_Specular.;_S."/>
</ui>
<ui control="UIGroup" name="Customize">
<ui control="UIColor" name="uColor"/>
<ui control="UIFloat4" name="uUVScale" elementName="UV ScaleX;UV ScaleY;UV OffsetX;UV OffsetY"/>
</ui>
</customUI>
<shader type="GLSL" vs="GLSL/SGSkinVS.glsl" fs="GLSL/SGLitFS.glsl"/>
<shader type="HLSL" vs="HLSL/SGSkinVS.hlsl" fs="HLSL/SGLitFS.hlsl"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<uniform name="uWorldMatrix" type="WORLD" value="0" float="16" matrix="true"/>
<uniform name="uCameraPosition" type="CAMERA_POSITION" value="0" float="4"/>
<uniform name="uLightDirection" type="WORLD_LIGHT_DIRECTION" value="0" float="4"/>
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0, 1.0, 0.0, 0.0" float="4"/>
<uniform name="uBoneMatrix" type="BONE_MATRIX" value="0" float="16" array="64" matrix="true"/>
</vs>
<fs>
Expand All @@ -14,6 +15,7 @@
<uniform name="uTexReflect" type="DEFAULT_VALUE" value="3" float="1" directX="false"/>

<uniform name="uLightColor" type="LIGHT_COLOR" value="1.0,1.0,1.0,1.0" float="4"/>
<uniform name="uColor" type="MATERIAL_PARAM" valueIndex="1" value="1.0, 1.0, 1.0, 1.0" float="4"/>
<uniform name="uSHConst" type="SH_CONST" value="0" float="4" array="4"/>
</fs>
</uniforms>
Expand All @@ -26,6 +28,10 @@
<ui control="UITexture" name="uTexNormal" autoReplace="_norm.;_Normal.;_N."/>
<ui control="UITexture" name="uTexSpecular" autoReplace="_spec.;_Specular.;_S."/>
</ui>
<ui control="UIGroup" name="Customize">
<ui control="UIColor" name="uColor"/>
<ui control="UIFloat4" name="uUVScale" elementName="UV ScaleX;UV ScaleY;UV OffsetX;UV OffsetY"/>
</ui>
</customUI>
<shader type="GLSL" vs="GLSL/SGSkinVS.glsl" fs="GLSL/SGLitFS.glsl"/>
<shader type="HLSL" vs="HLSL/SGSkinVS.hlsl" fs="HLSL/SGLitFS.hlsl"/>
Expand Down
9 changes: 9 additions & 0 deletions Assets/SampleModels/MixamoCharacter/Ch17_nonPBR.mat
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<!-- File generated by function CMaterialManager::exportMaterial -->
<Materials>
<Material name='Ch17_hair-fx' shader='BuiltIn/Shader/SpecularGlossiness/Forward/SGSkinAlpha.xml'>
<Textures>
<Texture name='uTexDiffuse' path='textures/Ch17_1002_Diffuse.tga'/>
<Texture name='uTexNormal' path='textures/Ch17_1002_Diffuse.tga'/>
<Texture name='uTexSpecular' path='BuiltIn/Textures/NullTexture.png'/>
</Textures>
<Params>
<Param name='uColor' floatSize='4' floatValue='1.000000,1.000000,1.000000,1.000000'/>
<Param name='uUVScale' floatSize='4' floatValue='1.000000,1.000000,0.000000,0.000000'/>
</Params>
<Properties>
<Property name='ZBuffer' value='LessEqual'/>
<Property name='ZWriteEnable' value='true'/>
Expand All @@ -25,6 +30,10 @@
<Texture name='uTexNormal' path='textures/Ch17_1001_Normal.tga'/>
<Texture name='uTexSpecular' path='textures/Ch17_1001_Specular.tga'/>
</Textures>
<Params>
<Param name='uColor' floatSize='4' floatValue='1.000000,1.000000,1.000000,1.000000'/>
<Param name='uUVScale' floatSize='4' floatValue='1.000000,1.000000,0.000000,0.000000'/>
</Params>
<Properties>
<Property name='ZBuffer' value='LessEqual'/>
<Property name='ZWriteEnable' value='true'/>
Expand Down
10 changes: 5 additions & 5 deletions Assets/TankScene/TankScene.mat
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</Textures>
<Params>
<Param name='uColor' floatSize='4' floatValue='1.000000,1.000000,1.000000,1.000000'/>
<Param name='uSpecGloss' floatSize='4' floatValue='0.400000,0.300000,0.000000,0.000000'/>
<Param name='uUVScale' floatSize='4' floatValue='1.000000,1.000000,0.000000,0.000000'/>
<Param name='uSpecGloss' floatSize='4' floatValue='0.400000,0.300000,0.000000,0.000000'/>
</Params>
<Properties>
<Property name='ZBuffer' value='LessEqual'/>
Expand All @@ -22,8 +22,8 @@
</Textures>
<Params>
<Param name='uColor' floatSize='4' floatValue='1.000000,1.000000,1.000000,1.000000'/>
<Param name='uSpecGloss' floatSize='4' floatValue='0.400000,0.300000,0.000000,0.000000'/>
<Param name='uUVScale' floatSize='4' floatValue='1.000000,1.000000,0.000000,0.000000'/>
<Param name='uSpecGloss' floatSize='4' floatValue='0.400000,0.300000,0.000000,0.000000'/>
</Params>
<Properties>
<Property name='ZBuffer' value='LessEqual'/>
Expand All @@ -38,8 +38,8 @@
</Textures>
<Params>
<Param name='uColor' floatSize='4' floatValue='1.000000,1.000000,1.000000,1.000000'/>
<Param name='uSpecGloss' floatSize='4' floatValue='0.400000,0.300000,0.000000,0.000000'/>
<Param name='uUVScale' floatSize='4' floatValue='1.000000,1.000000,0.000000,0.000000'/>
<Param name='uSpecGloss' floatSize='4' floatValue='0.400000,0.300000,0.000000,0.000000'/>
</Params>
<Properties>
<Property name='ZBuffer' value='LessEqual'/>
Expand All @@ -54,8 +54,8 @@
</Textures>
<Params>
<Param name='uColor' floatSize='4' floatValue='1.000000,1.000000,1.000000,1.000000'/>
<Param name='uSpecGloss' floatSize='4' floatValue='0.400000,0.300000,0.000000,0.000000'/>
<Param name='uUVScale' floatSize='4' floatValue='1.000000,1.000000,0.000000,0.000000'/>
<Param name='uSpecGloss' floatSize='4' floatValue='0.400000,0.300000,0.000000,0.000000'/>
</Params>
<Properties>
<Property name='ZBuffer' value='LessEqual'/>
Expand All @@ -70,8 +70,8 @@
</Textures>
<Params>
<Param name='uColor' floatSize='4' floatValue='1.000000,1.000000,1.000000,1.000000'/>
<Param name='uSpecGloss' floatSize='4' floatValue='0.400000,0.300000,0.000000,0.000000'/>
<Param name='uUVScale' floatSize='4' floatValue='1.000000,1.000000,0.000000,0.000000'/>
<Param name='uSpecGloss' floatSize='4' floatValue='0.400000,0.300000,0.000000,0.000000'/>
</Params>
<Properties>
<Property name='ZBuffer' value='LessEqual'/>
Expand Down
4 changes: 1 addition & 3 deletions Projects/Editor/Source/Editor/AssetEditor/CMatEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ namespace Skylicht
value[0] = x->get();
value[1] = y->get();

// on change color
material->setUniform2(uniformUI->Name.c_str(), value);
material->applyMaterial();
};
Expand Down Expand Up @@ -593,8 +592,7 @@ namespace Skylicht
value[2] = z->get();
value[3] = w->get();

// on change color
material->setUniform2(uniformUI->Name.c_str(), value);
material->setUniform4(uniformUI->Name.c_str(), value);
material->applyMaterial();
};

Expand Down

0 comments on commit 6662525

Please sign in to comment.