Skip to content

GLFrameBuffer & GLTexture#1034

Open
RuffledPlume wants to merge 2 commits into117HD:masterfrom
RuffledPlume:FrameBuffer+Texture+2
Open

GLFrameBuffer & GLTexture#1034
RuffledPlume wants to merge 2 commits into117HD:masterfrom
RuffledPlume:FrameBuffer+Texture+2

Conversation

@RuffledPlume
Copy link
Copy Markdown
Contributor

Aims to reduce boilerplate and simplify the process of working with glFrameBuffer & glTexture.

Example declarations:

sceneFBO = new GLFrameBuffer(new GLFrameBufferDesc()
					.setWidth(canvas.getWidth())
					.setHeight(canvas.getHeight())
					.setMSAASamples(msaaSamples)
					.setColorAttachment(GLAttachmentSlot.COLOR0, backbufferFormat, GLTextureParams.DEFAULT())
					.setDepthAttachment(GLTextureFormat.DEPTH32F, GLTextureParams.DEFAULT()));
shadowMapFBO = new GLFrameBuffer(
					new GLFrameBufferDesc()
						.setWidth(shadowFBOSize)
						.setHeight(shadowFBOSize)
						.setDepthAttachment(GLTextureFormat.DEPTH32F,
							new GLTextureParams()
								.setSampler(GLSamplerMode.NEAREST_CLAMP)
								.setTextureUnit(TEXTURE_UNIT_SHADOW_MAP)
								.setBorderColor(new float[] { 1.0f, 1.0f, 1.0f, 1.0f})));
tileHeightMapTex = new GLTexture(EXTENDED_SCENE_SIZE, EXTENDED_SCENE_SIZE, MAX_Z, GLTextureFormat.R16I, new GLTextureParams()
					.setType(GLTextureType.TEXTURE3D)
					.setSampler(GLSamplerMode.NEAREST_CLAMP)
					.setTextureUnit(TEXTURE_UNIT_TILE_HEIGHT_MAP));
int anisotropySamples = config.anisotropicFilteringLevel();
texMaterialTextureArray = new GLTexture(textureSize, textureSize, textureLayers.size(), GLTextureFormat.SRGB8_ALPHA8,
				GLTextureParams.DEFAULT()
					.setType(GLTextureType.TEXTURE2D_ARRAY)
					.setTextureUnit(TEXTURE_UNIT_GAME)
					.setGenerateMipmaps(anisotropySamples > 0)
					.setAnisotropySamples(anisotropySamples)
					.setImmutable(true)
					.setDebugName("Material Textures Array"));

Improved RenderDoc Debugging:
image

image image

@RuffledPlume RuffledPlume force-pushed the FrameBuffer+Texture+2 branch 4 times, most recently from 2797c89 to 616185f Compare March 31, 2026 18:33
@RuffledPlume RuffledPlume force-pushed the FrameBuffer+Texture+2 branch from 391243f to 3d83d34 Compare April 22, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant