View Issue Details

IDProjectCategoryView StatusLast Update
0006090The Dark ModGraphicspublic17.09.2022 18:31
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilityN/A
Status assignedResolutionopen 
Product VersionTDM 2.11 
Target VersionTDM 2.11 
Summary0006090: Restore ambientCubicMap
DescriptionIt was broken by 0005828
TagsNo tags attached.

Relationships

related to 0005828 assignedstgatilov Try to reduce duplication among shader code. 

Activities

stgatilov

stgatilov

03.09.2022 08:26

administrator   ~0015221

Committed a lot of changes in svn rev 10106:
1) Now we support image programs for cubemaps (separate set of commands).
  See R_LoadImageProgramCubeMap, R_ParsePastImageProgramCubeMap, R_ParseImageProgramCubeMap_r in renderer/Image_program.cpp.
2) It is now possible to set layout of single cubemap image, instead of setting it for the whole cubemap-image program.
  Looks like this: cubeMap bakeAmbientDiffuse(cameraLayout(env/lights/cubesky))
3) Restored shader code which fetches diffuse/specular term from two separate cubemaps in case of ambient light.
4) Restored passing cubemaps on C++ side via separate uniforms (new backend only, not finished).
5) Added _whiteCubeMap global image.
6) makeIrradiance cubemap function renamed to bakeAmbientDiffuse/bakeAmbientSpecular, code moved to renderer/Image_program.cpp.
7) Completely reimplemented bakeAmbientXXX using integration over spherical coordinates, simplified CPU cubemap sampler.

My TODO list here:
1) Add CPU-side sampler to imageBlock_t and move cubemap sampling there.
2) Decide what's the right place to store ambient-diffuse and ambient-specular cubemaps (note: lightFalloffCubeMap is awful)
3) Fix C++-side support in old backend.
4) Look at makeAmbientMap console command: fix, rename, reuse more code with image-program case.
stgatilov

stgatilov

17.09.2022 18:31

administrator   ~0015255

Point 2 done in svn rev 10120.

Now one can set two new parameters on ambient light:
  lightAmbientDiffuse {cubemap program here}
  lightAmbientSpecular {cubemap program here}
If at least one of them is set, then normal-based modulator is computed from them.
If none of them is set, then the old hacky "light from above" modulator is used instead.

Note that ambientCubicLight keyword no longer exists, since it serves no purpose. But you can set ambientLight and cubicLight together if you want.
The "cubicLight" flag controls only how projection texture is used (cubemap vs 2D).
Currently it also controls falloff, which will hopefully be changed in 0005835.

Here is full example of an ambient light using this feature:
lights/ambientCube/cubeSky
{
    ambientLight
    lightAmbientDiffuse bakeAmbientDiffuse(cameraLayout(env/lights/cubesky))
    lightAmbientSpecular bakeAmbientSpecular(cameraLayout(env/lights/cubesky))
    {
        map lights/squarelight_amb.tga
        colored
        zeroClamp
    }
}

Issue History

Date Modified Username Field Change
03.09.2022 08:07 stgatilov New Issue
03.09.2022 08:07 stgatilov Status new => assigned
03.09.2022 08:07 stgatilov Assigned To => stgatilov
03.09.2022 08:07 stgatilov Relationship added related to 0005828
03.09.2022 08:09 stgatilov Summary Restore ambientCubeMap => Restore ambientCubicMap
03.09.2022 08:26 stgatilov Note Added: 0015221
17.09.2022 18:31 stgatilov Note Added: 0015255