diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index 8171c44..dbde1f5 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -940,7 +940,17 @@ void main() { #if RESOURCEPACK_SKY == 1 || RESOURCEPACK_SKY == 0 - vec3 orbitstar = vec3(feetPlayerPos_normalized.x,abs(feetPlayerPos_normalized.y),feetPlayerPos_normalized.z); orbitstar.x -= WsunVec.x*0.2; + vec3 orbitstar = vec3(feetPlayerPos_normalized.x,abs(feetPlayerPos_normalized.y),feetPlayerPos_normalized.z); + + vec3 axis = vec3(0, sin(sunPathRotation*0.0174533), cos(sunPathRotation*0.0174533)); + float s = -sqrt(1 - (WsunVec.x * WsunVec.x)); + float c = WsunVec.x; + float oc = 1.0 - c; + + orbitstar *= mat3(c , - axis.z * s , axis.y * s, + axis.z * s , oc * axis.y * axis.y + c, oc * axis.y * axis.z, + - axis.y * s, oc * axis.y * axis.z , oc * axis.z * axis.z + c); + Background += stars(orbitstar) * 10.0; #endif diff --git a/shaders/lib/stars.glsl b/shaders/lib/stars.glsl index 8b96837..6d6ce23 100644 --- a/shaders/lib/stars.glsl +++ b/shaders/lib/stars.glsl @@ -41,8 +41,8 @@ float StableStarField( in vec2 vSamplePos, float fThreshhold ) float stars(vec3 viewPos){ - float elevation = clamp(viewPos.y,0.,1.); - vec2 uv = viewPos.xz/(1.5+elevation); + 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; + uv *= 0.5; return exp((1.0-StableStarField(uv*1000.,0.999)) * -10) * 3; // return StableStarField(uv*1000.,0.999)*0.5*0.3;