Skip to content

Commit

Permalink
fix: Unlit shader now works with vertex colors #77
Browse files Browse the repository at this point in the history
  • Loading branch information
atteneder committed May 28, 2020
1 parent f65d8a8 commit 8d232ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.1] - 2020-05-28
### Fixed
- Unlit shader now works with vertex colors

## [1.1.0] - 2020-05-25
### Added
- `GltFast.LoadingDone` state property indicates if loading routine has finished
Expand Down
4 changes: 4 additions & 0 deletions Runtime/Shader/glTFUnlit.shader
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ SubShader {
struct appdata_t {
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
fixed4 color : COLOR;
UNITY_VERTEX_INPUT_INSTANCE_ID
};

struct v2f {
float4 vertex : SV_POSITION;
float2 texcoord : TEXCOORD0;
fixed4 color : COLOR;
UNITY_FOG_COORDS(1)
UNITY_VERTEX_OUTPUT_STEREO
};
Expand All @@ -84,6 +86,7 @@ SubShader {
#endif

UNITY_TRANSFER_FOG(o,o.vertex);
o.color = v.color;
return o;
}

Expand All @@ -92,6 +95,7 @@ SubShader {
fixed4 col = tex2D(_MainTex, i.texcoord) * _Color;
UNITY_APPLY_FOG(i.fogCoord, col);
UNITY_OPAQUE_ALPHA(col.a);
col *= i.color;
return col;
}
ENDCG
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.atteneder.gltfast",
"version": "1.1.0",
"version": "1.1.1",
"displayName": "glTFast",
"description": "Load glTF assets at runtime.",
"unity": "2019.1",
Expand Down

0 comments on commit 8d232ca

Please sign in to comment.