Merge branch 'master' of git.austinwhoover.com:studiorailgun/Renderer
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-01-19 16:29:32 -05:00
commit b194cee9ab
18 changed files with 35 additions and 34 deletions

View File

@ -17,7 +17,7 @@ in vec2 TexCoord;
in vec4 FragPosLightSpace; in vec4 FragPosLightSpace;
uniform vec3 viewPos; uniform dvec3 viewPos;
uniform Material material; uniform Material material;
/** /**
@ -30,7 +30,7 @@ void main(){
discard; discard;
} }
vec3 norm = normalize(Normal); vec3 norm = normalize(Normal);
vec3 viewDir = normalize(viewPos - FragPos); vec3 viewDir = normalize(vec3(viewPos) - FragPos);
//grab light intensity //grab light intensity
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm)); vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));

View File

@ -22,7 +22,7 @@ in vec4 FragPosLightSpace;
//view position //view position
uniform vec3 viewPos; uniform dvec3 viewPos;
//material //material
uniform Material material; uniform Material material;
@ -41,7 +41,7 @@ float weightCalcNew(float finalAlpha, float zLoc, float linearizedLoc);
void main(){ void main(){
vec3 norm = normalize(Normal); vec3 norm = normalize(Normal);
vec3 viewDir = normalize(viewPos - FragPos); vec3 viewDir = normalize(vec3(viewPos) - FragPos);
//grab light intensity //grab light intensity
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm)); vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));

View File

@ -18,7 +18,7 @@ in vec2 texPlane3;
in vec4 FragPosLightSpace; in vec4 FragPosLightSpace;
uniform vec3 viewPos; uniform dvec3 viewPos;
uniform Material material; uniform Material material;
@ -29,7 +29,7 @@ vec3 getColor(vec2 texPlane1, vec2 texPlane2, vec2 texPlane3, vec3 normal, Mater
void main(){ void main(){
vec3 norm = normalize(Normal); vec3 norm = normalize(Normal);
vec3 viewDir = normalize(viewPos - FragPos); vec3 viewDir = normalize(vec3(viewPos) - FragPos);
//grab light intensity //grab light intensity
float lightIntensity = calcLightIntensityTotal(norm); float lightIntensity = calcLightIntensityTotal(norm);

View File

@ -19,7 +19,7 @@ in vec3 normalRot1;
in vec3 normalRot2; in vec3 normalRot2;
uniform vec3 viewPos; uniform dvec3 viewPos;
// uniform DirLight dirLight; // uniform DirLight dirLight;
// uniform PointLight pointLights[NR_POINT_LIGHTS]; // uniform PointLight pointLights[NR_POINT_LIGHTS];
// uniform SpotLight spotLight; // uniform SpotLight spotLight;
@ -58,7 +58,7 @@ void main(){
float normalMultiplier = -(1.0 + -2.0 * int(gl_FrontFacing)); float normalMultiplier = -(1.0 + -2.0 * int(gl_FrontFacing));
vec3 norm = normalize(mix(normalRot1,normalRot2,normalMix) * normalMultiplier); vec3 norm = normalize(mix(normalRot1,normalRot2,normalMix) * normalMultiplier);
// vec3 norm = normalize(Normal * normalMultiplier); // vec3 norm = normalize(Normal * normalMultiplier);
vec3 viewDir = normalize(viewPos - FragPos); vec3 viewDir = normalize(vec3(viewPos) - FragPos);
//grab light intensity //grab light intensity
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm)); vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));

View File

@ -31,7 +31,7 @@ uniform mat4 model;
uniform mat4 view; uniform mat4 view;
uniform mat4 projection; uniform mat4 projection;
uniform mat4 lightSpaceMatrix; uniform mat4 lightSpaceMatrix;
uniform vec3 viewPos; uniform dvec3 viewPos;
uniform vec3 modelWorldPos; uniform vec3 modelWorldPos;
uniform float time; uniform float time;
@ -151,7 +151,7 @@ void main() {
//shift in viewspace to make it feel slightly fuller //shift in viewspace to make it feel slightly fuller
// //
//dot view and normal //dot view and normal
vec3 viewDir = normalize(viewPos - FinalVertex.xyz); vec3 viewDir = normalize(vec3(viewPos) - FinalVertex.xyz);
float viewDotNormal = clamp(dot(FinalNormal.xz,viewDir.xz),0,1); float viewDotNormal = clamp(dot(FinalNormal.xz,viewDir.xz),0,1);
//calculate thinkening factor to shift verts slightly based on view angle //calculate thinkening factor to shift verts slightly based on view angle
float viewSpaceThickenFactor = easeOut(1.0 - viewDotNormal); float viewSpaceThickenFactor = easeOut(1.0 - viewDotNormal);

View File

@ -22,7 +22,7 @@ in vec4 FragPosLightSpace;
in vec4 instanceColor; in vec4 instanceColor;
uniform vec3 viewPos; uniform dvec3 viewPos;
uniform Material material; uniform Material material;
uniform mat4 view; uniform mat4 view;
@ -37,7 +37,7 @@ float easeIn(float interpolator);
float easeOut(float interpolator); float easeOut(float interpolator);
void main(){ void main(){
vec3 viewDir = normalize(viewPos - FragPos); vec3 viewDir = normalize(vec3(viewPos) - FragPos);
//grab light intensity //grab light intensity
vec3 lightIntensity = vec3(calcLightIntensityTotal(Normal)); vec3 lightIntensity = vec3(calcLightIntensityTotal(Normal));

View File

@ -10,7 +10,7 @@ Bind points for different SSBOs
A point light A point light
*/ */
struct ParticleData { struct ParticleData {
mat4 model; dmat4 model;
vec4 color; vec4 color;
vec4 texture; vec4 texture;
}; };
@ -48,7 +48,7 @@ out vec4 instanceColor;
void main() { void main() {
ParticleData currentParticle = particleData[gl_InstanceID]; ParticleData currentParticle = particleData[gl_InstanceID];
mat4 model = currentParticle.model; mat4 model = mat4(currentParticle.model);
//normalize posiiton and normal //normalize posiiton and normal
vec4 FinalVertex = vec4(aPos, 1.0); vec4 FinalVertex = vec4(aPos, 1.0);

View File

@ -27,7 +27,7 @@ in vec3 samplerIndexVec; //the indices in the atlas of textures to sample
in vec3 samplerRatioVec; //the vector of HOW MUCH to pull from each texture in the atlas in vec3 samplerRatioVec; //the vector of HOW MUCH to pull from each texture in the atlas
uniform vec3 viewPos; uniform dvec3 viewPos;
// uniform DirLight dirLight; // uniform DirLight dirLight;
// uniform PointLight pointLights[NR_POINT_LIGHTS]; // uniform PointLight pointLights[NR_POINT_LIGHTS];
// uniform SpotLight spotLight; // uniform SpotLight spotLight;
@ -45,7 +45,7 @@ vec3 getColor(vec2 texPlane1, vec2 texPlane2, vec2 texPlane3, vec3 normal, vec3
void main(){ void main(){
vec3 norm = normalize(Normal); vec3 norm = normalize(Normal);
vec3 viewDir = normalize(viewPos - FragPos); vec3 viewDir = normalize(vec3(viewPos) - FragPos);
//grab light intensity //grab light intensity
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm)); vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));

View File

@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file #maven.buildNumber.plugin properties file
#Fri Dec 06 21:26:11 EST 2024 #Tue Dec 24 16:29:47 EST 2024
buildNumber=600 buildNumber=603

View File

@ -8,9 +8,9 @@
extern "C" { extern "C" {
#endif #endif
#undef electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_SIMULATE_TIMESTEP #undef electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_SIMULATE_TIMESTEP
#define electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_SIMULATE_TIMESTEP 0.01f #define electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_SIMULATE_TIMESTEP 0.1f
#undef electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_GRAVITY_CONST #undef electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_GRAVITY_CONST
#define electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_GRAVITY_CONST -1000.0f #define electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_GRAVITY_CONST -100.0f
/* /*
* Class: electrosphere_server_fluid_simulator_FluidAcceleratedSimulator * Class: electrosphere_server_fluid_simulator_FluidAcceleratedSimulator
* Method: init * Method: init

View File

@ -96,7 +96,7 @@ public class ParticleService extends SignalServiceImpl {
boolean rVal = false; boolean rVal = false;
switch(signal.getType()){ switch(signal.getType()){
case RENDERING_ENGINE_READY: { case RENDERING_ENGINE_READY: {
modelAttrib = new ShaderAttribute("model", HomogenousBufferTypes.MAT4F); modelAttrib = new ShaderAttribute("model", HomogenousBufferTypes.MAT4D);
colorAttrib = new ShaderAttribute("color", HomogenousBufferTypes.VEC4F); colorAttrib = new ShaderAttribute("color", HomogenousBufferTypes.VEC4F);
textureAttrib = new ShaderAttribute("texture", HomogenousBufferTypes.VEC4F); textureAttrib = new ShaderAttribute("texture", HomogenousBufferTypes.VEC4F);
List<ShaderAttribute> types = Arrays.asList(new ShaderAttribute[]{ List<ShaderAttribute> types = Arrays.asList(new ShaderAttribute[]{

View File

@ -170,7 +170,7 @@ public class Globals {
public static boolean RUN_DEMO = false; public static boolean RUN_DEMO = false;
public static boolean RUN_CLIENT = true; public static boolean RUN_CLIENT = true;
public static boolean RUN_HIDDEN = false; //glfw session will be created with hidden window public static boolean RUN_HIDDEN = false; //glfw session will be created with hidden window
public static boolean RUN_AUDIO = true; public static boolean RUN_AUDIO = false;
public static boolean RUN_SCRIPTS = true; public static boolean RUN_SCRIPTS = true;
public static boolean RUN_PHYSICS = true; //toggles whether physics is run or not public static boolean RUN_PHYSICS = true; //toggles whether physics is run or not
public static int clientCharacterID; public static int clientCharacterID;

View File

@ -41,7 +41,8 @@ public class UserSettings {
*/ */
boolean graphicsPerformanceEnableFoliageManager; boolean graphicsPerformanceEnableFoliageManager;
//resolution //resolution to render at
//this will be scaled to displayWidth/displayHeight after rendering
int renderResolutionX; int renderResolutionX;
int renderResolutionY; int renderResolutionY;
//debug //debug

View File

@ -314,12 +314,12 @@ public class RenderingEngine {
defaultFramebuffer = new Framebuffer(GL_DEFAULT_FRAMEBUFFER); defaultFramebuffer = new Framebuffer(GL_DEFAULT_FRAMEBUFFER);
//generate framebuffers //generate framebuffers
Texture screenTextureColor = FramebufferUtils.generateScreenTextureColorAlpha(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT); Texture screenTextureColor = FramebufferUtils.generateScreenTextureColorAlpha(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
RenderingEngine.screenTextureColor = screenTextureColor; RenderingEngine.screenTextureColor = screenTextureColor;
Texture screenTextureDepth = FramebufferUtils.generateScreenTextureDepth(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT); Texture screenTextureDepth = FramebufferUtils.generateScreenTextureDepth(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
RenderingEngine.screenTextureDepth = screenTextureDepth; RenderingEngine.screenTextureDepth = screenTextureDepth;
try { try {
Framebuffer screenFramebuffer = FramebufferUtils.generateScreenTextureFramebuffer(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT, screenTextureColor, screenTextureDepth); Framebuffer screenFramebuffer = FramebufferUtils.generateScreenTextureFramebuffer(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY(), screenTextureColor, screenTextureDepth);
RenderingEngine.screenFramebuffer = screenFramebuffer; RenderingEngine.screenFramebuffer = screenFramebuffer;
} catch (Exception e){ } catch (Exception e){
LoggerInterface.loggerRenderer.ERROR(e); LoggerInterface.loggerRenderer.ERROR(e);

View File

@ -97,7 +97,7 @@ public class HomogenousInstanceData implements InstanceData {
attributeCpuBufferMap.put(shaderAttribute, BufferUtils.createFloatBuffer(capacity * 4 * 4)); attributeCpuBufferMap.put(shaderAttribute, BufferUtils.createFloatBuffer(capacity * 4 * 4));
} break; } break;
case MAT4D: { case MAT4D: {
attributeCpuBufferMap.put(shaderAttribute, BufferUtils.createFloatBuffer(capacity * 4 * 4)); attributeCpuBufferMap.put(shaderAttribute, BufferUtils.createFloatBuffer(capacity * 4 * 8));
} break; } break;
} }
if(shaderAttribute.isSingleIndex()){ if(shaderAttribute.isSingleIndex()){

View File

@ -120,7 +120,7 @@ public class HomogenousInstancedArray {
return capacity * 4 * 4 * 4; return capacity * 4 * 4 * 4;
} }
case MAT4D: { case MAT4D: {
return capacity * 4 * 4 * 4; return capacity * 4 * 4 * 8;
} }
} }
return 0; return 0;

View File

@ -113,7 +113,7 @@ public class HomogenousUniformBuffer {
return capacity * 4 * 4 * 4; return capacity * 4 * 4 * 4;
} }
case MAT4D: { case MAT4D: {
return capacity * 4 * 4 * 4; return capacity * 4 * 4 * 8;
} }
} }
return 0; return 0;
@ -150,7 +150,7 @@ public class HomogenousUniformBuffer {
return 4 * 4 * 4; return 4 * 4 * 4;
} }
case MAT4D: { case MAT4D: {
return 4 * 4 * 4; return 4 * 4 * 8;
} }
} }
return 0; return 0;

