Convert volumetric + shadow pass to entity tags
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-11-08 18:38:40 -05:00
parent a9c74e8d50
commit 86e61b7a0e
12 changed files with 49 additions and 27 deletions

View File

@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file #maven.buildNumber.plugin properties file
#Fri Nov 08 15:44:15 EST 2024 #Fri Nov 08 17:55:08 EST 2024
buildNumber=376 buildNumber=377

View File

@ -959,6 +959,9 @@ Player and entity tracking overhaul in grid data cell manager
Add more profiling points Add more profiling points
Height manual adjustment for content placement Height manual adjustment for content placement
Fast track client draw cell manager cell evaluation Fast track client draw cell manager cell evaluation
Fix foliage rendering
Fix async physics gen on client
Convert volumetric + shadow pass to entity tags
# TODO # TODO

View File

@ -191,10 +191,10 @@ public class MenuGeneratorsInGame {
boolean draw = (boolean)Globals.playerEntity.getData(EntityDataStrings.DATA_STRING_DRAW); boolean draw = (boolean)Globals.playerEntity.getData(EntityDataStrings.DATA_STRING_DRAW);
Globals.playerEntity.putData(EntityDataStrings.DATA_STRING_DRAW, !draw); Globals.playerEntity.putData(EntityDataStrings.DATA_STRING_DRAW, !draw);
} }
if(Globals.playerEntity.containsKey(EntityDataStrings.DRAW_CAST_SHADOW)){ // if(Globals.playerEntity.containsKey(EntityDataStrings.DRAW_CAST_SHADOW)){
boolean drawShadow = (boolean)Globals.playerEntity.getData(EntityDataStrings.DRAW_CAST_SHADOW); // boolean drawShadow = (boolean)Globals.playerEntity.getData(EntityDataStrings.DRAW_CAST_SHADOW);
Globals.playerEntity.putData(EntityDataStrings.DRAW_CAST_SHADOW, !drawShadow); // Globals.playerEntity.putData(EntityDataStrings.DRAW_CAST_SHADOW, !drawShadow);
} // }
} }
return false; return false;
}}); }});

View File

