Quellcode durchsuchen

Revert "Revert "Revert "Premier essai shader mais jte jure jcomrpend rien\n(est-ce que ça marche même antislash n sur git ?) bref le shader est dans Effects/wMaillage machin truc"""

This reverts commit 67795b5f70.
TEST
DemiSel vor 4 Jahren
Ursprung
Commit
907fc4cf11

+ 0
- 21
FreeCam/Assets/BlockSpawner.cs Datei anzeigen

@@ -5,7 +5,6 @@ using UnityEngine.InputSystem;
5 5
 
6 6
 public class BlockSpawner : MonoBehaviour
7 7
 {
8
-
9 8
     [SerializeField]
10 9
     private GameObject _blockToPlace;
11 10
     public GameObject BlockToPlace
@@ -23,18 +22,14 @@ public class BlockSpawner : MonoBehaviour
23 22
 
24 23
     public float spawnDistance = 3f;
25 24
 
26
-    public Shader previewShader;
27 25
     private GameObject _blockInstance;
28 26
 
29
-
30 27
     private bool _isPreview = false;
31
-    private Shader _initialShader;
32 28
 
33 29
     public void OnPlaceBlock()
34 30
     {
35 31
         if (!_isPreview) return;
36 32
         _blockInstance.transform.SetParent(null);
37
-        SwitchToDefaultRender();
38 33
         _blockInstance = null;
39 34
         DisablePreviewMode();
40 35
     }
@@ -55,7 +50,6 @@ public class BlockSpawner : MonoBehaviour
55 50
         _blockInstance = Instantiate(_blockToPlace, spawnPos, Quaternion.identity);
56 51
         _blockInstance.transform.SetParent(this.transform, false);
57 52
         _isPreview = true;
58
-        SwitchToMeshRender();
59 53
     }
60 54
 
61 55
     private void DisablePreviewMode()
@@ -63,19 +57,4 @@ public class BlockSpawner : MonoBehaviour
63 57
         if (_blockInstance != null) Destroy(_blockInstance);
64 58
         _isPreview = false;
65 59
     }
66
-
67
-    private void SwitchToMeshRender()
68
-    {
69
-        MeshRenderer vRenderer = _blockInstance.GetComponent<MeshRenderer>();
70
-        Material vMaterial = vRenderer.material;
71
-        _initialShader = vMaterial.shader;
72
-        vMaterial.shader = previewShader;
73
-    }
74
-
75
-    private void SwitchToDefaultRender()
76
-    {
77
-        MeshRenderer vRenderer = _blockInstance.GetComponent<MeshRenderer>();
78
-        Material vMaterial = vRenderer.material;
79
-        vMaterial.shader = _initialShader;
80
-    }
81 60
 }

+ 1
- 3
FreeCam/Assets/BlockSpawner.cs.meta Datei anzeigen

@@ -3,9 +3,7 @@ guid: b78dfde35e58d1e4c858653eaf06ea64
3 3
 MonoImporter:
4 4
   externalObjects: {}
5 5
   serializedVersion: 2
6
-  defaultReferences:
7
-  - _blockToPlace: {instanceID: 0}
8
-  - previewShader: {fileID: 4800000, guid: 167cdc0b24acc2f449b7fb1756fbc873, type: 3}
6
+  defaultReferences: []
9 7
   executionOrder: 0
10 8
   icon: {instanceID: 0}
11 9
   userData: 

+ 0
- 8
FreeCam/Assets/Effects.meta Datei anzeigen

@@ -1,8 +0,0 @@
1
-fileFormatVersion: 2
2
-guid: 41582cd70db64bd47b6745a4095c0395
3
-folderAsset: yes
4
-DefaultImporter:
5
-  externalObjects: {}
6
-  userData: 
7
-  assetBundleName: 
8
-  assetBundleVariant: 

+ 0
- 13
FreeCam/Assets/Effects/NewShaderVariants.shadervariants Datei anzeigen

@@ -1,13 +0,0 @@
1
-%YAML 1.1
2
-%TAG !u! tag:unity3d.com,2011:
3
---- !u!200 &20000000
4
-ShaderVariantCollection:
5
-  m_ObjectHideFlags: 0
6
-  m_CorrespondingSourceObject: {fileID: 0}
7
-  m_PrefabInstance: {fileID: 0}
8
-  m_PrefabAsset: {fileID: 0}
9
-  m_Name: NewShaderVariants
10
-  m_Shaders:
11
-  - first: {fileID: 10512, guid: 0000000000000000f000000000000000, type: 0}
12
-    second:
13
-      variants: []

