Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for transparent layer in texture splatting for the terrain texture #183 #185

Merged
merged 2 commits into from
Jun 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,21 @@ void main(void) {
#ifdef splatFlag
vec4 splat = texture2D(u_texture_splat, v_splatPosition);
#ifdef splatRFlag
gl_FragColor = mix(gl_FragColor, texture2D(u_texture_r, v_texCoord0), splat.r);
vec4 colorR = texture2D(u_texture_r, v_texCoord0);
gl_FragColor = mix(gl_FragColor, mix(gl_FragColor, colorR, splat.r), colorR.a);
#endif
#ifdef splatGFlag
gl_FragColor = mix(gl_FragColor, texture2D(u_texture_g, v_texCoord0), splat.g);
vec4 colorG = texture2D(u_texture_g, v_texCoord0);
gl_FragColor = mix(gl_FragColor, mix(gl_FragColor, colorG, splat.g), colorG.a);
#endif
#ifdef splatBFlag
gl_FragColor = mix(gl_FragColor, texture2D(u_texture_b, v_texCoord0), splat.b);
#endif
vec4 colorB = texture2D(u_texture_b, v_texCoord0);
gl_FragColor = mix(gl_FragColor, mix(gl_FragColor, colorB, splat.b), colorB.a);
#endif
#ifdef splatAFlag
gl_FragColor = mix(gl_FragColor, texture2D(u_texture_a, v_texCoord0), splat.a);
#endif
vec4 colorA = texture2D(u_texture_a, v_texCoord0);
gl_FragColor = mix(gl_FragColor, mix(gl_FragColor, colorA, splat.a), colorA.a);
#endif

#ifdef normalTextureFlag
vec3 splatNormal = vec3(0.0);
Expand Down
1 change: 1 addition & 0 deletions editor/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- Fix terrain brush tools for rotated and scaled terrain
- Refactor tool selection
- Custom properties component addable to game objects
- Fix transparent layer in texture splatting for the terrain texture

[0.4.2] ~ 10/24/2022
- Fix shader compilation error for Terrain when using normal maps
Expand Down
1 change: 1 addition & 0 deletions gdx-runtime/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Fix water reflections when camera is rotated
- Removed selected field from SceneGraph class
- Added custom properties option to game objects
- Fix transparent layer in texture splatting for the terrain texture

[0.4.0] ~ 10/12/2022
- [BREAKING CHANGE] The loadScene method for the runtime has changed. A ModelBatch is no longer required to be passed in.
Expand Down