Repe [T3DU] and Moises Jpelaez updates

This commit is contained in:
2026-05-12 23:54:06 -07:00
parent 6b404f9da6
commit 39091e8db3
147 changed files with 5539 additions and 1750 deletions

View File

@ -25,7 +25,6 @@ import iron.math.Quat;
#end
class RenderPath {
public static var active: RenderPath;
#if lnx_vr
static var vrSimulateMode: Bool = false;
@ -446,7 +445,9 @@ class RenderPath {
public function clearTarget(colorFlag: Null<Int> = null, depthFlag: Null<Float> = null) {
if (colorFlag == -1) { // -1 == 0xffffffff
if (Scene.active.world != null) {
colorFlag = Scene.active.world.raw.background_color;
var col = Scene.active.world.raw.background_color;
var strength = Scene.active.world.probe != null ? Scene.active.world.probe.raw.strength : 1.0;
colorFlag = Color.fromFloats(((col >> 16) & 0xff) / 255 * strength, ((col >> 8) & 0xff) / 255 * strength, (col & 0xff) / 255 * strength);
}
else if (Scene.active.camera != null) {
var cc = Scene.active.camera.data.raw.clear_color;
@ -477,7 +478,8 @@ class RenderPath {
if (depthDiff != 0) return depthDiff;
#end
return a.cameraDistance >= b.cameraDistance ? 1 : -1;
if (a.cameraDistance == b.cameraDistance) return 0;
return a.cameraDistance > b.cameraDistance ? 1 : -1;
});
}
@ -491,7 +493,9 @@ class RenderPath {
if (a.data.sortingIndex != b.data.sortingIndex) {
return a.data.sortingIndex > b.data.sortingIndex ? 1 : -1;
}
return a.data.name >= b.data.name ? 1 : -1;
if (a.data.name == b.data.name) return 0;
return a.data.name > b.data.name ? 1 : -1;
});
}
@ -667,9 +671,11 @@ class RenderPath {
end();
}
#if (rp_voxels != "Off")
public function getComputeShader(handle: String): kha.compute.Shader {
return Reflect.field(kha.Shaders, handle + "_comp");
}
#end
#if lnx_vr
// blits to each eyes viewport in the XR framebuffer.
@ -1229,7 +1235,7 @@ class CachedShaderContext {
public function new() {}
}
@:enum abstract DrawOrder(Int) from Int {
enum abstract DrawOrder(Int) from Int {
var Distance = 0; // Early-z
var Index = 1; // Less state changes
// var Mix = 2; // Distance buckets sorted by shader