t3du - Camera Render Filter

This commit is contained in:
2025-06-12 22:14:08 +00:00
parent 7cb8b8a2d2
commit 2715fe3398

View File

@ -24,6 +24,7 @@ class MeshObject extends Object {
public var render_emitter = true; public var render_emitter = true;
#end #end
public var cameraDistance: Float; public var cameraDistance: Float;
public var cameraList: Array<String> = null;
public var screenSize = 0.0; public var screenSize = 0.0;
public var frustumCulling = true; public var frustumCulling = true;
public var activeTilesheet: Tilesheet = null; public var activeTilesheet: Tilesheet = null;
@ -235,6 +236,8 @@ class MeshObject extends Object {
if (cullMesh(context, Scene.active.camera, RenderPath.active.light)) return; if (cullMesh(context, Scene.active.camera, RenderPath.active.light)) return;
var meshContext = raw != null ? context == "mesh" : false; var meshContext = raw != null ? context == "mesh" : false;
if (cameraList != null && cameraList.indexOf(Scene.active.camera.name) < 0) return;
#if lnx_particles #if lnx_particles
if (raw != null && raw.is_particle && particleOwner == null) return; // Instancing not yet set-up by particle system owner if (raw != null && raw.is_particle && particleOwner == null) return; // Instancing not yet set-up by particle system owner
if (particleSystems != null && meshContext) { if (particleSystems != null && meshContext) {
@ -245,6 +248,7 @@ class MeshObject extends Object {
Scene.active.spawnObject(psys.data.raw.instance_object, null, function(o: Object) { Scene.active.spawnObject(psys.data.raw.instance_object, null, function(o: Object) {
if (o != null) { if (o != null) {
var c: MeshObject = cast o; var c: MeshObject = cast o;
c.cameraList = this.cameraList;
particleChildren.push(c); particleChildren.push(c);
c.particleOwner = this; c.particleOwner = this;
c.particleIndex = particleChildren.length - 1; c.particleIndex = particleChildren.length - 1;