Fixed glas render

This commit is contained in:
FlorianSpeicher
2025-07-08 21:53:00 +02:00
parent f4351f52fe
commit 70a877b2c8
3 changed files with 79 additions and 15 deletions

View File

@@ -21,19 +21,18 @@ Material:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_Name: Glas m_Name: Glas
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} m_Shader: {fileID: 4800000, guid: c64e6f0cc900d3f45ab52710eae7416f, type: 3}
m_Parent: {fileID: 0} m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0 m_ModifiedSerializedProperties: 0
m_ValidKeywords: m_ValidKeywords: []
m_InvalidKeywords:
- _ALPHAPREMULTIPLY_ON - _ALPHAPREMULTIPLY_ON
- _SURFACE_TYPE_TRANSPARENT - _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords: []
m_LightmapFlags: 4 m_LightmapFlags: 4
m_EnableInstancingVariants: 0 m_EnableInstancingVariants: 0
m_DoubleSidedGI: 1 m_DoubleSidedGI: 1
m_CustomRenderQueue: 3000 m_CustomRenderQueue: -1
stringTagMap: stringTagMap: {}
RenderType: Transparent
disabledShaderPasses: disabledShaderPasses:
- MOTIONVECTORS - MOTIONVECTORS
- DepthOnly - DepthOnly
@@ -66,6 +65,10 @@ Material:
m_Texture: {fileID: 0} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _FaceTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex: - _MainTex:
m_Texture: {fileID: 0} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
@@ -78,6 +81,10 @@ Material:
m_Texture: {fileID: 0} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
- _OutlineTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap: - _ParallaxMap:
m_Texture: {fileID: 0} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
@@ -103,6 +110,13 @@ Material:
- _AddPrecomputedVelocity: 0 - _AddPrecomputedVelocity: 0
- _AlphaClip: 0 - _AlphaClip: 0
- _AlphaToMask: 0 - _AlphaToMask: 0
- _Ambient: 0.3
- _BevelAmount: 0.25
- _BevelClamp: 0
- _BevelOffset: 0
- _BevelRoundness: 0
- _BevelType: 0
- _BevelWidth: 0.5
- _Blend: 0 - _Blend: 0
- _BlendModePreserveSpecular: 1 - _BlendModePreserveSpecular: 1
- _BumpScale: 1 - _BumpScale: 1
@@ -112,29 +126,53 @@ Material:
- _Cutoff: 0.5 - _Cutoff: 0.5
- _DetailAlbedoMapScale: 1 - _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1 - _DetailNormalMapScale: 1
- _Diffuse: 0.3
- _DstBlend: 10 - _DstBlend: 10
- _DstBlendAlpha: 10 - _DstBlendAlpha: 10
- _EnvironmentReflections: 1 - _EnvironmentReflections: 1
- _GlossMapScale: 0 - _GlossMapScale: 0
- _Glossiness: 0 - _Glossiness: 0
- _GlossyReflections: 0 - _GlossyReflections: 0
- _Metallic: 0.685 - _GradientScale: 10
- _LightAngle: 0
- _Metallic: 0
- _OcclusionStrength: 1 - _OcclusionStrength: 1
- _OutlineMode: 0
- _Parallax: 0.005 - _Parallax: 0.005
- _QueueOffset: 0 - _QueueOffset: 0
- _ReceiveShadows: 1 - _ReceiveShadows: 1
- _Smoothness: 1 - _Reflectivity: 5
- _ScaleRatioA: 0
- _Smoothness: 0.9
- _SmoothnessTextureChannel: 1 - _SmoothnessTextureChannel: 1
- _SpecularHighlights: 1 - _SpecularHighlights: 1
- _SpecularPower: 1
- _SrcBlend: 1 - _SrcBlend: 1
- _SrcBlendAlpha: 1 - _SrcBlendAlpha: 1
- _Surface: 1 - _Surface: 1
- _UnderlayDilate: 0
- _UnderlaySoftness: 0
- _WorkflowMode: 1 - _WorkflowMode: 1
- _ZWrite: 0 - _ZWrite: 0
m_Colors: m_Colors:
- _BaseColor: {r: 0.17735851, g: 0.17735851, b: 0.17735851, a: 0.39215687} - _BaseColor: {r: 0.85, g: 0.95, b: 1, a: 0.15}
- _Color: {r: 0.17735848, g: 0.17735848, b: 0.17735848, a: 0.39215687} - _Color: {r: 0.1764706, g: 0.1764706, b: 0.1764706, a: 0.15}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
- _FaceText_ST: {r: 1, g: 1, b: 0, a: 0}
- _FaceUVSpeed: {r: 0, g: 0, b: 0, a: 0}
- _IsoPerimeter: {r: 0, g: 0, b: 0, a: 0}
- _OutlineColor1: {r: 0, g: 1, b: 1, a: 1}
- _OutlineColor2: {r: 0.009433985, g: 0.02534519, b: 1, a: 1}
- _OutlineColor3: {r: 0, g: 0, b: 0, a: 1}
- _OutlineOffset1: {r: 0, g: 0, b: 0, a: 0}
- _OutlineOffset2: {r: 0, g: 0, b: 0, a: 0}
- _OutlineOffset3: {r: 0, g: 0, b: 0, a: 0}
- _OutlineUVSpeed: {r: 0, g: 0, b: 0, a: 0}
- _Softness: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 1}
- _UnderlayOffset: {r: 0, g: 0, b: 0, a: 0}
m_BuildTextureStacks: [] m_BuildTextureStacks: []
m_AllowLocking: 1 m_AllowLocking: 1