View File

@ -37,10 +37,10 @@ public class PostProcessingPipeline implements RenderPipeline {
*/ */
public void init(OpenGLState openGLState){ public void init(OpenGLState openGLState){
postProcessingShader = VisualShader.loadSpecificShader("Shaders/core/postprocessing/postprocessing.vs", "Shaders/core/postprocessing/postprocessing.fs"); postProcessingShader = VisualShader.loadSpecificShader("Shaders/core/postprocessing/postprocessing.vs", "Shaders/core/postprocessing/postprocessing.fs");
Texture screenTextureColor = FramebufferUtils.generateScreenTextureColorAlpha(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT); Texture screenTextureColor = FramebufferUtils.generateScreenTextureColorAlpha(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
Texture screenTextureDepth = FramebufferUtils.generateScreenTextureDepth(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT); Texture screenTextureDepth = FramebufferUtils.generateScreenTextureDepth(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
try { try {
postProcessBuffer = FramebufferUtils.generateScreenTextureFramebuffer(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT, screenTextureColor, screenTextureDepth); postProcessBuffer = FramebufferUtils.generateScreenTextureFramebuffer(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY(), screenTextureColor, screenTextureDepth);
} catch (Exception e){ } catch (Exception e){
LoggerInterface.loggerRenderer.ERROR(e); LoggerInterface.loggerRenderer.ERROR(e);
} }
@ -54,7 +54,7 @@ public class PostProcessingPipeline implements RenderPipeline {
// //
openGLState.glDepthTest(false); openGLState.glDepthTest(false);
openGLState.glBlend(false); openGLState.glBlend(false);
openGLState.glViewport(Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT); openGLState.glViewport(Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
postProcessBuffer.bind(openGLState); postProcessBuffer.bind(openGLState);