mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-12-04 15:13:22 +00:00
sky fixes
This commit is contained in:
parent
6898b7bc19
commit
4c252cfbc3
4 changed files with 7 additions and 6 deletions
|
|
@ -354,7 +354,7 @@ class MarbleWorld extends Scheduler {
|
|||
worker.loadFile(file);
|
||||
}
|
||||
|
||||
this.scene.camera.zFar = Math.max(4000, Std.parseFloat(this.skyElement.visibledistance));
|
||||
this.scene.camera.zFar = Std.parseFloat(this.skyElement.visibledistance);
|
||||
|
||||
this.sky = new Sky();
|
||||
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ class PreviewWorld extends Scheduler {
|
|||
if (misname == "marblepicker")
|
||||
difficulty = "advanced";
|
||||
else
|
||||
difficulty = ["beginner", "intermediate", "advanced"][mis.difficultyIndex];
|
||||
difficulty = mis.type;
|
||||
|
||||
var curToken = _loadToken;
|
||||
|
||||
|
|
@ -273,6 +273,7 @@ class PreviewWorld extends Scheduler {
|
|||
worker.addTask(fwd -> {
|
||||
sky.init(null, () -> {
|
||||
scene.addChild(sky);
|
||||
sky.setPosition(scene.camera.pos.x, scene.camera.pos.y, scene.camera.pos.z);
|
||||
fwd();
|
||||
}, skyElem);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Sky extends Object {
|
|||
sky.addNormals();
|
||||
sky.addUVs();
|
||||
var skyMesh = new h3d.scene.Mesh(sky, this);
|
||||
skyMesh.material.mainPass.culling = Front;
|
||||
skyMesh.material.mainPass.culling = None;
|
||||
// This is such a hack
|
||||
// skyMesh.material.mainPass.addShader(new h3d.shader.pbr.PropsValues(1, 0, 0, 1));
|
||||
skyMesh.material.mainPass.enableLights = false;
|
||||
|
|
@ -51,7 +51,7 @@ class Sky extends Object {
|
|||
// pbrprops.occlusionValue = 0;
|
||||
// pbrprops.metalnessValue = 1;
|
||||
|
||||
skyMesh.scale(3500);
|
||||
skyMesh.scale(10);
|
||||
// var env = new Environment(texture);
|
||||
// env.compute();
|
||||
// var renderer = cast(level.scene.renderer, h3d.scene.pbr.Renderer);
|
||||
|
|
@ -59,7 +59,7 @@ class Sky extends Object {
|
|||
skyMesh.material.mainPass.removeShader(skyMesh.material.textureShader);
|
||||
skyMesh.material.mainPass.addShader(shad);
|
||||
skyMesh.material.mainPass.depthWrite = false;
|
||||
skyMesh.material.mainPass.depth(false, h3d.mat.Data.Compare.LessEqual);
|
||||
skyMesh.material.mainPass.depth(false, Always);
|
||||
skyMesh.material.mainPass.setPassName("sky");
|
||||
cubemap = texture;
|
||||
onFinish();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class CubemapRenderer {
|
|||
this.sky = sky;
|
||||
this.cubemap = new Texture(128, 128, [Cube, Dynamic, Target], h3d.mat.Data.TextureFormat.RGB8);
|
||||
this.cubemap.depthBuffer = new h3d.mat.DepthBuffer(128, 128, h3d.mat.DepthBuffer.DepthFormat.Depth16);
|
||||
this.camera = new Camera(90, 1, 1, 0.02, scene.camera.zFar);
|
||||
this.camera = new Camera(90, 1, 1, 0.1, 1000);
|
||||
this.position = new Vector();
|
||||
this.nextFaceToRender = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue