Material preview fix
This commit is contained in:
@@ -742,7 +742,7 @@ class UINodes extends iron.Trait {
|
||||
|
||||
if (shadowmap) {
|
||||
vert.add_uniform('mat4 W', '_worldMatrix');
|
||||
vert.add_uniform('mat4 LVP', '_lampViewProjectionMatrix');
|
||||
vert.add_uniform('mat4 LVP', '_lightViewProjectionMatrix');
|
||||
vert.write('vec4 wposition = W * vec4(pos, 1.0);');
|
||||
if (UITrait.inst.paintHeight) {
|
||||
vert.add_uniform('mat3 N', '_normalMatrix');
|
||||
|
||||
+16
-4
@@ -723,6 +723,9 @@ class UITrait extends iron.Trait {
|
||||
var m = Mat4.identity();
|
||||
m.translate(0, 0, 1);
|
||||
iron.Scene.active.camera.transform.setMatrix(m);
|
||||
var savedFov = iron.Scene.active.camera.data.raw.fov;
|
||||
iron.Scene.active.camera.data.raw.fov = 0.92;
|
||||
iron.Scene.active.camera.buildProjection();
|
||||
iron.Scene.active.camera.buildMatrix();
|
||||
|
||||
dirty = 2;
|
||||
@@ -745,6 +748,8 @@ class UITrait extends iron.Trait {
|
||||
iron.Scene.active.camera.transform.setMatrix(savedCamera);
|
||||
iron.Scene.active.camera.buildMatrix();
|
||||
arm.App.resize();
|
||||
iron.Scene.active.camera.data.raw.fov = savedFov;
|
||||
iron.Scene.active.camera.buildProjection();
|
||||
iron.Scene.active.camera.buildMatrix();
|
||||
|
||||
UINodes.inst.parseMeshMaterial();
|
||||
@@ -775,6 +780,9 @@ class UITrait extends iron.Trait {
|
||||
savedCamera.setFrom(iron.Scene.active.camera.transform.local);
|
||||
var m = new Mat4(0.9146286343879498, -0.0032648027153306235, 0.404281837254303, 0.4659988049397712, 0.404295023959927, 0.007367569133732468, -0.9145989516155143, -1.0687517188018691, 0.000007410128652369705, 0.9999675337275382, 0.008058532943908717, 0.015935682577325486, 0, 0, 0, 1);
|
||||
iron.Scene.active.camera.transform.setMatrix(m);
|
||||
var savedFov = iron.Scene.active.camera.data.raw.fov;
|
||||
iron.Scene.active.camera.data.raw.fov = 0.92;
|
||||
iron.Scene.active.camera.buildProjection();
|
||||
iron.Scene.active.camera.buildMatrix();
|
||||
|
||||
dirty = 2;
|
||||
@@ -802,6 +810,8 @@ class UITrait extends iron.Trait {
|
||||
iron.Scene.active.camera.transform.setMatrix(savedCamera);
|
||||
iron.Scene.active.camera.buildMatrix();
|
||||
arm.App.resize();
|
||||
iron.Scene.active.camera.data.raw.fov = savedFov;
|
||||
iron.Scene.active.camera.buildProjection();
|
||||
iron.Scene.active.camera.buildMatrix();
|
||||
|
||||
UINodes.inst.parseMeshMaterial();
|
||||
@@ -1306,9 +1316,11 @@ class UITrait extends iron.Trait {
|
||||
}
|
||||
|
||||
if (brushPaint == 2) { // Sticker
|
||||
// var psize = Std.int(stickerImage.width * (brushRadius * brushNodesRadius));
|
||||
var psize = Std.int(256 * (brushRadius * brushNodesRadius));
|
||||
g.drawScaledImage(stickerImage, mx - psize / 2, my - psize / 2 + psize, psize, -psize);
|
||||
if (mouse.x > 0 && mx < iron.App.w()) {
|
||||
// var psize = Std.int(stickerImage.width * (brushRadius * brushNodesRadius));
|
||||
var psize = Std.int(256 * (brushRadius * brushNodesRadius));
|
||||
g.drawScaledImage(stickerImage, mx - psize / 2, my - psize / 2 + psize, psize, -psize);
|
||||
}
|
||||
}
|
||||
else {
|
||||
var psize = Std.int(cursorImg.width * (brushRadius * brushNodesRadius));
|
||||
@@ -2090,6 +2102,7 @@ class UITrait extends iron.Trait {
|
||||
#end
|
||||
};
|
||||
}
|
||||
ui.combo(Id.handle(), ["obj"], "Format", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2349,5 +2362,4 @@ typedef TAPConfig = {
|
||||
// @:optional var version:Null<Float>;
|
||||
@:optional var plugins:Array<String>;
|
||||
@:optional var ui_layout:Null<Int>;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user