-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f53423
commit 55d51c9
Showing
8 changed files
with
301 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0"?> | ||
<material> | ||
<technique name="Techniques/Confetti.xml" quality="0" loddistance="0.000000" /> | ||
<parameter name="VOffset" value="0 1 0 0" /> | ||
<parameter name="AlphaCutoff" value="0.500000" /> | ||
<parameter name="UOffset" value="1 0 0 0" /> | ||
<parameter name="MatSpecColor" value="0 0 0 1" /> | ||
<parameter name="NormalScale" value="1.000000" /> | ||
<parameter name="DielectricReflectance" value="0.500000" /> | ||
<parameter name="MatEnvMapColor" value="1 1 1" /> | ||
<parameter name="MatEmissiveColor" value="0 0 0" /> | ||
<parameter name="MatDiffColor" value="1 1 1 1" /> | ||
<parameter name="AnimationPhase" value="0.000000" /> | ||
<parameter name="Roughness" value="1.000000" /> | ||
<parameter name="Metallic" value="1.000000" /> | ||
<cull value="none" /> | ||
<shadowcull value="ccw" /> | ||
<fill value="solid" /> | ||
<depthbias constant="0.000000" slopescaled="0.000000" normaloffset="0.000000" /> | ||
<alphatocoverage enable="false" /> | ||
<lineantialias enable="false" /> | ||
<renderorder value="128" /> | ||
<occlusion enable="true" /> | ||
</material> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
"components": [ | ||
{ | ||
"_typeName": "Octree" | ||
} | ||
], | ||
"nodes": [ | ||
{ | ||
"components": [ | ||
{ | ||
"_typeName": "StaticModel", | ||
"attributes": [ | ||
{ | ||
"name": "Model", | ||
"type": "ResourceRef", | ||
"value": "Model;Models/Particles.mdl" | ||
}, | ||
{ | ||
"name": "Material", | ||
"type": "ResourceRefList", | ||
"value": "Material;Materials/Confetti.material" | ||
}, | ||
{ | ||
"name": "Cast Shadows", | ||
"type": "Bool", | ||
"value": true | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"attributes": [ | ||
{ | ||
"name": "Name", | ||
"type": "String", | ||
"value": "Default Skybox" | ||
} | ||
], | ||
"components": [ | ||
{ | ||
"_typeName": "Skybox", | ||
"attributes": [ | ||
{ | ||
"name": "Model", | ||
"type": "ResourceRef", | ||
"value": "Model;Models/Box.mdl" | ||
}, | ||
{ | ||
"name": "Material", | ||
"type": "ResourceRefList", | ||
"value": "Material;Materials/DefaultSkybox.xml" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"attributes": [ | ||
{ | ||
"name": "Name", | ||
"type": "String", | ||
"value": "Default Zone" | ||
} | ||
], | ||
"components": [ | ||
{ | ||
"_typeName": "Zone", | ||
"attributes": [ | ||
{ | ||
"name": "Bounding Box Min", | ||
"type": "Vector3", | ||
"value": "-1000 -1000 -1000" | ||
}, | ||
{ | ||
"name": "Bounding Box Max", | ||
"type": "Vector3", | ||
"value": "1000 1000 1000" | ||
}, | ||
{ | ||
"name": "Ambient Color", | ||
"type": "Color", | ||
"value": "0 0 0 1" | ||
}, | ||
{ | ||
"name": "Background Brightness", | ||
"type": "Float", | ||
"value": 1.0 | ||
}, | ||
{ | ||
"name": "Zone Texture", | ||
"type": "ResourceRef", | ||
"value": "TextureCube;Textures/DefaultSkybox.xml" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
#define URHO3D_PIXEL_NEED_TEXCOORD | ||
|
||
#ifndef URHO3D_VERTEX_HAS_TEXCOORD0 | ||
#define URHO3D_VERTEX_HAS_TEXCOORD0 | ||
#endif | ||
|
||
#ifndef URHO3D_VERTEX_HAS_COLOR | ||
#define URHO3D_VERTEX_HAS_COLOR | ||
#endif | ||
|
||
|
||
#define URHO3D_MATERIAL_ALBEDO URHO3D_TEXTURE_ALBEDO | ||
#define URHO3D_MATERIAL_NORMAL URHO3D_TEXTURE_NORMAL | ||
#define URHO3D_MATERIAL_PROPERTIES URHO3D_TEXTURE_PROPERTIES | ||
#define URHO3D_MATERIAL_EMISSION URHO3D_TEXTURE_EMISSION | ||
#define URHO3D_CUSTOM_MATERIAL_UNIFORMS | ||
|
||
#include "_Config.glsl" | ||
#include "_Uniforms.glsl" | ||
#include "_DefaultSamplers.glsl" | ||
|
||
UNIFORM_BUFFER_BEGIN(4, Material) | ||
DEFAULT_MATERIAL_UNIFORMS | ||
UNIFORM(half cAnimationPhase) | ||
UNIFORM_BUFFER_END(4, Material) | ||
|
||
#include "_Material.glsl" | ||
|
||
#ifdef URHO3D_VERTEX_SHADER | ||
|
||
mat3 FromAngleAxis(float angle, vec3 normAxis) | ||
{ | ||
float sinAngle = sin(angle); | ||
float cosAngle = cos(angle); | ||
float _cosAngle = 1.0 - cosAngle; | ||
|
||
return mat3( | ||
cosAngle + normAxis.x * normAxis.x * _cosAngle, | ||
normAxis.y * normAxis.x * _cosAngle + normAxis.z * sinAngle, | ||
normAxis.z * normAxis.x * _cosAngle - normAxis.y * sinAngle, | ||
|
||
normAxis.x * normAxis.y * _cosAngle - normAxis.z * sinAngle, | ||
cosAngle + normAxis.y * normAxis.y * _cosAngle, | ||
normAxis.z * normAxis.y * _cosAngle + normAxis.x * sinAngle, | ||
|
||
normAxis.x * normAxis.z * _cosAngle + normAxis.y * sinAngle, | ||
normAxis.y * normAxis.z * _cosAngle - normAxis.x * sinAngle, | ||
cosAngle + normAxis.z * normAxis.z * _cosAngle); | ||
} | ||
|
||
void main() | ||
{ | ||
mat4 modelMatrix = GetModelMatrix(); | ||
|
||
float t = cAnimationPhase; | ||
float _t = 1.0 - t; | ||
vec3 bernsteinCoefficients = vec3(_t*_t, 2.0*t*_t, t*t); | ||
|
||
vec3 offset = FromAngleAxis(iColor.w + t * 10.0, iNormal) * vec3(iTexCoord.x-0.5, 0.0, -iTexCoord.y+0.5); | ||
|
||
float up = dot(bernsteinCoefficients, vec3(0.0, 0.0, -0.5)); | ||
float size = dot(bernsteinCoefficients, vec3(0.0, 0.1, 0.0)); | ||
float dist = dot(bernsteinCoefficients, vec3(0.0, 1.0, 1.0)); | ||
|
||
VertexTransform vertexTransform; | ||
vertexTransform.position = vec4(iPos.xyz*dist + offset.xyz*size + vec3(0.0, up, 0.0), 1.0) * modelMatrix; | ||
|
||
#ifdef URHO3D_VERTEX_NEED_NORMAL | ||
mediump mat3 normalMatrix = GetNormalMatrix(modelMatrix); | ||
vertexTransform.normal = normalize(iNormal * normalMatrix); | ||
|
||
ApplyShadowNormalOffset(result.position, result.normal); | ||
|
||
#ifdef URHO3D_VERTEX_NEED_TANGENT | ||
vertexTransform.tangent = normalize(iTangent.xyz * normalMatrix); | ||
vertexTransform.bitangent = cross(result.tangent, result.normal) * iTangent.w; | ||
#endif | ||
#endif | ||
|
||
Vertex_SetAll(vertexTransform, cNormalScale, cUOffset, cVOffset, cLMOffset); | ||
} | ||
#endif | ||
|
||
#ifdef URHO3D_PIXEL_SHADER | ||
void main() | ||
{ | ||
#ifdef URHO3D_DEPTH_ONLY_PASS | ||
Pixel_DepthOnly(sAlbedo, vTexCoord); | ||
#else | ||
SurfaceData surfaceData; | ||
|
||
Surface_SetCommon(surfaceData); | ||
Surface_SetAmbient(surfaceData, sEmission, vTexCoord2); | ||
Surface_SetNormal(surfaceData, vNormal, sNormal, vTexCoord, vTangent, vBitangentXY); | ||
Surface_SetPhysicalProperties(surfaceData, cRoughness, cMetallic, cDielectricReflectance, sProperties, vTexCoord); | ||
Surface_SetLegacyProperties(surfaceData, cMatSpecColor.a, sEmission, vTexCoord); | ||
Surface_SetCubeReflection(surfaceData, sReflection0, sReflection1, vReflectionVec, vWorldPos); | ||
Surface_SetPlanarReflection(surfaceData, sReflection0, cReflectionPlaneX, cReflectionPlaneY); | ||
Surface_SetBackground(surfaceData, sEmission, sDepthBuffer); | ||
Surface_SetBaseAlbedo(surfaceData, cMatDiffColor, cAlphaCutoff, vColor, sAlbedo, vTexCoord, URHO3D_MATERIAL_ALBEDO); | ||
Surface_SetBaseSpecular(surfaceData, cMatSpecColor, cMatEnvMapColor, sProperties, vTexCoord); | ||
Surface_SetAlbedoSpecular(surfaceData); | ||
Surface_SetEmission(surfaceData, cMatEmissiveColor, sEmission, vTexCoord, URHO3D_MATERIAL_EMISSION); | ||
Surface_ApplySoftFadeOut(surfaceData, vWorldDepth, cFadeOffsetScale); | ||
|
||
half3 surfaceColor = GetSurfaceColor(surfaceData); | ||
gl_FragColor = GetFragmentColorAlpha(surfaceColor, surfaceData.albedo.a, surfaceData.fogFactor); | ||
#endif | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<technique vs="M_Confetti" ps="M_Confetti"> | ||
<pass name="base" /> | ||
<pass name="deferred" /> | ||
<pass name="depth" vs="M_Confetti" ps="M_Confetti" /> | ||
<pass name="shadow" vs="M_Confetti" ps="M_Confetti" /> | ||
</technique> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters