Convert volumetric + shadow pass to entity tags
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
a9c74e8d50
commit
86e61b7a0e
@ -1,3 +1,3 @@
|
||||
#maven.buildNumber.plugin properties file
|
||||
#Fri Nov 08 15:44:15 EST 2024
|
||||
buildNumber=376
|
||||
#Fri Nov 08 17:55:08 EST 2024
|
||||
buildNumber=377
|
||||
|
||||
@ -959,6 +959,9 @@ Player and entity tracking overhaul in grid data cell manager
|
||||
Add more profiling points
|
||||
Height manual adjustment for content placement
|
||||
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
|
||||
|
||||
@ -191,10 +191,10 @@ public class MenuGeneratorsInGame {
|
||||
boolean draw = (boolean)Globals.playerEntity.getData(EntityDataStrings.DATA_STRING_DRAW);
|
||||
Globals.playerEntity.putData(EntityDataStrings.DATA_STRING_DRAW, !draw);
|
||||
}
|
||||
if(Globals.playerEntity.containsKey(EntityDataStrings.DRAW_CAST_SHADOW)){
|
||||
boolean drawShadow = (boolean)Globals.playerEntity.getData(EntityDataStrings.DRAW_CAST_SHADOW);
|
||||
Globals.playerEntity.putData(EntityDataStrings.DRAW_CAST_SHADOW, !drawShadow);
|
||||
}
|
||||
// if(Globals.playerEntity.containsKey(EntityDataStrings.DRAW_CAST_SHADOW)){
|
||||
// boolean drawShadow = (boolean)Globals.playerEntity.getData(EntityDataStrings.DRAW_CAST_SHADOW);
|
||||
// Globals.playerEntity.putData(EntityDataStrings.DRAW_CAST_SHADOW, !drawShadow);
|
||||
// }
|
||||
}
|
||||
return false;
|
||||
}});
|
||||
|
||||
@ -125,6 +125,8 @@ public class EntityCreationUtils {
|
||||
entity.putData(EntityDataStrings.DATA_STRING_DRAW, true);
|
||||
entity.putData(EntityDataStrings.DRAW_SOLID_PASS, true);
|
||||
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.DRAW_SOLID_PASS, true);
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -23,8 +23,6 @@ public class EntityDataStrings {
|
||||
public static final String DATA_STRING_DRAW = "drawFlag";
|
||||
public static final String DRAW_SOLID_PASS = "drawSolidPass";
|
||||
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 INSTANCED_ACTOR = "instancedActor";
|
||||
public static final String DRAW_INSTANCED = "drawInstanced";
|
||||
|
||||
@ -25,5 +25,8 @@ public class EntityTags {
|
||||
public static final String OBJECT = "object";
|
||||
public static final String GRAVITY = "gravity";
|
||||
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
|
||||
|
||||
}
|
||||
|
||||
@ -53,6 +53,9 @@ public class Scene {
|
||||
tagEntityMap.put(EntityTags.UI, new CopyOnWriteArraySet<Entity>());
|
||||
tagEntityMap.put(EntityTags.DRAWABLE, 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.ITEM, new CopyOnWriteArraySet<Entity>());
|
||||
tagEntityMap.put(EntityTags.GRAVITY, new CopyOnWriteArraySet<Entity>());
|
||||
|
||||
@ -151,7 +151,6 @@ public class CommonEntityUtils {
|
||||
GraphicsTemplate graphicsTemplate = rawType.getGraphicsTemplate();
|
||||
if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getPath() != null && EntityUtils.getActor(entity) == null && generateDrawable == true){
|
||||
EntityCreationUtils.makeEntityDrawable(entity, graphicsTemplate.getModel().getPath());
|
||||
entity.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
|
||||
}
|
||||
//idle tree & generic stuff all creatures have
|
||||
if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getIdleData() != null){
|
||||
@ -449,7 +448,6 @@ public class CommonEntityUtils {
|
||||
GraphicsTemplate graphicsTemplate = rawType.getGraphicsTemplate();
|
||||
if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getPath() != null && EntityUtils.getPoseActor(entity) == null && generateDrawable == true){
|
||||
EntityCreationUtils.makeEntityPoseable(entity, graphicsTemplate.getModel().getPath());
|
||||
entity.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
|
||||
}
|
||||
//idle tree & generic stuff all creatures have
|
||||
if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getIdleData() != null){
|
||||
|
||||
@ -106,7 +106,6 @@ public class FoliageUtils {
|
||||
rVal.putData(EntityDataStrings.FOLIAGE_TYPE, rawType);
|
||||
rVal.putData(EntityDataStrings.FOLIAGE_SEED, seed);
|
||||
rVal.putData(EntityDataStrings.FOLIAGE_IS_SEEDED, true);
|
||||
rVal.putData(EntityDataStrings.DRAW_CAST_SHADOW, true);
|
||||
|
||||
//position entity
|
||||
//this needs to be called at the end of this function.
|
||||
|
||||
@ -56,6 +56,9 @@ public class TerrainChunk {
|
||||
if(levelOfDetail == ClientDrawCellManager.FULL_RES_LOD){
|
||||
PhysicsEntityUtils.clientAttachTerrainChunkRigidBody(rVal, data);
|
||||
CollisionObjUtils.clientPositionCharacter(rVal, new Vector3d(EntityUtils.getPosition(rVal)), new Quaterniond());
|
||||
} else {
|
||||
EntityCreationUtils.bypassShadowPass(rVal);
|
||||
EntityCreationUtils.bypassVolumetics(rVal);
|
||||
}
|
||||
} else {
|
||||
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.DRAW_CAST_SHADOW, true);
|
||||
Globals.profiler.endCpuSample();
|
||||
return rVal;
|
||||
}
|
||||
|
||||
@ -99,11 +99,10 @@ public class ShadowMapPipeline implements RenderPipeline {
|
||||
// D R A W A L L E N T I T I E S
|
||||
//
|
||||
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);
|
||||
if(
|
||||
currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW)!=null &&
|
||||
currentEntity.containsKey(EntityDataStrings.DRAW_CAST_SHADOW)
|
||||
currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW)!=null
|
||||
){
|
||||
//fetch actor
|
||||
Actor currentActor = EntityUtils.getActor(currentEntity);
|
||||
|
||||
@ -64,12 +64,11 @@ public class VolumeBufferPipeline implements RenderPipeline {
|
||||
//
|
||||
// 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);
|
||||
if(
|
||||
currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW)!=null &&
|
||||
currentEntity.containsKey(EntityDataStrings.DRAW_VOLUMETRIC)
|
||||
){
|
||||
currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW)!=null
|
||||
){
|
||||
//fetch actor
|
||||
Actor currentActor = EntityUtils.getActor(currentEntity);
|
||||
//calculate camera-modified vector3f
|
||||
@ -86,12 +85,11 @@ public class VolumeBufferPipeline implements RenderPipeline {
|
||||
//
|
||||
//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);
|
||||
if(
|
||||
(boolean)currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW) &&
|
||||
!currentEntity.containsKey(EntityDataStrings.DRAW_VOLUMETRIC)
|
||||
){
|
||||
(boolean)currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW)
|
||||
){
|
||||
//fetch actor
|
||||
Actor currentActor = EntityUtils.getActor(currentEntity);
|
||||
//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
|
||||
//
|
||||
for(Entity currentEntity : Globals.clientScene.getEntitiesWithTag(EntityTags.DRAWABLE)){
|
||||
for(Entity currentEntity : Globals.clientScene.getEntitiesWithTag(EntityTags.DRAW_VOLUMETIC_DEPTH_PASS)){
|
||||
Vector3d position = EntityUtils.getPosition(currentEntity);
|
||||
if(
|
||||
(boolean)currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW) &&
|
||||
currentEntity.containsKey(EntityDataStrings.DRAW_VOLUMETRIC)
|
||||
){
|
||||
(boolean)currentEntity.getData(EntityDataStrings.DATA_STRING_DRAW)
|
||||
){
|
||||
//fetch actor
|
||||
Actor currentActor = EntityUtils.getActor(currentEntity);
|
||||
//calculate camera-modified vector3f
|
||||
|
||||
Loading…
Reference in New Issue
Block a user