View File

@@ -17,10 +17,11 @@ public class ModelList
}; };
public static List<Color> WindowColor = new List<Color>() public static List<Color> WindowColor = new List<Color>()
{ {
new Color32(50,50,50,50), new Color(0f, 0f, 0f, 0f),
new Color32(50,50,50,150), Resources.Load<Material>($"Material/Glas").color,
new Color32(50,50,50,255), new Color(0.2f, 0.2f, 0.2f, 0.45f),
new Color32(155, 150, 180, 255), new Color(0.1f, 0.1f, 0.1f, 0.65f),
new Color(0.05f, 0.05f, 0.05f, 0.80f),
}; };
public static readonly List<BaseModel> BaseModels = new List<BaseModel>() public static readonly List<BaseModel> BaseModels = new List<BaseModel>()

View File

@@ -20,7 +20,6 @@ public class ModelManager : MonoBehaviour, IResettable
get { return baseModelGO.GetComponent<BaseModelBehaviour>(); } get { return baseModelGO.GetComponent<BaseModelBehaviour>(); }
} }
public BaseModelSelector baseModelSelector; public BaseModelSelector baseModelSelector;
// Start is called once before the first execution of Update after the MonoBehaviour is created // Start is called once before the first execution of Update after the MonoBehaviour is created
void Start() void Start()
{ {
@@ -44,6 +43,32 @@ public class ModelManager : MonoBehaviour, IResettable
//TODO: send into model selection //TODO: send into model selection
Debug.LogError("baseModel is null, fix the configuration"); Debug.LogError("baseModel is null, fix the configuration");
} }
/*
var originalGlasMat = Resources.Load<Material>("Material/Glas");
if (originalGlasMat != null)
{
var glasMatInstance = new Material(originalGlasMat); // Kopie erzeugen
var urpLit = Shader.Find("URP/UI/Prerendered");
if (urpLit != null)
{
glasMatInstance.shader = urpLit;
glasMatInstance.SetFloat("_Smoothness", 0.9f);
glasMatInstance.SetFloat("_Metallic", 0.0f);
glasMatInstance.SetFloat("_Surface", 1);
glasMatInstance.SetFloat("_Blend", 0);
glasMatInstance.SetColor("_BaseColor", new Color(0.2f, 0.2f, 0.2f, 0.45f));
}
var fensterGO = GameObject.Find("portErlbachWindow"); // Name des Fenster-Objekts
if (fensterGO != null)
{
var renderer = fensterGO.GetComponent<Renderer>();
if (renderer != null)
{
renderer.material = glasMatInstance;
}
}
}
*/
} }
void RegisterChildModel(ChildModel model) void RegisterChildModel(ChildModel model)