Merge branch 'master' of git.austinwhoover.com:studiorailgun/Renderer
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:
commit
b194cee9ab
@ -17,7 +17,7 @@ in vec2 TexCoord;
|
||||
in vec4 FragPosLightSpace;
|
||||
|
||||
|
||||
uniform vec3 viewPos;
|
||||
uniform dvec3 viewPos;
|
||||
uniform Material material;
|
||||
|
||||
/**
|
||||
@ -30,7 +30,7 @@ void main(){
|
||||
discard;
|
||||
}
|
||||
vec3 norm = normalize(Normal);
|
||||
vec3 viewDir = normalize(viewPos - FragPos);
|
||||
vec3 viewDir = normalize(vec3(viewPos) - FragPos);
|
||||
|
||||
//grab light intensity
|
||||
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
|
||||
|
||||
@ -22,7 +22,7 @@ in vec4 FragPosLightSpace;
|
||||
|
||||
|
||||
//view position
|
||||
uniform vec3 viewPos;
|
||||
uniform dvec3 viewPos;
|
||||
|
||||
//material
|
||||
uniform Material material;
|
||||
@ -41,7 +41,7 @@ float weightCalcNew(float finalAlpha, float zLoc, float linearizedLoc);
|
||||
void main(){
|
||||
|
||||
vec3 norm = normalize(Normal);
|
||||
vec3 viewDir = normalize(viewPos - FragPos);
|
||||
vec3 viewDir = normalize(vec3(viewPos) - FragPos);
|
||||
|
||||
//grab light intensity
|
||||
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
|
||||
|
||||
@ -18,7 +18,7 @@ in vec2 texPlane3;
|
||||
in vec4 FragPosLightSpace;
|
||||
|
||||
|
||||
uniform vec3 viewPos;
|
||||
uniform dvec3 viewPos;
|
||||
uniform Material material;
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ vec3 getColor(vec2 texPlane1, vec2 texPlane2, vec2 texPlane3, vec3 normal, Mater
|
||||
|
||||
void main(){
|
||||
vec3 norm = normalize(Normal);
|
||||
vec3 viewDir = normalize(viewPos - FragPos);
|
||||
vec3 viewDir = normalize(vec3(viewPos) - FragPos);
|
||||
|
||||
//grab light intensity
|
||||
float lightIntensity = calcLightIntensityTotal(norm);
|
||||
|
||||
@ -19,7 +19,7 @@ in vec3 normalRot1;
|
||||
in vec3 normalRot2;
|
||||
|
||||
|
||||
uniform vec3 viewPos;
|
||||
uniform dvec3 viewPos;
|
||||
// uniform DirLight dirLight;
|
||||
// uniform PointLight pointLights[NR_POINT_LIGHTS];
|
||||
// uniform SpotLight spotLight;
|
||||
@ -58,7 +58,7 @@ void main(){
|
||||
float normalMultiplier = -(1.0 + -2.0 * int(gl_FrontFacing));
|
||||
vec3 norm = normalize(mix(normalRot1,normalRot2,normalMix) * normalMultiplier);
|
||||
// vec3 norm = normalize(Normal * normalMultiplier);
|
||||
vec3 viewDir = normalize(viewPos - FragPos);
|
||||
vec3 viewDir = normalize(vec3(viewPos) - FragPos);
|
||||
|
||||
//grab light intensity
|
||||
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
|
||||
|
||||
@ -31,7 +31,7 @@ uniform mat4 model;
|
||||
uniform mat4 view;
|
||||
uniform mat4 projection;
|
||||
uniform mat4 lightSpaceMatrix;
|
||||
uniform vec3 viewPos;
|
||||
uniform dvec3 viewPos;
|
||||
uniform vec3 modelWorldPos;
|
||||
uniform float time;
|
||||
|
||||
@ -151,7 +151,7 @@ void main() {
|
||||
//shift in viewspace to make it feel slightly fuller
|
||||
//
|
||||
//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);
|
||||
//calculate thinkening factor to shift verts slightly based on view angle
|
||||
float viewSpaceThickenFactor = easeOut(1.0 - viewDotNormal);
|
||||
|
||||
@ -22,7 +22,7 @@ in vec4 FragPosLightSpace;
|
||||
in vec4 instanceColor;
|
||||
|
||||
|
||||
uniform vec3 viewPos;
|
||||
uniform dvec3 viewPos;
|
||||
uniform Material material;
|
||||
uniform mat4 view;
|
||||
|
||||
@ -37,7 +37,7 @@ float easeIn(float interpolator);
|
||||
float easeOut(float interpolator);
|
||||
|
||||
void main(){
|
||||
vec3 viewDir = normalize(viewPos - FragPos);
|
||||
vec3 viewDir = normalize(vec3(viewPos) - FragPos);
|
||||
|
||||
//grab light intensity
|
||||
vec3 lightIntensity = vec3(calcLightIntensityTotal(Normal));
|
||||
|
||||
@ -10,7 +10,7 @@ Bind points for different SSBOs
|
||||
A point light
|
||||
*/
|
||||
struct ParticleData {
|
||||
mat4 model;
|
||||
dmat4 model;
|
||||
vec4 color;
|
||||
vec4 texture;
|
||||
};
|
||||
@ -48,7 +48,7 @@ out vec4 instanceColor;
|
||||
void main() {
|
||||
ParticleData currentParticle = particleData[gl_InstanceID];
|
||||
|
||||
mat4 model = currentParticle.model;
|
||||
mat4 model = mat4(currentParticle.model);
|
||||
|
||||
//normalize posiiton and normal
|
||||
vec4 FinalVertex = vec4(aPos, 1.0);
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
uniform vec3 viewPos;
|
||||
uniform dvec3 viewPos;
|
||||
// uniform DirLight dirLight;
|
||||
// uniform PointLight pointLights[NR_POINT_LIGHTS];
|
||||
// uniform SpotLight spotLight;
|
||||
@ -45,7 +45,7 @@ vec3 getColor(vec2 texPlane1, vec2 texPlane2, vec2 texPlane3, vec3 normal, vec3
|
||||
|
||||
void main(){
|
||||
vec3 norm = normalize(Normal);
|
||||
vec3 viewDir = normalize(viewPos - FragPos);
|
||||
vec3 viewDir = normalize(vec3(viewPos) - FragPos);
|
||||
|
||||
//grab light intensity
|
||||
vec3 lightIntensity = vec3(calcLightIntensityTotal(norm));
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
#maven.buildNumber.plugin properties file
|
||||
#Fri Dec 06 21:26:11 EST 2024
|
||||
buildNumber=600
|
||||
#Tue Dec 24 16:29:47 EST 2024
|
||||
buildNumber=603
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
#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
|
||||
#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
|
||||
* Method: init
|
||||
|
||||
@ -96,7 +96,7 @@ public class ParticleService extends SignalServiceImpl {
|
||||
boolean rVal = false;
|
||||
switch(signal.getType()){
|
||||
case RENDERING_ENGINE_READY: {
|
||||
modelAttrib = new ShaderAttribute("model", HomogenousBufferTypes.MAT4F);
|
||||
modelAttrib = new ShaderAttribute("model", HomogenousBufferTypes.MAT4D);
|
||||
colorAttrib = new ShaderAttribute("color", HomogenousBufferTypes.VEC4F);
|
||||
textureAttrib = new ShaderAttribute("texture", HomogenousBufferTypes.VEC4F);
|
||||
List<ShaderAttribute> types = Arrays.asList(new ShaderAttribute[]{
|
||||
|
||||
@ -170,7 +170,7 @@ public class Globals {
|
||||
public static boolean RUN_DEMO = false;
|
||||
public static boolean RUN_CLIENT = true;
|
||||
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_PHYSICS = true; //toggles whether physics is run or not
|
||||
public static int clientCharacterID;
|
||||
|
||||
@ -41,7 +41,8 @@ public class UserSettings {
|
||||
*/
|
||||
boolean graphicsPerformanceEnableFoliageManager;
|
||||
|
||||
//resolution
|
||||
//resolution to render at
|
||||
//this will be scaled to displayWidth/displayHeight after rendering
|
||||
int renderResolutionX;
|
||||
int renderResolutionY;
|
||||
//debug
|
||||
|
||||
@ -314,12 +314,12 @@ public class RenderingEngine {
|
||||
defaultFramebuffer = new Framebuffer(GL_DEFAULT_FRAMEBUFFER);
|
||||
|
||||
//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;
|
||||
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;
|
||||
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;
|
||||
} catch (Exception e){
|
||||
LoggerInterface.loggerRenderer.ERROR(e);
|
||||
|
||||
@ -97,7 +97,7 @@ public class HomogenousInstanceData implements InstanceData {
|
||||
attributeCpuBufferMap.put(shaderAttribute, BufferUtils.createFloatBuffer(capacity * 4 * 4));
|
||||
} break;
|
||||
case MAT4D: {
|
||||
attributeCpuBufferMap.put(shaderAttribute, BufferUtils.createFloatBuffer(capacity * 4 * 4));
|
||||
attributeCpuBufferMap.put(shaderAttribute, BufferUtils.createFloatBuffer(capacity * 4 * 8));
|
||||
} break;
|
||||
}
|
||||
if(shaderAttribute.isSingleIndex()){
|
||||
|
||||
@ -120,7 +120,7 @@ public class HomogenousInstancedArray {
|
||||
return capacity * 4 * 4 * 4;
|
||||
}
|
||||
case MAT4D: {
|
||||
return capacity * 4 * 4 * 4;
|
||||
return capacity * 4 * 4 * 8;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -113,7 +113,7 @@ public class HomogenousUniformBuffer {
|
||||
return capacity * 4 * 4 * 4;
|
||||
}
|
||||
case MAT4D: {
|
||||
return capacity * 4 * 4 * 4;
|
||||
return capacity * 4 * 4 * 8;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -150,7 +150,7 @@ public class HomogenousUniformBuffer {
|
||||
return 4 * 4 * 4;
|
||||
}
|
||||
case MAT4D: {
|
||||
return 4 * 4 * 4;
|
||||
return 4 * 4 * 8;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -37,10 +37,10 @@ public class PostProcessingPipeline implements RenderPipeline {
|
||||
*/
|
||||
public void init(OpenGLState openGLState){
|
||||
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 screenTextureDepth = FramebufferUtils.generateScreenTextureDepth(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT);
|
||||
Texture screenTextureColor = FramebufferUtils.generateScreenTextureColorAlpha(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
|
||||
Texture screenTextureDepth = FramebufferUtils.generateScreenTextureDepth(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
|
||||
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){
|
||||
LoggerInterface.loggerRenderer.ERROR(e);
|
||||
}
|
||||
@ -54,7 +54,7 @@ public class PostProcessingPipeline implements RenderPipeline {
|
||||
//
|
||||
openGLState.glDepthTest(false);
|
||||
openGLState.glBlend(false);
|
||||
openGLState.glViewport(Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT);
|
||||
openGLState.glViewport(Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
|
||||
|
||||
|
||||
postProcessBuffer.bind(openGLState);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user