Use depth for 3d cursor normal
This commit is contained in:
@@ -39,11 +39,10 @@ class Layers {
|
||||
public static var cursorVP: ConstantLocation;
|
||||
public static var cursorInvVP: ConstantLocation;
|
||||
public static var cursorMouse: ConstantLocation;
|
||||
public static var cursorStep: ConstantLocation;
|
||||
public static var cursorTexStep: ConstantLocation;
|
||||
public static var cursorRadius: ConstantLocation;
|
||||
public static var cursorTex: TextureUnit;
|
||||
public static var cursorGbufferD: TextureUnit;
|
||||
public static var cursorGbuffer0: TextureUnit;
|
||||
|
||||
public static inline var defaultBase = 0.5;
|
||||
public static inline var defaultRough = 0.4;
|
||||
@@ -167,10 +166,9 @@ class Layers {
|
||||
cursorVP = pipeCursor.getConstantLocation("VP");
|
||||
cursorInvVP = pipeCursor.getConstantLocation("invVP");
|
||||
cursorMouse = pipeCursor.getConstantLocation("mouse");
|
||||
cursorStep = pipeCursor.getConstantLocation("step");
|
||||
cursorTexStep = pipeCursor.getConstantLocation("texStep");
|
||||
cursorRadius = pipeCursor.getConstantLocation("radius");
|
||||
cursorGbufferD = pipeCursor.getTextureUnit("gbufferD");
|
||||
cursorGbuffer0 = pipeCursor.getTextureUnit("gbuffer0");
|
||||
cursorTex = pipeCursor.getTextureUnit("tex");
|
||||
}
|
||||
|
||||
|
||||
@@ -268,7 +268,6 @@ class RenderPathPaint {
|
||||
g.setTexture(Layers.cursorTex, img);
|
||||
var gbuffer0 = path.renderTargets.get("gbuffer0").image;
|
||||
g.setTextureDepth(Layers.cursorGbufferD, gbuffer0);
|
||||
g.setTexture(Layers.cursorGbuffer0, gbuffer0);
|
||||
var mx = Input.getMouse().viewX / iron.App.w();
|
||||
var my = 1.0 - (Input.getMouse().viewY / iron.App.h());
|
||||
if (UITrait.inst.brushLocked) {
|
||||
@@ -276,7 +275,7 @@ class RenderPathPaint {
|
||||
my = 1.0 - (UITrait.inst.lockStartedY - iron.App.y()) / iron.App.h();
|
||||
}
|
||||
g.setFloat2(Layers.cursorMouse, mx, my);
|
||||
g.setFloat2(Layers.cursorStep, 2 / gbuffer0.width, 2 / gbuffer0.height);
|
||||
g.setFloat2(Layers.cursorTexStep, 1 / gbuffer0.width, 1 / gbuffer0.height);
|
||||
g.setFloat(Layers.cursorRadius, UITrait.inst.brushRadius / 3.4);
|
||||
g.setMatrix(Layers.cursorVP, Scene.active.camera.VP.self);
|
||||
var helpMat = iron.math.Mat4.identity();
|
||||
|
||||
Reference in New Issue
Block a user