fully remove framebuffer linearized test
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
2a35bfeb6c
commit
058960727f
@ -329,8 +329,6 @@ public class RenderingEngine {
|
|||||||
//default framebuffer
|
//default framebuffer
|
||||||
defaultFramebuffer = new Framebuffer(GL_DEFAULT_FRAMEBUFFER);
|
defaultFramebuffer = new Framebuffer(GL_DEFAULT_FRAMEBUFFER);
|
||||||
|
|
||||||
// FramebufferUtils.framebufferUtilsTest();
|
|
||||||
|
|
||||||
//generate framebuffers
|
//generate framebuffers
|
||||||
screenTextureColor = FramebufferUtils.generateScreenTextureColorAlpha(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT);
|
screenTextureColor = FramebufferUtils.generateScreenTextureColorAlpha(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT);
|
||||||
screenTextureDepth = FramebufferUtils.generateScreenTextureDepth(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT);
|
screenTextureDepth = FramebufferUtils.generateScreenTextureDepth(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT);
|
||||||
|
|||||||
@ -43,53 +43,6 @@ import static org.lwjgl.opengl.GL45.glNamedFramebufferReadBuffer;
|
|||||||
*/
|
*/
|
||||||
public class FramebufferUtils {
|
public class FramebufferUtils {
|
||||||
|
|
||||||
public static void framebufferUtilsTest(){
|
|
||||||
OpenGLState openGLState = Globals.renderingEngine.getOpenGLState();
|
|
||||||
int width = Globals.WINDOW_WIDTH;
|
|
||||||
int height = Globals.WINDOW_HEIGHT;
|
|
||||||
|
|
||||||
//
|
|
||||||
//Texture 1
|
|
||||||
//
|
|
||||||
Texture screenTextureColor = new Texture();
|
|
||||||
screenTextureColor.glTexImage2D(openGLState, width, height, GL_RGBA, GL_UNSIGNED_BYTE);
|
|
||||||
screenTextureColor.setMinFilter(openGLState, GL_LINEAR);
|
|
||||||
screenTextureColor.setMagFilter(openGLState, GL_LINEAR);
|
|
||||||
//these make sure the texture actually clamps to the borders of the quad
|
|
||||||
screenTextureColor.setWrap(openGLState, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
|
||||||
screenTextureColor.setWrap(openGLState, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
|
||||||
|
|
||||||
//guarantees that the texture object has actually been created (calling gen buffers does not guarantee object creation)
|
|
||||||
screenTextureColor.bind(openGLState);
|
|
||||||
openGLState.glBindTexture(GL40.GL_TEXTURE_2D, Texture.DEFAULT_TEXTURE);
|
|
||||||
|
|
||||||
screenTextureColor.checkStatus(openGLState);
|
|
||||||
|
|
||||||
//
|
|
||||||
//Texture 2
|
|
||||||
//
|
|
||||||
Texture screenTextureDepth = new Texture();
|
|
||||||
screenTextureDepth.glTexImage2D(openGLState, width, height, GL_DEPTH_COMPONENT, GL_FLOAT);
|
|
||||||
|
|
||||||
//guarantees that the texture object has actually been created (calling gen buffers does not guarantee object creation)
|
|
||||||
screenTextureDepth.bind(openGLState);
|
|
||||||
openGLState.glBindTexture(GL40.GL_TEXTURE_2D, Texture.DEFAULT_TEXTURE);
|
|
||||||
|
|
||||||
screenTextureDepth.checkStatus(openGLState);
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
//Franebuffer
|
|
||||||
//
|
|
||||||
Framebuffer screenFramebuffer = new Framebuffer();
|
|
||||||
//bind texture to fbo
|
|
||||||
screenFramebuffer.setMipMapLevel(0);
|
|
||||||
screenFramebuffer.attachTexture(openGLState,screenTextureColor);
|
|
||||||
screenFramebuffer.setDepthAttachment(openGLState,screenTextureDepth);
|
|
||||||
//check make sure compiled
|
|
||||||
screenFramebuffer.checkStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Texture generateScreenTextureColor(OpenGLState openGLState, int width, int height){
|
public static Texture generateScreenTextureColor(OpenGLState openGLState, int width, int height){
|
||||||
Texture texture = new Texture();
|
Texture texture = new Texture();
|
||||||
texture.glTexImage2D(openGLState, width, height, GL_RGB, GL_UNSIGNED_BYTE);
|
texture.glTexImage2D(openGLState, width, height, GL_RGB, GL_UNSIGNED_BYTE);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user