Skip to content

Add reflectivity map support for Side-Scan Sonar#87

Open
vsjays wants to merge 2 commits into
patrykcieslak:masterfrom
vsjays:dev/sss_refl_map
Open

Add reflectivity map support for Side-Scan Sonar#87
vsjays wants to merge 2 commits into
patrykcieslak:masterfrom
vsjays:dev/sss_refl_map

Conversation

@vsjays

@vsjays vsjays commented Jul 7, 2026

Copy link
Copy Markdown

Summary

Adds support for a reflectivity map used by the Side-Scan Sonar (SSS)
renderer. Previously the sonar return intensity was driven only by the surface normal
(and material restitution); a look can now supply a texture that modulates the returned
intensity per-texel, enabling spatially varying acoustic reflectivity across a surface.

What changed

New shaders (derived from sonarInputUv.frag):

  • sonarInputRefl.frag — reflectivity map only (geometric normal + reflectivity texture).
  • sonarInputReflUv.frag — reflectivity map and normal map combined.

Look / material plumbing — a reflectivity_map texture flows through the full chain:

  • ScenarioParser parses the new reflectivity_map attribute on <look> elements.
  • SimulationManager::CreateLook and OpenGLContent::CreatePhysicalLook gained a
    reflectivityTexturePath / reflectivityMapPath parameter.
  • Look struct now holds a reflectivityMap texture handle; new
    TEX_MAT_REFLECTIVITY (Unit 18) texture slot added.

Sonar rendering (OpenGLSSS / OpenGLSonar):

  • sonarInputShader_ array expanded from 2 → 4 to cover the
    {plain, normal, reflectivity, normal+reflectivity} shader combinations.

  • Per object, the shader is now selected based on whether the look has a normal map
    and/or a reflectivity map. When a reflectivity map is present it drives intensity;
    otherwise the previous material-restitution behavior is kept.

    Usage

Add a reflectivity_map attribute to a look in the scenario XML:

<look name="seabed" ... reflectivity_map="textures/seabed_reflectivity.png"/>

vsjays added 2 commits July 7, 2026 13:59
- Updated CreateLook and CreatePhysicalLook methods to include reflectivity map parameters.
- Introduced new shaders for handling reflectivity in sonar input.
- Modified ScenarioParser to parse reflectivity map attributes.
- Enhanced OpenGLSonar to utilize additional shaders for reflectivity mapping.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant