Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.

Commit 2474910

Browse files
authored
Merge pull request #8 from Netherlands3D/feature/supporting-receive-shadows-tile-shader
bugfix to support shader in webgl
2 parents 1abd5cf + 293762d commit 2474910

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
8+
## [5.0.8] - 2025-05-20
9+
This release is part of the Netherlands3D fork.
10+
### Fixed
11+
-revised the tiles3d shader to also support webgl
12+
713
## [5.0.7] - 2025-05-20
814
This release is part of the Netherlands3D fork.
915
### Added

Runtime/Shader/Tiles3D.shader

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,38 +95,48 @@
9595
Name "ShadowCaster"
9696
Tags { "LightMode" = "ShadowCaster" }
9797

98+
Cull Back
99+
ZWrite On
100+
ZTest LEqual
101+
98102
HLSLPROGRAM
99103
#pragma vertex vert
100104
#pragma fragment frag
101-
102105
#pragma multi_compile_instancing
103106

104107
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
105-
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShadowCasterPass.hlsl"
106108

107109
struct Attributes
108110
{
109111
float4 vertex : POSITION;
110112
float3 normal : NORMAL;
113+
UNITY_VERTEX_INPUT_INSTANCE_ID
111114
};
112115

113116
struct Varyings
114117
{
115118
float4 positionCS : SV_POSITION;
119+
UNITY_VERTEX_OUTPUT_STEREO
116120
};
117121

118122
Varyings vert(Attributes input)
119123
{
120124
Varyings output;
121-
float3 positionWS = TransformObjectToWorld(input.vertex.xyz);
122-
float3 normalWS = TransformObjectToWorldNormal(input.normal);
123-
output.positionCS = GetShadowCasterPositionCS(input.vertex, normalWS);
125+
UNITY_SETUP_INSTANCE_ID(input);
126+
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
127+
128+
float3 worldPos = TransformObjectToWorld(input.vertex.xyz);
129+
float3 worldNormal = TransformObjectToWorldNormal(input.normal);
130+
131+
worldPos += worldNormal * 0.001; //prevent zfighting spots
132+
133+
output.positionCS = TransformWorldToHClip(worldPos);
124134
return output;
125135
}
126136

127137
float4 frag(Varyings input) : SV_Target
128138
{
129-
return 0;
139+
return 0.0;
130140
}
131141
ENDHLSL
132142
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eu.netherlands3d.gltfast",
3-
"version": "5.0.7",
3+
"version": "5.0.8",
44
"displayName": "glTFast [Netherlands3D]",
55
"description": "[Netherlands3D fork] Use glTFast to import and export glTF 3D files efficiently at runtime or in the Editor",
66
"unity": "2019.4",

0 commit comments

Comments
 (0)