mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-14 18:15:28 -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 ClassicalSharp.GraphicsAPI;
|
||||
using OpenTK;
|
||||
using OpenTK;
|
||||
|
||||
namespace ClassicalSharp.Renderers {
|
||||
|
||||
@ -27,11 +28,21 @@ namespace ClassicalSharp.Renderers {
|
||||
|
||||
Vector3 eyePos = game.LocalPlayer.EyePosition;
|
||||
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.BindVb( skyVb );
|
||||
if( skyY == normalY ) {
|
||||
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 );
|
||||
ResetFog();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user