Skip to content

Commit

Permalink
Renderer: Implement material system
Browse files Browse the repository at this point in the history
Implement material system, set world BSP surfaces to use it. Material system works by generating enough materials (a distinct GL state that has to be set for the whole draw call) for each stage of every drawSurf_t.
All of the per-surface data that was previously set through uniforms for each drawSurf_t is now sourced from a buffer.
The remaining (global) uniforms like u_ViewUp and u_ViewOrigin are still set as usual.
Updates for surfaces whose parameters change with time are done by mapping the corresponding part of the memory and copying all of the data into it, then flushing it all at once.

Implement bindless texture support.
  • Loading branch information
VReaperV committed Jul 26, 2024
1 parent e9ac890 commit 966c415
Show file tree
Hide file tree
Showing 44 changed files with 5,574 additions and 382 deletions.
6 changes: 6 additions & 0 deletions src.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ set(RENDERERLIST
${ENGINE_DIR}/renderer/tr_font.cpp
${ENGINE_DIR}/renderer/InternalImage.cpp
${ENGINE_DIR}/renderer/InternalImage.h
${ENGINE_DIR}/renderer/Material.cpp
${ENGINE_DIR}/renderer/Material.h
${ENGINE_DIR}/renderer/TextureManager.cpp
${ENGINE_DIR}/renderer/TextureManager.h
${ENGINE_DIR}/renderer/tr_image.cpp
${ENGINE_DIR}/renderer/tr_image.h
${ENGINE_DIR}/renderer/tr_image_crn.cpp
Expand Down Expand Up @@ -141,6 +145,8 @@ set(RENDERERLIST
)

set(GLSLSOURCELIST
${ENGINE_DIR}/renderer/glsl_source/material_vp.glsl
${ENGINE_DIR}/renderer/glsl_source/material_fp.glsl
${ENGINE_DIR}/renderer/glsl_source/skybox_vp.glsl
${ENGINE_DIR}/renderer/glsl_source/ssao_fp.glsl
${ENGINE_DIR}/renderer/glsl_source/ssao_vp.glsl
Expand Down
Loading

0 comments on commit 966c415

Please sign in to comment.