forked from LeenkxTeam/LNXSDK
Repe [T3DU] Update - 31f26d171bba0355ce2a77031e3aad4c64dbc7e9
This commit is contained in:
@ -428,12 +428,10 @@ class Uniforms {
|
||||
var v: Vec4 = null;
|
||||
helpVec.set(0, 0, 0, 0);
|
||||
switch (c.link) {
|
||||
#if lnx_debug
|
||||
case "_input": {
|
||||
helpVec.set(Input.getMouse().x / iron.App.w(), Input.getMouse().y / iron.App.h(), Input.getMouse().down() ? 1.0 : 0.0, 0.0);
|
||||
v = helpVec;
|
||||
}
|
||||
#end
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -690,7 +688,7 @@ class Uniforms {
|
||||
}
|
||||
case "_hosekSunDirection": {
|
||||
var w = Scene.active.world;
|
||||
if (w != null) {
|
||||
if (w != null && w.raw.sun_direction != null) {
|
||||
// Clamp Z for night cycle
|
||||
helpVec.set(w.raw.sun_direction[0],
|
||||
w.raw.sun_direction[1],
|
||||
@ -956,6 +954,22 @@ class Uniforms {
|
||||
}
|
||||
|
||||
static function setObjectConstant(g: Graphics, object: Object, location: ConstantLocation, c: TShaderConstant) {
|
||||
#if lnx_spot
|
||||
if (c.name == "LWVPSpot") {
|
||||
var light = getSpot(0);
|
||||
if (light != null) {
|
||||
if (object == null) helpMat.setIdentity();
|
||||
else helpMat.setFrom(object.transform.worldUnpack);
|
||||
|
||||
helpMat.multmat(light.VP);
|
||||
helpMat.multmat(biasMat);
|
||||
|
||||
g.setMatrix(location, helpMat.self);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
if (c.link == null) return;
|
||||
|
||||
var camera = Scene.active.camera;
|
||||
@ -1263,17 +1277,17 @@ class Uniforms {
|
||||
var vy: Null<kha.FastFloat> = null;
|
||||
switch (c.link) {
|
||||
case "_tilesheetOffset": {
|
||||
var ts = cast(object, MeshObject).tilesheet;
|
||||
var ts = cast(object, MeshObject).activeTilesheet;
|
||||
vx = ts.tileX;
|
||||
vy = ts.tileY;
|
||||
}
|
||||
case "_tilesheetFlip": {
|
||||
var ts = cast(object, MeshObject).tilesheet;
|
||||
var ts = cast(object, MeshObject).activeTilesheet;
|
||||
vx = ts.flipX ? 1.0 : 0.0;
|
||||
vy = ts.flipY ? 1.0 : 0.0;
|
||||
}
|
||||
case "_tilesheetTiles": {
|
||||
var ts = cast(object, MeshObject).tilesheet;
|
||||
var ts = cast(object, MeshObject).activeTilesheet;
|
||||
vx = ts.getTilesX();
|
||||
vy = ts.getTilesY();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user