Skip to content

IBL / raster preview lighting: remaining work #101

Description

@juanchuletas

Description

Make FunGT's OpenGL raster preview scenes look good by default, so a
loaded model is not lit only by manually placed point lights. Before
this work, the raster shader had only a flat, near invisible ambient
term, so any freshly loaded model looked dark and flat regardless of
what it was.

This tracks what is still missing after adding HDRI based Image Based
Lighting (IBL) and a tunable flat ambient fallback to the raster
shader. Scene scale and performance work (loading very large models,
BVH build time, threaded loading) is a separate concern and is not
covered by this issue.

What was done

  • HDR (.hdr) equirectangular texture loading
  • Equirect to cubemap conversion pass
  • Irradiance convolution (diffuse ambient derived from an HDRI)
  • IBL ambient term in fungt_default.fs, with tunable intensity
  • Flat ambientColor fallback for scenes with no HDRI loaded
  • Reinhard tonemap and gamma correction on the final shader output
  • SimpleGeometry Sphere and Plane switched to the same shader as
    loaded models, so they share the same ambient/IBL/tonemap behavior

What is still needed

  • Screen space ambient occlusion (SSAO) does not exist in this
    codebase. Flat/uniform ambient with no HDRI loaded will not
    produce contact or crease shadowing on its own
  • Prefiltered specular map (roughness based mip chain for
    environment reflections)
  • BRDF integration LUT
  • Full PBR shader rewrite (metallic/roughness, Cook-Torrance).
    fungt_default.fs is still Blinn-Phong; only its ambient term
    was replaced
  • Cube primitive (Geometries/cube.cpp, resources/cube.vs/fs) has
    no vertex normal data at all and is still on the old unlit
    shader. Needs normal generation added to the geometry before it
    can use fungt_default.fs
  • Normal / roughness / metallic texture map loading for models.
    Space::LoadModelToRender currently only loads a single base
    color texture per mesh
  • Screen space ambient occlusion (SSAO) does not exist in this
    codebase. Flat/uniform ambient with no HDRI loaded will not
    produce contact or crease shadowing on its own
  • Background/viewport clear color is currently hardcoded in three
    separate places (OpenGLDevice::init via setBackgroundColor,
    OGLframeBuffer's one-time init clear, OpenGLViewPort's per-frame
    clear). setBackgroundColor() does not actually control what is
    visible on screen when a ViewPort layer is active; only
    OpenGLViewPort's hardcoded clear does
  • Offscreen FBO/RBO calls inside IBLProbe's two render passes are
    still raw OpenGL calls. No existing FrameBuffer abstraction
    supports attaching an external texture face as a render target

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions