mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-12-05 15:43:40 +00:00
holy shit finally nuke shadows out of the engine
This commit is contained in:
parent
e216be4ec9
commit
602e662503
6 changed files with 26 additions and 6 deletions
|
|
@ -27,6 +27,8 @@ class Debug {
|
|||
debugTriangles.remove();
|
||||
}
|
||||
debugTriangles = new h3d.scene.Mesh(prim, h3d.mat.Material.create());
|
||||
debugTriangles.material.receiveShadows = false;
|
||||
debugTriangles.material.castShadows = false;
|
||||
prim.addUVs();
|
||||
prim.addNormals();
|
||||
MarbleGame.instance.scene.addChild(debugTriangles);
|
||||
|
|
|
|||
|
|
@ -832,20 +832,20 @@ class DifBuilder {
|
|||
thisprops.light = false; // We will calculate our own lighting
|
||||
material.props = thisprops;
|
||||
material.shadows = false;
|
||||
material.receiveShadows = true;
|
||||
material.receiveShadows = false;
|
||||
fwd();
|
||||
});
|
||||
});
|
||||
prim.addTangents();
|
||||
} else {
|
||||
material.shadows = false;
|
||||
material.receiveShadows = true;
|
||||
material.receiveShadows = false;
|
||||
}
|
||||
} else {
|
||||
Console.warn('Unable to load ${grp} texture for dif ${path}');
|
||||
material = Material.create();
|
||||
material.shadows = false;
|
||||
material.receiveShadows = true;
|
||||
material.receiveShadows = false;
|
||||
}
|
||||
// material.mainPass.addShader(new h3d.shader.pbr.PropsValues(1, 0, 0, 1));
|
||||
if (Debug.wireFrame)
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ class DtsObject extends GameObject {
|
|||
}
|
||||
material.shadows = false;
|
||||
if (this.isCollideable)
|
||||
material.receiveShadows = true;
|
||||
material.receiveShadows = false;
|
||||
if (material.texture == null && !iflMaterial) {
|
||||
var dtsshader = new DtsTexture();
|
||||
dtsshader.currentOpacity = 1;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package src;
|
||||
|
||||
import h3d.Vector;
|
||||
import src.Console;
|
||||
|
||||
class Renderer extends h3d.scene.Renderer {
|
||||
|
|
@ -29,8 +30,18 @@ class Renderer extends h3d.scene.Renderer {
|
|||
}
|
||||
|
||||
override function render() {
|
||||
if (has("shadow"))
|
||||
renderPass(shadow, get("shadow"));
|
||||
// if (has("shadow"))
|
||||
// renderPass(shadow, get("shadow"));
|
||||
|
||||
// The shadow bullshit
|
||||
ctx.setGlobalID(@:privateAccess shadow.shadowMapId, {
|
||||
texture: @:privateAccess shadow.dshader.shadowMap,
|
||||
channel: @:privateAccess shadow.format == h3d.mat.Texture.nativeFormat ? hxsl.Channel.PackedFloat : hxsl.Channel.R
|
||||
});
|
||||
ctx.setGlobalID(@:privateAccess shadow.shadowProjId, @:privateAccess shadow.getShadowProj());
|
||||
ctx.setGlobalID(@:privateAccess shadow.shadowColorId, new Vector(0, 0, 0, 0));
|
||||
ctx.setGlobalID(@:privateAccess shadow.shadowPowerId, 0.0);
|
||||
ctx.setGlobalID(@:privateAccess shadow.shadowBiasId, 0.0);
|
||||
|
||||
renderPass(defaultPass, get("skyshape"));
|
||||
renderPass(defaultPass, get("default"));
|
||||
|
|
|
|||
|
|
@ -27,10 +27,12 @@ class BoxCollisionEntity extends CollisionEntity implements IBVHObject {
|
|||
if (Debug.drawBounds) {
|
||||
if (_dbgEntity == null) {
|
||||
_dbgEntity = cast this.boundingBox.makeDebugObj();
|
||||
_dbgEntity.getMaterials()[0].castShadows = false;
|
||||
_dbgEntity.getMaterials()[0].mainPass.wireframe = true;
|
||||
MarbleGame.instance.scene.addChild(_dbgEntity);
|
||||
} else {
|
||||
_dbgEntity = cast this.boundingBox.makeDebugObj();
|
||||
_dbgEntity.getMaterials()[0].castShadows = false;
|
||||
_dbgEntity.getMaterials()[0].mainPass.wireframe = true;
|
||||
MarbleGame.instance.scene.addChild(_dbgEntity);
|
||||
}
|
||||
|
|
@ -42,6 +44,7 @@ class BoxCollisionEntity extends CollisionEntity implements IBVHObject {
|
|||
if (Debug.drawBounds) {
|
||||
if (_dbgEntity != null) {
|
||||
_dbgEntity = cast this.boundingBox.makeDebugObj();
|
||||
_dbgEntity.getMaterials()[0].castShadows = false;
|
||||
_dbgEntity.getMaterials()[0].mainPass.wireframe = true;
|
||||
MarbleGame.instance.scene.addChild(_dbgEntity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,11 +114,13 @@ class CollisionEntity implements IOctreeObject implements IBVHObject {
|
|||
if (Debug.drawBounds) {
|
||||
if (_dbgEntity == null) {
|
||||
_dbgEntity = cast this.boundingBox.makeDebugObj();
|
||||
_dbgEntity.getMaterials()[0].castShadows = false;
|
||||
_dbgEntity.getMaterials()[0].mainPass.wireframe = true;
|
||||
MarbleGame.instance.scene.addChild(_dbgEntity);
|
||||
} else {
|
||||
_dbgEntity.remove();
|
||||
_dbgEntity = cast this.boundingBox.makeDebugObj();
|
||||
_dbgEntity.getMaterials()[0].castShadows = false;
|
||||
_dbgEntity.getMaterials()[0].mainPass.wireframe = true;
|
||||
MarbleGame.instance.scene.addChild(_dbgEntity);
|
||||
}
|
||||
|
|
@ -143,11 +145,13 @@ class CollisionEntity implements IOctreeObject implements IBVHObject {
|
|||
if (Debug.drawBounds) {
|
||||
if (_dbgEntity == null) {
|
||||
_dbgEntity = cast this.boundingBox.makeDebugObj();
|
||||
_dbgEntity.getMaterials()[0].castShadows = false;
|
||||
_dbgEntity.getMaterials()[0].mainPass.wireframe = true;
|
||||
MarbleGame.instance.scene.addChild(_dbgEntity);
|
||||
} else {
|
||||
_dbgEntity.remove();
|
||||
_dbgEntity = cast this.boundingBox.makeDebugObj();
|
||||
_dbgEntity.getMaterials()[0].castShadows = false;
|
||||
_dbgEntity.getMaterials()[0].mainPass.wireframe = true;
|
||||
MarbleGame.instance.scene.addChild(_dbgEntity);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue