mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-12-04 23:22:58 +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);
|
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();
|
this.sky = new Sky();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ class PreviewWorld extends Scheduler {
|
||||||
if (misname == "marblepicker")
|
if (misname == "marblepicker")
|
||||||
difficulty = "advanced";
|
difficulty = "advanced";
|
||||||
else
|
else
|
||||||
difficulty = ["beginner", "intermediate", "advanced"][mis.difficultyIndex];
|
difficulty = mis.type;
|
||||||
|
|
||||||
var curToken = _loadToken;
|
var curToken = _loadToken;
|
||||||
|
|
||||||
|
|
@ -273,6 +273,7 @@ class PreviewWorld extends Scheduler {
|
||||||
worker.addTask(fwd -> {
|
worker.addTask(fwd -> {
|
||||||
sky.init(null, () -> {
|
sky.init(null, () -> {
|
||||||
scene.addChild(sky);
|
scene.addChild(sky);
|
||||||
|
sky.setPosition(scene.camera.pos.x, scene.camera.pos.y, scene.camera.pos.z);
|
||||||
fwd();
|
fwd();
|
||||||
}, skyElem);
|
}, skyElem);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class Sky extends Object {
|
||||||
sky.addNormals();
|
sky.addNormals();
|
||||||
sky.addUVs();
|
sky.addUVs();
|
||||||
var skyMesh = new h3d.scene.Mesh(sky, this);
|
var skyMesh = new h3d.scene.Mesh(sky, this);
|
||||||
skyMesh.material.mainPass.culling = Front;
|
skyMesh.material.mainPass.culling = None;
|
||||||
// This is such a hack
|
// This is such a hack
|
||||||
// skyMesh.material.mainPass.addShader(new h3d.shader.pbr.PropsValues(1, 0, 0, 1));
|
// skyMesh.material.mainPass.addShader(new h3d.shader.pbr.PropsValues(1, 0, 0, 1));
|
||||||
skyMesh.material.mainPass.enableLights = false;
|
skyMesh.material.mainPass.enableLights = false;
|
||||||
|
|
@ -51,7 +51,7 @@ class Sky extends Object {
|
||||||
// pbrprops.occlusionValue = 0;
|
// pbrprops.occlusionValue = 0;
|
||||||
// pbrprops.metalnessValue = 1;
|
// pbrprops.metalnessValue = 1;
|
||||||
|
|
||||||
skyMesh.scale(3500);
|
skyMesh.scale(10);
|
||||||
// var env = new Environment(texture);
|
// var env = new Environment(texture);
|
||||||
// env.compute();
|
// env.compute();
|
||||||
// var renderer = cast(level.scene.renderer, h3d.scene.pbr.Renderer);
|
// 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.removeShader(skyMesh.material.textureShader);
|
||||||
skyMesh.material.mainPass.addShader(shad);
|
skyMesh.material.mainPass.addShader(shad);
|
||||||
skyMesh.material.mainPass.depthWrite = false;
|
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");
|
skyMesh.material.mainPass.setPassName("sky");
|
||||||
cubemap = texture;
|
cubemap = texture;
|
||||||
onFinish();
|
onFinish();
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class CubemapRenderer {
|
||||||
this.sky = sky;
|
this.sky = sky;
|
||||||
this.cubemap = new Texture(128, 128, [Cube, Dynamic, Target], h3d.mat.Data.TextureFormat.RGB8);
|
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.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.position = new Vector();
|
||||||
this.nextFaceToRender = 0;
|
this.nextFaceToRender = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue