Skip to content

Commit f960177

Browse files
committed
Renderer: Implement material system
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.
1 parent e9ac890 commit f960177

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+5574
-382
lines changed

src.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ set(RENDERERLIST
102102
${ENGINE_DIR}/renderer/tr_font.cpp
103103
${ENGINE_DIR}/renderer/InternalImage.cpp
104104
${ENGINE_DIR}/renderer/InternalImage.h
105+
${ENGINE_DIR}/renderer/Material.cpp
106+
${ENGINE_DIR}/renderer/Material.h
107+
${ENGINE_DIR}/renderer/TextureManager.cpp
108+
${ENGINE_DIR}/renderer/TextureManager.h
105109
${ENGINE_DIR}/renderer/tr_image.cpp
106110
${ENGINE_DIR}/renderer/tr_image.h
107111
${ENGINE_DIR}/renderer/tr_image_crn.cpp
@@ -141,6 +145,8 @@ set(RENDERERLIST
141145
)
142146

143147
set(GLSLSOURCELIST
148+
${ENGINE_DIR}/renderer/glsl_source/material_vp.glsl
149+
${ENGINE_DIR}/renderer/glsl_source/material_fp.glsl
144150
${ENGINE_DIR}/renderer/glsl_source/skybox_vp.glsl
145151
${ENGINE_DIR}/renderer/glsl_source/ssao_fp.glsl
146152
${ENGINE_DIR}/renderer/glsl_source/ssao_vp.glsl

0 commit comments

Comments
 (0)