mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 18:45:23 -04:00
Push up sky rather than hide it.
This commit is contained in:
parent
cd7190e9eb
commit
70eb21ff4d
@ -2,6 +2,7 @@
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using ClassicalSharp.GraphicsAPI;
|
using ClassicalSharp.GraphicsAPI;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
namespace ClassicalSharp.Renderers {
|
namespace ClassicalSharp.Renderers {
|
||||||
|
|
||||||
@ -27,11 +28,21 @@ namespace ClassicalSharp.Renderers {
|
|||||||
|
|
||||||
Vector3 eyePos = game.LocalPlayer.EyePosition;
|
Vector3 eyePos = game.LocalPlayer.EyePosition;
|
||||||
Vector3 pos = game.Camera.GetCameraPos( eyePos );
|
Vector3 pos = game.Camera.GetCameraPos( eyePos );
|
||||||
if( pos.Y < map.CloudHeight + 8 ) {
|
float normalY = map.CloudHeight + 8;
|
||||||
|
float skyY = Math.Max( pos.Y + 8, normalY );
|
||||||
|
|
||||||
graphics.BeginVbBatch( VertexFormat.Pos3fCol4b );
|
graphics.BeginVbBatch( VertexFormat.Pos3fCol4b );
|
||||||
graphics.BindVb( skyVb );
|
graphics.BindVb( skyVb );
|
||||||
|
if( skyY == normalY ) {
|
||||||
graphics.DrawIndexedVb( DrawMode.Triangles, skyVertices * 6 / 4, 0 );
|
graphics.DrawIndexedVb( DrawMode.Triangles, skyVertices * 6 / 4, 0 );
|
||||||
|
} else {
|
||||||
|
Matrix4 m = Matrix4.Translate( 0, skyY - normalY, 0 );
|
||||||
|
graphics.PushMatrix();
|
||||||
|
graphics.MultiplyMatrix( ref m );
|
||||||
|
graphics.DrawIndexedVb( DrawMode.Triangles, skyVertices * 6 / 4, 0 );
|
||||||
|
graphics.PopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderClouds( deltaTime );
|
RenderClouds( deltaTime );
|
||||||
ResetFog();
|
ResetFog();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user