-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added subtle cloud/aurora reflection - Added SunMoon
- Loading branch information
Showing
9 changed files
with
121 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
$input v_texcoord0 | ||
|
||
#include <bgfx_shader.sh> | ||
#include <newb_config_legacy.h> | ||
|
||
uniform vec4 SunMoonColor; | ||
|
||
SAMPLER2D(s_SunMoonTexture, 0); | ||
|
||
void main() { | ||
vec4 color = texture2D(s_SunMoonTexture, v_texcoord0); | ||
color.rgb *= SunMoonColor.rgb; | ||
float tr = 1.0 - SunMoonColor.a; | ||
color.a *= 1.0 - tr*tr*tr; | ||
gl_FragColor = color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
vec3 a_position : POSITION; | ||
vec2 a_texcoord0 : TEXCOORD0; | ||
|
||
vec2 v_texcoord0 : TEXCOORD0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
$input a_position, a_texcoord0 | ||
$output v_texcoord0 | ||
|
||
#include <bgfx_shader.sh> | ||
#include <newb_config_legacy.h> | ||
|
||
void main() { | ||
v_texcoord0 = a_texcoord0; | ||
vec3 pos = a_position; | ||
|
||
pos.xz *= NL_SUNMOON_SIZE; | ||
#ifdef NL_SUNMOON_ANGLE | ||
float angle = NL_SUNMOON_ANGLE*0.0174533; | ||
float sinA = sin(angle); | ||
float cosA = cos(angle); | ||
pos.xz = vec2(pos.x*cosA - pos.z*sinA, pos.x*sinA + pos.z*cosA); | ||
#endif | ||
|
||
gl_Position = mul(u_modelViewProj, vec4(pos, 1.0)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters