Skip to content

Commit 040ccb4

Browse files
committed
actually update readme this time!
1 parent 3633e08 commit 040ccb4

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

.idea/.idea.BlockGame/.idea/projectSettingsUpdater.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
* [Contributing](#contributing)
99
* [Acknowledgments](#acknowledgments)
1010

11+
## Temporary notice
12+
Just so y'all aren't left hanging; development's a bit slow now because I'm in my final year in uni (pray for me I'll get thru my diss!) <3 Don't worry, nothing's abandoned. This ain't a tech demo or a fancy-ass renderer, I'm actually making a game :P
13+
1114
## What?
1215

1316
This is a game made of blocks where you can do anything you want, with no one to stop you. (Not even lawyers!)

lib/FontStashSharp.Rasterizers.SixLabors.Fonts/FontStashSharp.Rasterizers.SixLabors.Fonts.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
10+
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta13" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

src/render/WorldRenderer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public void setUniforms() {
151151

152152
// the problem is that with two chunks, the two values would be the same. so let's adjust them if so
153153
var fogMaxValue = dd - 16;
154-
var fogMinValue = (int)(dd * 0.5f);
154+
var fogMinValue = (int)(dd * 0.25f);
155155

156156
if (fogMaxValue <= fogMinValue) {
157157
fogMinValue = fogMaxValue - 16;
@@ -279,8 +279,8 @@ private void renderSky(double interp) {
279279
// render a flat plane at y = 16
280280
var viewProj = world.player.camera.getStaticViewMatrix(interp) * world.player.camera.getProjectionMatrix();
281281
var modelView = world.player.camera.getStaticViewMatrix(interp);
282-
var sky = new Vector3(0, 16, 0);
283-
var skySize = 1024;
282+
var sky = new Vector3(0, 8, 0);
283+
const int skySize = 512;
284284

285285
// slightly bluer than the default clear colour
286286
var skyColour = new Color(100, 180, 255);

src/world/PlayerCamera.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,23 @@ public Matrix4x4 getStaticViewMatrix(double interp) {
122122
* Matrix4x4.CreateRotationY(MathF.Sin(tt) * iBob * factor2);
123123
}
124124

125+
/// <summary>
126+
/// Returns a view matrix that doesn't move with the player, but the Y is in worldspace (character moves up, skybox stays still). Used for sky rendering.
127+
/// </summary>
128+
public Matrix4x4 getStaticYViewMatrix(double interp) {
129+
var interpPos = new Vector3();
130+
// Only preserve Y coordinate from player position
131+
var iBob = float.DegreesToRadians(renderBob(interp));
132+
var tt = (float)double.Lerp(player.prevTotalTraveled, player.totalTraveled, interp);
133+
var factor = 0.4f;
134+
var factor2 = 0.15f;
135+
return Matrix4x4.CreateTranslation(0, -(float)renderPosition(interp).Y + 64, 0) *
136+
Matrix4x4.CreateLookAtLeftHanded(interpPos, interpPos + forward.toVec3(), up.toVec3())
137+
* Matrix4x4.CreateRotationZ(MathF.Sin(tt) * iBob * factor)
138+
* Matrix4x4.CreateRotationX(-Math.Abs(MathF.Cos(tt)) * iBob * factor)
139+
* Matrix4x4.CreateRotationY(MathF.Sin(tt) * iBob * factor2);
140+
}
141+
125142
public Matrix4x4 getViewMatrixRH(double interp) {
126143
var interpPos = renderPosition(interp);
127144
var iBob = float.DegreesToRadians(renderBob(interp));

0 commit comments

Comments
 (0)