+ 0
- 8
FreeCam/Assets/Effects/NewShaderVariants.shadervariants.meta Datei anzeigen

@@ -1,8 +0,0 @@
1
-fileFormatVersion: 2
2
-guid: 1bac98432915ee94bafd6b815a8663d7
3
-NativeFormatImporter:
4
-  externalObjects: {}
5
-  mainObjectFileID: 0
6
-  userData: 
7
-  assetBundleName: 
8
-  assetBundleVariant: 

+ 0
- 53
FreeCam/Assets/Effects/standardSurfaceShader.shader Datei anzeigen

@@ -1,53 +0,0 @@
1
-Shader "Custom/standardSurfaceShader"
2
-{
3
-    Properties
4
-    {
5
-        _Color ("Color", Color) = (1,1,1,1)
6
-        _MainTex ("Albedo (RGB)", 2D) = "white" {}
7
-        _Glossiness ("Smoothness", Range(0,1)) = 0.5
8
-        _Metallic ("Metallic", Range(0,1)) = 0.0
9
-    }
10
-    SubShader
11
-    {
12
-        Tags { "RenderType"="Opaque" }
13
-        LOD 200
14
-
15
-        CGPROGRAM
16
-        // Physically based Standard lighting model, and enable shadows on all light types
17
-        #pragma surface surf Standard fullforwardshadows
18
-
19
-        // Use shader model 3.0 target, to get nicer looking lighting
20
-        #pragma target 3.0
21
-
22
-        sampler2D _MainTex;
23
-
24
-        struct Input
25
-        {
26
-            float2 uv_MainTex;
27
-        };
28
-
29
-        half _Glossiness;
30
-        half _Metallic;
31
-        fixed4 _Color;
32
-
33
-        // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
34
-        // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
35
-        // #pragma instancing_options assumeuniformscaling
36
-        UNITY_INSTANCING_BUFFER_START(Props)
37
-            // put more per-instance properties here
38
-        UNITY_INSTANCING_BUFFER_END(Props)
39
-
40
-        void surf (Input IN, inout SurfaceOutputStandard o)
41
-        {
42
-            // Albedo comes from a texture tinted by color
43
-            fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
44
-            o.Albedo = c.rgb;
45
-            // Metallic and smoothness come from slider variables
46
-            o.Metallic = _Metallic;
47
-            o.Smoothness = _Glossiness;
48
-            o.Alpha = c.a;
49
-        }
50
-        ENDCG
51
-    }
52
-    FallBack "Diffuse"
53
-}

+ 0
- 9
FreeCam/Assets/Effects/standardSurfaceShader.shader.meta Datei anzeigen

@@ -1,9 +0,0 @@
1
-fileFormatVersion: 2
2
-guid: b0c691a25e854aa488e55c7de961b502
3
-ShaderImporter:
4
-  externalObjects: {}
5
-  defaultTextures: []
6
-  nonModifiableTextures: []
7
-  userData: 
8
-  assetBundleName: 
9
-  assetBundleVariant: 

+ 0
- 134
FreeCam/Assets/Effects/wMaillageShader.shader Datei anzeigen

