renderer code cleanup
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
ac6bddea1f
commit
105a71de24
@ -1893,6 +1893,9 @@ Texture class cleanup work
|
||||
OS data wrapper
|
||||
Renderer code cleanup
|
||||
|
||||
(05/19/2025)
|
||||
Renderer code cleanup
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -47,83 +47,83 @@ public class Actor {
|
||||
/**
|
||||
* the model path of the model backing the actor
|
||||
*/
|
||||
String modelPath;
|
||||
private String modelPath;
|
||||
|
||||
/**
|
||||
* used for statically binding textures in pipelines that dont bind textures on a per-mesh level
|
||||
* ie when in the ui, this can be set to bind a texture at the actor level
|
||||
*/
|
||||
String textureOverride;
|
||||
private String textureOverride;
|
||||
|
||||
/**
|
||||
* scales the time that animations are played at
|
||||
*/
|
||||
float animationScalar = 1.0f;
|
||||
private float animationScalar = 1.0f;
|
||||
|
||||
/**
|
||||
* The stack of animations being applied to a given actor
|
||||
*/
|
||||
Set<ActorAnimationMask> animationQueue = new TreeSet<ActorAnimationMask>();
|
||||
private Set<ActorAnimationMask> animationQueue = new TreeSet<ActorAnimationMask>();
|
||||
|
||||
/**
|
||||
* Mask for overwriting meshes in a given actor
|
||||
*/
|
||||
ActorMeshMask meshMask = new ActorMeshMask();
|
||||
private ActorMeshMask meshMask = new ActorMeshMask();
|
||||
|
||||
/**
|
||||
* optional overrides for specific shaders
|
||||
*/
|
||||
List<ActorShaderMask> shaderMasks = new LinkedList<ActorShaderMask>();
|
||||
private List<ActorShaderMask> shaderMasks = new LinkedList<ActorShaderMask>();
|
||||
|
||||
/**
|
||||
* optional overrides for textures
|
||||
*/
|
||||
Map<String,ActorTextureMask> textureMap = null;
|
||||
private Map<String,ActorTextureMask> textureMap = null;
|
||||
|
||||
/**
|
||||
* bone rotators
|
||||
*/
|
||||
Map<String,ActorBoneRotator> boneRotators = new HashMap<String,ActorBoneRotator>();
|
||||
private Map<String,ActorBoneRotator> boneRotators = new HashMap<String,ActorBoneRotator>();
|
||||
|
||||
/**
|
||||
* static morph for this specific actor
|
||||
*/
|
||||
ActorStaticMorph staticMorph;
|
||||
private ActorStaticMorph staticMorph;
|
||||
|
||||
/**
|
||||
* The list of bone groups
|
||||
*/
|
||||
List<BoneGroup> boneGroups;
|
||||
private List<BoneGroup> boneGroups;
|
||||
|
||||
/**
|
||||
* A map of mesh -> uniforms to apply to the mesh
|
||||
*/
|
||||
ActorUniformMap uniformMap = new ActorUniformMap();
|
||||
private ActorUniformMap uniformMap = new ActorUniformMap();
|
||||
|
||||
/**
|
||||
* Controls whether the actor should obey frustum culling
|
||||
*/
|
||||
boolean frustumCull = true;
|
||||
private boolean frustumCull = true;
|
||||
|
||||
/**
|
||||
* Used for caching animation masks that should be removed
|
||||
*/
|
||||
List<ActorAnimationMask> toRemoveMasks = new LinkedList<ActorAnimationMask>();
|
||||
private List<ActorAnimationMask> toRemoveMasks = new LinkedList<ActorAnimationMask>();
|
||||
|
||||
/**
|
||||
* Stores the positions of bones as they are updated
|
||||
*/
|
||||
Map<String,Vector3d> bonePositionMap = new HashMap<String,Vector3d>();
|
||||
private Map<String,Vector3d> bonePositionMap = new HashMap<String,Vector3d>();
|
||||
|
||||
/**
|
||||
* Stores the rotations of bones as they are updated
|
||||
*/
|
||||
Map<String,Quaterniond> boneRotationMap = new HashMap<String,Quaterniond>();
|
||||
private Map<String,Quaterniond> boneRotationMap = new HashMap<String,Quaterniond>();
|
||||
|
||||
/**
|
||||
* Sets scaling applied at the actor level
|
||||
*/
|
||||
float scale = 1.0f;
|
||||
private float scale = 1.0f;
|
||||
|
||||
/**
|
||||
* Creates an achor
|
||||
|
||||
@ -12,25 +12,39 @@ import org.lwjgl.assimp.AIBone;
|
||||
*/
|
||||
public class Bone {
|
||||
|
||||
//the name of the bone
|
||||
/**
|
||||
* the name of the bone
|
||||
*/
|
||||
public String boneID;
|
||||
|
||||
//the number of vertices affected by this bone
|
||||
int numWeights;
|
||||
/**
|
||||
* the number of vertices affected by this bone
|
||||
*/
|
||||
private int numWeights;
|
||||
|
||||
//The map of index of vertex to weight of this bone on that vertex
|
||||
Map<Integer,Float> weights = new HashMap<Integer,Float>();
|
||||
/**
|
||||
* The map of index of vertex to weight of this bone on that vertex
|
||||
*/
|
||||
private Map<Integer,Float> weights = new HashMap<Integer,Float>();
|
||||
|
||||
//the mOffsetMatrix -- transforms from mesh space to bone space in bind pose
|
||||
/**
|
||||
* the mOffsetMatrix -- transforms from mesh space to bone space in bind pose
|
||||
*/
|
||||
private Matrix4d mOffsetMatrix;
|
||||
|
||||
//the current deform value of the bone
|
||||
/**
|
||||
* the current deform value of the bone
|
||||
*/
|
||||
private Matrix4d deform;
|
||||
|
||||
//the final transform that is used for drawing, data, etc
|
||||
/**
|
||||
* the final transform that is used for drawing, data, etc
|
||||
*/
|
||||
private Matrix4d finalTransform;
|
||||
|
||||
//the raw data for the bone
|
||||
/**
|
||||
* the raw data for the bone
|
||||
*/
|
||||
public AIBone raw_data;
|
||||
|
||||
/**
|
||||
@ -86,19 +100,43 @@ public class Bone {
|
||||
this.mOffsetMatrix = new Matrix4d(mOffset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the deform matrix of the bone
|
||||
* @return The deform matrix
|
||||
*/
|
||||
public Matrix4d getDeform(){
|
||||
return new Matrix4d(deform);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the deform matrix of the bone
|
||||
* @param deform The deform matrix
|
||||
*/
|
||||
public void setDeform(Matrix4d deform){
|
||||
this.deform = new Matrix4d(deform);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the final transform of the bone
|
||||
* @return The final transform
|
||||
*/
|
||||
public Matrix4d getFinalTransform(){
|
||||
return new Matrix4d(finalTransform);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the final transform of the bone
|
||||
* @param finalTransform The final transform
|
||||
*/
|
||||
public void setFinalTransform(Matrix4d finalTransform){
|
||||
this.finalTransform = new Matrix4d(finalTransform);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of weights
|
||||
* @return The number of weights
|
||||
*/
|
||||
public int getNumWeights(){
|
||||
return numWeights;
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,12 +24,16 @@ public class ComputeShader implements Shader {
|
||||
/**
|
||||
* The id for the shader
|
||||
*/
|
||||
int programId;
|
||||
private int programId;
|
||||
|
||||
//Uniforms
|
||||
/**
|
||||
* Map of uniform index -> uniform value
|
||||
*/
|
||||
public Map<Integer,Object> uniformMap = new HashMap<Integer,Object>();
|
||||
|
||||
//keeps track of programs that have already been compiled and returns them instead of recompiling from scratch
|
||||
/**
|
||||
* keeps track of programs that have already been compiled and returns them instead of recompiling from scratch
|
||||
*/
|
||||
static Map<String,VisualShader> alreadyCompiledMap = new HashMap<String,VisualShader>();
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user