Skip to content

Commit

Permalink
Fix wobblemesh distance offset, add wobblemesh dither variant
Browse files Browse the repository at this point in the history
  • Loading branch information
Fueredoriku committed Dec 27, 2024
1 parent 100681d commit 06772f8
Show file tree
Hide file tree
Showing 13 changed files with 4,192 additions and 14 deletions.
8 changes: 8 additions & 0 deletions Assets/Materials/Props/Cosmetics.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
181 changes: 181 additions & 0 deletions Assets/Materials/Props/Cosmetics/SantaHatDither.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-2941887051954300681
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: SantaHatDither
m_Shader: {fileID: -6465566751694194690, guid: c412386ed1cb53045ae3c3a3bce55b81, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- MAIN_LIGHT_CALCULATE_SHADOWS
- _MAIN_LIGHT_SHADOWS_CASCADE
- _SHADOWS_SOFT
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: e103454945b3bc115ae159b63b4e69a7, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: e103454945b3bc115ae159b63b4e69a7, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Metallic_Map:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Metallic_Texture:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Normal_Map:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_ff3f3dfb8d024d00a3406fb548bfed46_Texture_1:
m_Texture: {fileID: 2800000, guid: 2f6a188b3fdeed84e9663c94fc54cd49, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Texture:
m_Texture: {fileID: 2800000, guid: e7a4544adbed1773f824b8872b06d94e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Triplanar_0910a226a35b49eaa87ebc7a7af0a7de_Texture_1:
m_Texture: {fileID: 2800000, guid: 5ef5d25785740444ab670640848feec7, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Triplanar_6ca021b8b8b84617a472c2608835416d_Texture_1:
m_Texture: {fileID: 2800000, guid: 5ef5d25785740444ab670640848feec7, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Triplanar_8082379ce2a14f38b8de533a506ee294_Texture_1:
m_Texture: {fileID: 2800000, guid: 5ef5d25785740444ab670640848feec7, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- MAIN_LIGHT_CALCULATE_SHADOWS: 1
- _AlphaClip: 0
- _AlphaToMask: 0
- _BendStartOffset: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DitherDensity: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _MAIN_LIGHT_SHADOWS_CASCADE: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueControl: 0
- _QueueOffset: 0
- _ReceiveShadows: 1
- _SHADOWS_SOFT: 1
- _Shadow_Texture: 0
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _Texture_Intensity: 1
- _UVSec: 0
- _Use_Normal_Map: 0
- _Use_Specular: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Distance: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _Texture_Tiling: {r: 1, g: 1, b: 0, a: 0}
m_BuildTextureStacks: []
8 changes: 8 additions & 0 deletions Assets/Materials/Props/Cosmetics/SantaHatDither.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/Prefabs/GunParts/SeekerBody.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
jiggleMaterial: {fileID: 2100000, guid: 8ebc2dfc073844742b90541dca492b74, type: 2}
jiggleMaterialIndex: 2
wobbleOriginOffset: 0.073
wobbleOriginOffset: 0.065
elasticity: 4
distanceScale: 3
--- !u!1 &8476307063284615586
Expand Down
4 changes: 4 additions & 0 deletions Assets/Prefabs/Input/BiddingPlayer.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ PrefabInstance:
propertyPath: m_Materials.Array.data[1]
value:
objectReference: {fileID: 2100000, guid: 0adeb1aa6af686b4eb037d1da098a77c, type: 2}
- target: {fileID: 1862567324625541211, guid: 2872a05bf8e94d541a70726bb35085f3, type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: fd0e4b20b120d074f8c8704de6754a5b, type: 2}
- target: {fileID: 2910062047927321015, guid: 2872a05bf8e94d541a70726bb35085f3, type: 3}
propertyPath: m_Materials.Array.data[0]
value:
Expand Down
4 changes: 2 additions & 2 deletions Assets/Prefabs/Props/SantaHat.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ MonoBehaviour:
m_EditorClassIdentifier:
jiggleMaterial: {fileID: 2100000, guid: 51e0f88bf96e8cc4a8042a1dfefb0f16, type: 2}
jiggleMaterialIndex: 0
wobbleOriginOffset: 0.5
wobbleOriginOffset: 0.75
elasticity: 6
distanceScale: 1
distanceScale: 0.75
--- !u!4 &6785176594430069083 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 49ff0e50edc25702189d47763d578060, type: 3}
Expand Down
17 changes: 9 additions & 8 deletions Assets/Scripts/Auction/BiddingPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@ private void Start()

protected void InstantiateMaterials()
{
playerRenderers.ToList()
.ForEach(mesh =>
{
for (int i = 0; i < mesh.materials.Length; i++)
playerRenderers.Union(playerManager.GetComponent<PlayerCosmetics>().GetActiveRenderers())
.ToList()
.ForEach(mesh =>
{
mesh.materials[i] = Instantiate(mesh.materials[i]);
instantiatedMaterials.Add(mesh.materials[i]);
}
});
for (int i = 0; i < mesh.materials.Length; i++)
{
mesh.materials[i] = Instantiate(mesh.materials[i]);
instantiatedMaterials.Add(mesh.materials[i]);
}
});
}

public void SetIdentity()
Expand Down
9 changes: 9 additions & 0 deletions Assets/Scripts/PlayerCosmetics.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

Expand Down Expand Up @@ -37,4 +40,10 @@ public void SetLayer(int layer)
foreach (var cosmetic in headwear)
cosmetic.Mesh.layer = layer;
}

public IEnumerable<Renderer> GetActiveRenderers()
{
return headwear.Where(cosmetic => cosmetic.Root.activeInHierarchy)
.Select(cosmetic => cosmetic.Mesh.GetComponent<Renderer>());
}
}
Loading

0 comments on commit 06772f8

Please sign in to comment.