@@ -1,134 +0,0 @@
1
-Shader "Custom/wMaillageShader"
2
-{
3
-    Properties
4
-    {
5
-		_MainTex("Texture", 2D) = "white" {}
6
-		_Color("Color", Color) = (1,1,1,1)
7
-		_Threshold("Threshold", float) = 0.01
8
-
9
-		_EdgeColor("Edge color", Color) = (1,0,0,1)
10
-
11
-		_Glossiness("Smoothness", Range(0,1)) = 0.5
12
-		_Metallic("Metallic", Range(0,1)) = 0.0
13
-    }
14
-    SubShader
15
-    {
16
-        Cull Off ZWrite Off ZTest Always
17
-		Tags { "RenderType" = "Opaque" }
18
-        Pass
19
-
20
-		{
21
-
22
-			CGPROGRAM
23
-
24
-			#pragma vertex vert
25
-
26
-			#pragma fragment frag 
27
-			
28
-
29
-			#include "UnityCG.cginc"
30
-
31
-			struct appdata
32
-
33
-			{
34
-
35
-				float4 vertex : POSITION;
36
-
37
-				float2 uv : TEXCOORD0;
38
-
39
-			};
40
-
41
-			struct v2f
42
-
43
-			{
44
-
45
-				float2 uv : TEXCOORD0;
46
-
47
-				float4 vertex : SV_POSITION;
48
-
49
-			};
50
-
51
-			sampler2D _CameraDepthNormalsTexture;
52
-			float4 _MainTex_ST;
53
-
54
-			v2f vert(appdata v)
55
-
56
-			{
57
-
58
-				v2f o;
59
-
60
-				o.vertex = UnityObjectToClipPos(v.vertex);
61
-
62
-				o.uv = TRANSFORM_TEX(v.uv, _MainTex);
63
-
64
-				return o;
65
-
66
-			}
67
-
68
-			sampler2D _MainTex;
69
-
70
-			float4 _MainTex_TexelSize;
71
-
72
-			float _Threshold;
73
-
74
-			fixed4 _EdgeColor;
75
-
76
-			float4 GetPixelValue(in float2 uv) {
77
-
78
-				half3 normal;
79
-
80
-				float depth;
81
-
82
-				DecodeDepthNormal(tex2D(_CameraDepthNormalsTexture, uv), depth, normal);
83
-
84
-				return fixed4(normal, depth);
85
-
86
-			}
87
-
88
-			fixed4 frag(v2f i) : SV_Target
89
-
90
-			{
91
-
92
-				fixed4 col = tex2D(_MainTex, i.uv);
93
-
94
-				fixed4 orValue = GetPixelValue(i.uv);
95
-
96
-				float2 offsets[8] = {
97
-
98
-					float2(-1, -1),
99
-
100
-					float2(-1, 0),
101
-
102
-					float2(-1, 1),
103
-
104
-					float2(0, -1),
105
-
106
-					float2(0, 1),
107
-
108
-					float2(1, -1),
109
-
110
-					float2(1, 0),
111
-
112
-					float2(1, 1)
113
-
114
-				};
115
-
116
-				fixed4 sampledValue = fixed4(0,0,0,0);
117
-
118
-				for (int j = 0; j < 8; j++) {
119
-
120
-					sampledValue += GetPixelValue(i.uv + offsets[j] * _MainTex_TexelSize.xy);
121
-
122
-				}
123
-
124
-				sampledValue /= 8;
125
-
126
-				return lerp(col, _EdgeColor, step(_Threshold, length(orValue - sampledValue)));
127
-
128
-			}
129
-
130
-			
131
-			ENDCG
132
-		}
133
-    }
134
-}

+ 0
- 10
FreeCam/Assets/Effects/wMaillageShader.shader.meta Datei anzeigen

@@ -1,10 +0,0 @@
1
-fileFormatVersion: 2
2
-guid: 167cdc0b24acc2f449b7fb1756fbc873
3
-ShaderImporter:
4
-  externalObjects: {}
5
-  defaultTextures:
6
-  - _MainTex: {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0}
7
-  nonModifiableTextures: []
8
-  userData: 
9
-  assetBundleName: 
10
-  assetBundleVariant: 

+ 1
- 1
FreeCam/Assets/Materials/New Material.mat Datei anzeigen

@@ -8,7 +8,7 @@ Material:
8 8
   m_PrefabInstance: {fileID: 0}
9 9
   m_PrefabAsset: {fileID: 0}
10 10
   m_Name: New Material
11
-  m_Shader: {fileID: 4800000, guid: b0c691a25e854aa488e55c7de961b502, type: 3}
11
+  m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
12 12
   m_ShaderKeywords: 
13 13
   m_LightmapFlags: 4
14 14
   m_EnableInstancingVariants: 0

+ 0
- 4
FreeCam/Assets/Scenes/SampleScene.unity Datei anzeigen

@@ -688,9 +688,5 @@ PrefabInstance:
688 688
       propertyPath: _blockToPlace
689 689
       value: 
690 690
       objectReference: {fileID: 3300812737117657924, guid: 7b30a4c90d614f747872471cf43b8e56, type: 3}
691
-    - target: {fileID: 6193258497320629589, guid: 37333bbc22b455449a05fcf8aa6b9a8f, type: 3}
692
-      propertyPath: previewShader
693
-      value: 
694
-      objectReference: {fileID: 4800000, guid: 167cdc0b24acc2f449b7fb1756fbc873, type: 3}
695 691
     m_RemovedComponents: []
696 692
   m_SourcePrefab: {fileID: 100100000, guid: 37333bbc22b455449a05fcf8aa6b9a8f, type: 3}

Laden…
Abbrechen
Speichern