don't store gizmo material in LFS

This commit is contained in:
Nick Fisher
2024-09-16 11:25:21 +08:00
parent 679d208c8d
commit 773077ab9c
5 changed files with 1284 additions and 1285 deletions

View File

@@ -1,3 +1,50 @@
version https://git-lfs.github.com/spec/v1
oid sha256:634f5806365b20f05a3736b5b87c1ba6a49b94e39d3defbd6f22f9784d718388
size 1754
material {
name : Gizmo,
parameters : [
{
type : mat4,
name : transform,
precision : high
},
{
type : float4,
name : color,
precision : low
}
],
depthWrite : true,
depthCulling : false,
shadingModel : unlit,
blending: transparent,
variantFilter : [ skinning, shadowReceiver, vsm ],
culling: none,
instanced: false,
vertexDomain: object
}
vertex {
void materialVertex(inout MaterialVertexInputs material) {
// we want to ensure the gizmo has the same size (in screen-space), no matter the distance from the camera
// we do this by scaling the model-space vertex positions by the distance from the camera
vec4 modelSpace = getPosition();
vec4 worldSpace = getWorldFromModelMatrix() * modelSpace;
vec4 viewSpace = getViewFromWorldMatrix() * worldSpace;
float distanceFromCamera = length(viewSpace.xyz);
modelSpace.xyz *= (distanceFromCamera / 4.0f); // divide by 4 so that the size is equivalent to the camera being 4 world-space units away from the (unscaled) gizmo
worldSpace = getWorldFromModelMatrix() * modelSpace;
material.worldPosition = worldSpace;
//vec4 clipSpace = getClipFromWorldMatrix() * worldSpace;
//clipSpace.z = 0.99f;
//material.worldPosition = getWorldFromClipMatrix() * clipSpace;
}
}
fragment {
void material(inout MaterialInputs material) {
prepareMaterial(material);
material.baseColor = materialParams.color;
}
}

View File

@@ -8,5 +8,5 @@ GIZMO_PACKAGE:
GIZMO_GIZMO_OFFSET:
.int 0
GIZMO_GIZMO_SIZE:
.int 28800
.int 27809

View File

@@ -8,5 +8,5 @@ _GIZMO_PACKAGE:
_GIZMO_GIZMO_OFFSET:
.int 0
_GIZMO_GIZMO_SIZE:
.int 28800
.int 27809

File diff suppressed because it is too large Load Diff