mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-01-03 16:13:30 +08:00
Update stars.glsl
This commit is contained in:
parent
0dd34d53d6
commit
955353a090
@ -41,7 +41,11 @@ float StableStarField( in vec2 vSamplePos, float fThreshhold )
|
|||||||
|
|
||||||
float stars(vec3 viewPos){
|
float stars(vec3 viewPos){
|
||||||
|
|
||||||
vec2 uv = abs(viewPos.x) > abs(viewPos.y) && abs(viewPos.x) > abs(viewPos.z) ? viewPos.yz : abs(viewPos.y) > abs(viewPos.z) ? viewPos.xz : viewPos.xy;
|
//6 "faces" in 3 axis
|
||||||
|
vec2 uv = abs(viewPos.x) > abs(viewPos.y) && abs(viewPos.x) > abs(viewPos.z) ? viewPos.yz : abs(viewPos.y) > abs(viewPos.z) ? viewPos.xz + vec2(1,0) : viewPos.xy + vec2(0,1);
|
||||||
|
//together with offsets make sure that every face is unique
|
||||||
|
uv = viewPos.x > 0 ? uv : uv + vec2(1,1);
|
||||||
|
//scale it down to stars are not too small and too dense
|
||||||
uv *= 0.5;
|
uv *= 0.5;
|
||||||
|
|
||||||
return exp((1.0-StableStarField(uv*1000.,0.999)) * -10) * 3;
|
return exp((1.0-StableStarField(uv*1000.,0.999)) * -10) * 3;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user