@ -125,6 +125,8 @@ public class EntityCreationUtils {
entity.putData(EntityDataStrings.DATA_STRING_DRAW, true); entity.putData(EntityDataStrings.DATA_STRING_DRAW, true);
entity.putData(EntityDataStrings.DRAW_SOLID_PASS, true); entity.putData(EntityDataStrings.DRAW_SOLID_PASS, true);
Globals.clientScene.registerEntityToTag(entity, EntityTags.DRAWABLE); Globals.clientScene.registerEntityToTag(entity, EntityTags.DRAWABLE);
Globals.clientScene.registerEntityToTag(entity, EntityTags.DRAW_VOLUMETIC_SOLIDS_PASS);
Globals.clientScene.registerEntityToTag(entity, EntityTags.DRAW_CAST_SHADOW);
} }
/** /**
@ -137,6 +139,24 @@ public class EntityCreationUtils {
entity.putData(EntityDataStrings.DATA_STRING_DRAW, true); entity.putData(EntityDataStrings.DATA_STRING_DRAW, true);
entity.putData(EntityDataStrings.DRAW_SOLID_PASS, true); entity.putData(EntityDataStrings.DRAW_SOLID_PASS, true);
Globals.clientScene.registerEntityToTag(entity, EntityTags.DRAWABLE); Globals.clientScene.registerEntityToTag(entity, EntityTags.DRAWABLE);
Globals.clientScene.registerEntityToTag(entity, EntityTags.DRAW_VOLUMETIC_SOLIDS_PASS);
Globals.clientScene.registerEntityToTag(entity, EntityTags.DRAW_CAST_SHADOW);
}
/**
* Alerts the entity to bypass the volumetrics pipeline
* @param entity The entity
*/
public static void bypassVolumetics(Entity entity){
Globals.clientScene.removeEntityFromTag(entity, EntityTags.DRAW_VOLUMETIC_SOLIDS_PASS);
}
/**
* Alerts the entity to bypass the shadow casting pipeline
* @param entity The entity
*/
public static void bypassShadowPass(Entity entity){
Globals.clientScene.removeEntityFromTag(entity, EntityTags.DRAW_CAST_SHADOW);
} }
/** /**

View File

@ -23,8 +23,6 @@ public class EntityDataStrings {
public static final String DATA_STRING_DRAW = "drawFlag"; public static final String DATA_STRING_DRAW = "drawFlag";
public static final String DRAW_SOLID_PASS = "drawSolidPass"; public static final String DRAW_SOLID_PASS = "drawSolidPass";
public static final String DRAW_TRANSPARENT_PASS = "drawTransparentPass"; public static final String DRAW_TRANSPARENT_PASS = "drawTransparentPass";
public static final String DRAW_CAST_SHADOW = "castShadow";
public static final String DRAW_VOLUMETRIC = "drawVolumetric";
public static final String DRAW_OUTLINE = "drawOutline"; public static final String DRAW_OUTLINE = "drawOutline";
public static final String INSTANCED_ACTOR = "instancedActor"; public static final String INSTANCED_ACTOR = "instancedActor";
public static final String DRAW_INSTANCED = "drawInstanced"; public static final String DRAW_INSTANCED = "drawInstanced";

View File

@ -25,5 +25,8 @@ public class EntityTags {
public static final String OBJECT = "object"; public static final String OBJECT = "object";
public static final String GRAVITY = "gravity"; public static final String GRAVITY = "gravity";
public static final String PARTICLE = "particle"; public static final String PARTICLE = "particle";
public static final String DRAW_CAST_SHADOW = "drawCastShadow";
public static final String DRAW_VOLUMETIC_DEPTH_PASS = "drawVolumetricDepthPass"; //draw in the volumetic phase of the volumetric pass
public static final String DRAW_VOLUMETIC_SOLIDS_PASS = "drawVolumetricSolidsPass"; //draw in the non-volumetic phase of the volumetric pass
} }

View File

@ -53,6 +53,9 @@ public class Scene {
tagEntityMap.put(EntityTags.UI, new CopyOnWriteArraySet<Entity>()); tagEntityMap.put(EntityTags.UI, new CopyOnWriteArraySet<Entity>());
tagEntityMap.put(EntityTags.DRAWABLE, new CopyOnWriteArraySet<Entity>()); tagEntityMap.put(EntityTags.DRAWABLE, new CopyOnWriteArraySet<Entity>());
tagEntityMap.put(EntityTags.DRAW_INSTANCED, new CopyOnWriteArraySet<Entity>()); tagEntityMap.put(EntityTags.DRAW_INSTANCED, new CopyOnWriteArraySet<Entity>());
tagEntityMap.put(EntityTags.DRAW_VOLUMETIC_SOLIDS_PASS, new CopyOnWriteArraySet<Entity>());
tagEntityMap.put(EntityTags.DRAW_VOLUMETIC_DEPTH_PASS, new CopyOnWriteArraySet<Entity>());
tagEntityMap.put(EntityTags.DRAW_CAST_SHADOW, new CopyOnWriteArraySet<Entity>());
tagEntityMap.put(EntityTags.LIGHT, new CopyOnWriteArraySet<Entity>()); tagEntityMap.put(EntityTags.LIGHT, new CopyOnWriteArraySet<Entity>());
tagEntityMap.put(EntityTags.ITEM, new CopyOnWriteArraySet<Entity>()); tagEntityMap.put(EntityTags.ITEM, new CopyOnWriteArraySet<Entity>());
tagEntityMap.put(EntityTags.GRAVITY, new CopyOnWriteArraySet<Entity>()); tagEntityMap.put(EntityTags.GRAVITY, new CopyOnWriteArraySet<Entity>());

View File

@ -151,7 +151,6 @@ public class CommonEntityUtils {
GraphicsTemplate graphicsTemplate = rawType.getGraphicsTemplate(); GraphicsTemplate graphicsTemplate = rawType.getGraphicsTemplate();
if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getPath() != null && EntityUtils.getActor(entity) == null && generateDrawable == true){ if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getPath() != null && EntityUtils.getActor(entity) == null && generateDrawable == true){
EntityCreationUtils.makeEntityDrawable(entity, graphicsTemplate.getModel().getPath()); EntityCreationUtils.makeEntityDrawable(entity, graphicsTemplate.getModel().getPath());
entity.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
} }
//idle tree & generic stuff all creatures have //idle tree & generic stuff all creatures have
if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getIdleData() != null){ if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getIdleData() != null){
@ -449,7 +448,6 @@ public class CommonEntityUtils {
GraphicsTemplate graphicsTemplate = rawType.getGraphicsTemplate(); GraphicsTemplate graphicsTemplate = rawType.getGraphicsTemplate();
if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getPath() != null && EntityUtils.getPoseActor(entity) == null && generateDrawable == true){ if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getPath() != null && EntityUtils.getPoseActor(entity) == null && generateDrawable == true){
EntityCreationUtils.makeEntityPoseable(entity, graphicsTemplate.getModel().getPath()); EntityCreationUtils.makeEntityPoseable(entity, graphicsTemplate.getModel().getPath());
entity.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
} }
//idle tree & generic stuff all creatures have //idle tree & generic stuff all creatures have
if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getIdleData() != null){ if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getIdleData() != null){

View File

@ -106,7 +106,6 @@ public class FoliageUtils {
rVal.putData(EntityDataStrings.FOLIAGE_TYPE, rawType); rVal.putData(EntityDataStrings.FOLIAGE_TYPE, rawType);
rVal.putData(EntityDataStrings.FOLIAGE_SEED, seed); rVal.putData(EntityDataStrings.FOLIAGE_SEED, seed);
rVal.putData(EntityDataStrings.FOLIAGE_IS_SEEDED, true); rVal.putData(EntityDataStrings.FOLIAGE_IS_SEEDED, true);
rVal.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
//position entity //position entity
//this needs to be called at the end of this function. //this needs to be called at the end of this function.

View File

@ -56,6 +56,9 @@ public class TerrainChunk {
if(levelOfDetail == ClientDrawCellManager.FULL_RES_LOD){ if(levelOfDetail == ClientDrawCellManager.FULL_RES_LOD){
PhysicsEntityUtils.clientAttachTerrainChunkRigidBody(rVal, data); PhysicsEntityUtils.clientAttachTerrainChunkRigidBody(rVal, data);
CollisionObjUtils.clientPositionCharacter(rVal, new Vector3d(EntityUtils.getPosition(rVal)), new Quaterniond()); CollisionObjUtils.clientPositionCharacter(rVal, new Vector3d(EntityUtils.getPosition(rVal)), new Quaterniond());
} else {
EntityCreationUtils.bypassShadowPass(rVal);
EntityCreationUtils.bypassVolumetics(rVal);
} }
} else { } else {
LoggerInterface.loggerEngine.WARNING("Finished generating terrain polygons; however, entity has already been deleted."); LoggerInterface.loggerEngine.WARNING("Finished generating terrain polygons; however, entity has already been deleted.");
@ -69,7 +72,6 @@ public class TerrainChunk {
} }
rVal.putData(EntityDataStrings.TERRAIN_IS_TERRAIN, true); rVal.putData(EntityDataStrings.TERRAIN_IS_TERRAIN, true);
rVal.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
Globals.profiler.endCpuSample(); Globals.profiler.endCpuSample();
return rVal; return rVal;
} }

View File

@ -99,11 +99,10 @@ public class ShadowMapPipeline implements RenderPipeline {
// D R A W A L L E N T I T I E S // D R A W A L L E N T I T I E S
// //
modelTransformMatrix = new Matrix4d(); modelTransformMatrix = new Matrix4d();
for(Entity currentEntity : Globals.clientScene.getEntitiesWithTag(EntityTags.DRAWABLE)){ for(Entity currentEntity : Globals.clientScene.getEntitiesWithTag(EntityTags.DRAW_CAST_SHADOW)){
Vector3d position = EntityUtils.getPosition(currentEntity); Vector3d position = EntityUtils.getPosition(currentEntity);
if( if(
currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW)!=null && currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW)!=null
currentEntity.containsKey(EntityDataStrings.DRAW_CAST_SHADOW)
){ ){
//fetch actor //fetch actor
Actor currentActor = EntityUtils.getActor(currentEntity); Actor currentActor = EntityUtils.getActor(currentEntity);

View File

@ -64,12 +64,11 @@ public class VolumeBufferPipeline implements RenderPipeline {
// //
// D R A W A L L E N T I T I E S // D R A W A L L E N T I T I E S
// //
for(Entity currentEntity : Globals.clientScene.getEntitiesWithTag(EntityTags.DRAWABLE)){ for(Entity currentEntity : Globals.clientScene.getEntitiesWithTag(EntityTags.DRAW_VOLUMETIC_DEPTH_PASS)){
Vector3d position = EntityUtils.getPosition(currentEntity); Vector3d position = EntityUtils.getPosition(currentEntity);
if( if(
currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW)!=null && currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW)!=null
currentEntity.containsKey(EntityDataStrings.DRAW_VOLUMETRIC) ){
){
//fetch actor //fetch actor
Actor currentActor = EntityUtils.getActor(currentEntity); Actor currentActor = EntityUtils.getActor(currentEntity);
//calculate camera-modified vector3f //calculate camera-modified vector3f
@ -86,12 +85,11 @@ public class VolumeBufferPipeline implements RenderPipeline {
// //
//Draw front faces of all non-volumetrics //Draw front faces of all non-volumetrics
// //
for(Entity currentEntity : Globals.clientScene.getEntitiesWithTag(EntityTags.DRAWABLE)){ for(Entity currentEntity : Globals.clientScene.getEntitiesWithTag(EntityTags.DRAW_VOLUMETIC_SOLIDS_PASS)){
Vector3d position = EntityUtils.getPosition(currentEntity); Vector3d position = EntityUtils.getPosition(currentEntity);
if( if(
(boolean)currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW) && (boolean)currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW)
!currentEntity.containsKey(EntityDataStrings.DRAW_VOLUMETRIC) ){
){
//fetch actor //fetch actor
Actor currentActor = EntityUtils.getActor(currentEntity); Actor currentActor = EntityUtils.getActor(currentEntity);
//calculate camera-modified vector3f //calculate camera-modified vector3f
@ -123,12 +121,11 @@ public class VolumeBufferPipeline implements RenderPipeline {
// //
// D R A W A L L E N T I T I E S // D R A W A L L E N T I T I E S
// //
for(Entity currentEntity : Globals.clientScene.getEntitiesWithTag(EntityTags.DRAWABLE)){ for(Entity currentEntity : Globals.clientScene.getEntitiesWithTag(EntityTags.DRAW_VOLUMETIC_DEPTH_PASS)){
Vector3d position = EntityUtils.getPosition(currentEntity); Vector3d position = EntityUtils.getPosition(currentEntity);
if( if(
(boolean)currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW) && (boolean)currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW)
currentEntity.containsKey(EntityDataStrings.DRAW_VOLUMETRIC) ){
){
//fetch actor //fetch actor
Actor currentActor = EntityUtils.getActor(currentEntity); Actor currentActor = EntityUtils.getActor(currentEntity);
//calculate camera-modified vector3f //calculate camera-modified vector3f