Skip to content

Commit

Permalink
Gloom: Cleanup
Browse files Browse the repository at this point in the history
Reorganized/named shaders.
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 61b0da6 commit 264d0a3
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 37 deletions.
6 changes: 3 additions & 3 deletions doomsday/tests/test_gloom/gloom/render/entityrender.cpp
Expand Up @@ -91,16 +91,16 @@ DENG2_PIMPL(EntityRender)
idx++;
}

GloomApp::shaders().build(program, "gloom.entity")
GloomApp::shaders().build(program, "gloom.entity.material")
<< context.view.uMvpMatrix
<< context.view.uWorldToViewRotate
<< context.uAtlas;

GloomApp::shaders().build(dirShadowProgram, "gloom.shadow.entity")
GloomApp::shaders().build(dirShadowProgram, "gloom.entity.shadow.dir")
<< context.uLightMatrix
<< context.uAtlas;

GloomApp::shaders().build(omniShadowProgram, "gloom.shadow_cube.entity")
GloomApp::shaders().build(omniShadowProgram, "gloom.entity.shadow.omni")
<< context.uLightOrigin
<< context.uLightFarPlane
<< context.uLightCubeMatrices
Expand Down
6 changes: 3 additions & 3 deletions doomsday/tests/test_gloom/gloom/render/lightrender.cpp
Expand Up @@ -116,12 +116,12 @@ DENG2_PIMPL(LightRender)

auto &ctx = self().context();

ctx.shaders->build(stencilPassProgram, "gloom.lighting.stencil")
ctx.shaders->build(stencilPassProgram, "gloom.light.stencil")
<< ctx.view.uMvpMatrix
<< ctx.view.uModelViewMatrix
<< ctx.view.uWorldToViewRotate;

ctx.shaders->build(shadingProgram, "gloom.lighting.sources")
ctx.shaders->build(shadingProgram, "gloom.light.sources")
<< ctx.view.uMvpMatrix
<< ctx.view.uModelViewMatrix
<< ctx.view.uWorldToViewRotate
Expand All @@ -139,7 +139,7 @@ DENG2_PIMPL(LightRender)
<< ctx.view.uViewToWorldRotate;

giQuad.glInit(self().context());
ctx.shaders->build(giQuad.program(), "gloom.lighting.global")
ctx.shaders->build(giQuad.program(), "gloom.light.global")
<< ctx.view.uInverseProjMatrix
<< ctx.gbuffer->uGBufferAlbedo()
<< ctx.gbuffer->uGBufferEmissive()
Expand Down
12 changes: 6 additions & 6 deletions doomsday/tests/test_gloom/gloom/render/mapbuild.cpp
Expand Up @@ -163,13 +163,13 @@ DENG2_PIMPL_NOREF(MapBuild)

auto makeQuad = [this, &indices, &verts](const String & frontTextureName,
const String & backTextureName,
const Vec3f &normal,
const Vec3f & normal,
const uint32_t *planeIndex,
uint32_t flags,
const Vec3f &p1,
const Vec3f &p2,
const Vec3f &p3,
const Vec3f &p4,
const Vec3f & p1,
const Vec3f & p2,
const Vec3f & p3,
const Vec3f & p4,
float length,
float rotation) {
const Buffer::Index baseIndex = Buffer::Index(verts.size());
Expand Down Expand Up @@ -220,7 +220,7 @@ DENG2_PIMPL_NOREF(MapBuild)
const int dir = line.sectors[0] == sectorId? 1 : 0;
const ID start = line.points[dir^1];
const ID end = line.points[dir];
const Vec3f normal = worldNormalVector(line);
const Vec3f normal = worldNormalVector(line);
const float length = float((floor[end] - floor[start]).length());
const uint32_t planeIndex[2] = {planeMapper[map.floorPlaneId(sectorId)],
planeMapper[map.ceilingPlaneId(sectorId)]};
Expand Down
6 changes: 3 additions & 3 deletions doomsday/tests/test_gloom/gloom/render/maprender.cpp
Expand Up @@ -122,18 +122,18 @@ DENG2_PIMPL(MapRender)

surfaces.addBuffer(buf);

context.shaders->build(surfaces.program(), "gloom.surface")
context.shaders->build(surfaces.program(), "gloom.surface.material")
<< planes.var
<< uTexelsPerMeter
<< textureMetrics.var
<< texOffsets.var;

context.shaders->build(dirShadowProgram, "gloom.shadow.surface")
context.shaders->build(dirShadowProgram, "gloom.surface.shadow.dir")
<< planes.var
<< context.uLightMatrix
<< context.lights->uLightDir();

context.shaders->build(omniShadowProgram, "gloom.shadow_cube.surface")
context.shaders->build(omniShadowProgram, "gloom.surface.shadow.omni")
<< planes.var
<< context.uLightOrigin
<< context.uLightFarPlane
Expand Down
@@ -1,4 +1,4 @@
shader gloom.entity {
shader gloom.entity.material {
vertex = "
#include 'common/bones.glsl'

Expand Down Expand Up @@ -41,7 +41,7 @@ shader gloom.entity {
}"
}

shader gloom.shadow.entity {
shader gloom.entity.shadow.dir {
vertex = "
#include 'common/bones.glsl'

Expand Down Expand Up @@ -71,7 +71,7 @@ shader gloom.shadow.entity {
}"
}

shader gloom.shadow_cube.entity {
shader gloom.entity.shadow.omni {
vertex = "
#include 'common/bones.glsl'

Expand Down
45 changes: 26 additions & 19 deletions doomsday/tests/test_gloom/net.dengine.gloom.pack/shaders/gloom.dei
@@ -1,38 +1,45 @@
group gloom {
shader sky { path = "sky" }
shader surface { path = "surface" }
shader shadow.surface { path = "shadow" }

shader shadow_cube.surface {
path.vertex = "shadow_cube.vsh"
path.geometry = "common/cube_faces.gsh"
path.fragment = "shadow_cube.fsh"
group surface {
shader material { path = "surface_material" }
shader shadow.dir { path = "surface_shadow_dir" }
shader shadow.omni {
path.vertex = "surface_shadow_omni.vsh"
path.geometry = "common/cube_faces.gsh"
path.fragment = "surface_shadow_omni.fsh"
}
}

group light {
shader global { path = "light_gi" }
shader stencil {
path.vertex = "light_sources.vsh"
fragment = "void main(void) {}"
}
shader sources {
path.vertex = "light_sources.vsh"
path.fragment = "light_sources.fsh"
}
}

group ssao {
shader sample { path = "ssao" }
shader sample {
path.vertex = "ssao.vsh"
path.fragment = "ssao_sample.fsh"
}
shader denoise {
path.vertex = "ssao.vsh"
path.fragment = "ssao_denoise.fsh"
}
}

group lighting {
shader global { path = "gi" }
shader stencil {
path.vertex = "lighting.vsh"
fragment = "void main(void) {}"
}
shader sources { path = "lighting" }
}

group tonemap {
shader exposure {
path.vertex = "common/mvp_vertex_uv.vsh"
path.fragment = "tonemap.fsh"
path.fragment = "tonemap_exposure.fsh"
}
shader sample {
path.vertex = "common/mvp_vertex_uv.vsh"
shader sample inherits exposure {
path.fragment = "tonemap_sample.fsh"
}
}
Expand Down

0 comments on commit 264d0a3

Please sign in to comment.