Skip to content

[WIP] Implement advanced rendering features: skin SSS, eye shader, and hair shader with SDK/demo controls#6

Merged
hmthanh merged 3 commits intomainfrom
copilot/implement-advanced-rendering-features
Mar 22, 2026
Merged

[WIP] Implement advanced rendering features: skin SSS, eye shader, and hair shader with SDK/demo controls#6
hmthanh merged 3 commits intomainfrom
copilot/implement-advanced-rendering-features

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 22, 2026

Implements PR #4 advanced rendering MVP for skin, eye, and hair shading in pure WebGL 2.0, and wires user-facing controls through the SDK and demo.

What’s implemented

Skin SSS

  • Added src/renderer/SSSPass.js with a Jorge Jimenez-style separable screen-space blur (horizontal + vertical).
  • Includes edge-stopping using G-buffer normals and a skin mask derived from albedo.
  • Integrated into DeferredRenderer between lighting and tonemapping.
  • Exposed runtime controls:
    • enable/disable
    • strength
    • width
    • RGB SSS color

Eye shading

  • Added src/renderer/EyeRenderer.js with a physically-inspired eye model:
    • cornea Fresnel/specular
    • iris depth/parallax effect
    • sclera wrap-lighting contribution
  • Wired demo controls for eye toggle and iris size.

Hair shading

  • Added src/renderer/HairRenderer.js with Kajiya-Kay anisotropic highlights and a secondary shifted lobe.
  • Added procedural card-based hair geometry helper (buildHairCards) for demo use.
  • Wired demo controls for hair toggle and anisotropy/specular shaping.

SDK / API updates

  • Updated src/sdk/OpenHuman.js with renderer API entry points for SSS controls:
    • setSSSEnabled
    • setSSSStrength
    • setSSSWidth
    • setSSSColor
  • Added eye/hair parameter entry points for future embedding:
    • setEyeParams
    • setHairParams
  • Re-exported advanced renderer modules for SDK consumers.

Demo updates

  • Updated demo/index.html with advanced shading controls (toggles/sliders) and visible scene elements for skin/eye/hair improvements.
  • Updated path label/HUD to reflect active advanced shading features.

Validation

  • ✅ Build passes: npm run build
  • ✅ Security scan: codeql_checker reported 0 alerts
  • ✅ Manual visual verification completed in browser

Screenshot

Original prompt

Create PR #4 for openhuman-ai/realistic-render-engine implementing advanced rendering features: skin screen-space subsurface scattering (SSS), eye shader with cornea/iris effects, and hair shader (Kajiya-Kay and/or card-based anisotropy).

Scope:

  1. SSS: Implement Jorge Jimenez-style separable, curvature/depth-masked SSS blur for skin materials. Wire controls for SSS strength, width, and color (RGB).
  2. Eye: Physically-based eye shader (cornea refraction, iris depth/parallax, sclera SSS contribution) integrated with deferred and/or forward path.
  3. Hair: Card-based and/or multi-layer strand (Kajiya-Kay or Marschner-inspired, but within MVP constraints) with anisotropic highlight and shadow.
  4. Update SDK API for SSS/eye/hair params per OpenHuman demo spec.
  5. Update demo to show visibly improved skin softness, eye effects, and hair specularity/anisotropy, with toggles/slider controls.

Constraints:

  • Pure WebGL 2.0 (GLSL 300 es, no runtime dependencies)
  • Performance-aware SSS pass (scissoring, skin mask, mobile fallback)
  • All code modular/per-file under src/ as per repo plan
  • All features have API entry points for later SDK embedding

Detailed implementation guidance

  • Implement/extend src/shaders/skin.frag.glsl, sss.frag.glsl, eye.frag.glsl, hair.frag.glsl; update/ensure JS<->GLSL uniform coupling.
  • Integrate SSS as post-process after lighting, supporting strength/mask.
  • For eye/hair, update geometry path and scene/Character plumbing as needed.
  • Demo scene includes at least one eye, hair, and visible skin surface tested across toggles.

Acceptance:

  • Skin SSS, eye, and hair shading is visibly functional in demo.
  • SDK+demo API exposes relevant controls for SSS/eye/hair tuning.
  • No runtime dependency is introduced.
  • Code matches file structure and style established in earlier PRs.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: @copilot Accepted Confirmation: Confirm agent session

Assistant: Started — PR #2 is now in progress.

You can track it here:

data:
    - title: '[WIP] Add GPU dual-quaternion skinning and animation system'
      repository: openhuman-ai/realistic-render-engine
      url: https://github.com/copilot/tasks/pull/PR_kwDORtjZVs7MepKM?session_id=d4c94486-eb95-41da-8621-07ae3854237f
      state: queued

User: Continue with third Pull request:

PR #3: deferred + G-buffer + PBR/IBL + shadows + ACES

Assistant: Great — I’m ready to start PR #3: deferred + G-buffer + PBR/IBL + shadows + ACES on openhuman-ai/realistic-render-engine targeting main.

Please confirm and accept the GitHub confirmation prompt for the new agent session, and I’ll open PR #3 immediately with that scope.

User: Yes, I confirm.

Assistant: Perfect — proceeding with PR #3 on main.

Please accept the GitHub confirmation prompt (@Copilot Accepted Confirmation: Confirm agent session) for this new PR run, and I’ll start implementation right away.

User: @copilot Accepted Confirmation: Confirm agent session

Assistant: I’m waiting for your confirmation response in the GitHub dialog to continue with PR #3.

User: @copilot Accepted Confirmation: Confirm agent session

Assistant: Started — PR #3 is now in progress.

You can track it here:

data:
    - title: '[WIP] Implement deferred rendering pipeline with G-buffer and PBR lighting'
      repository: openhuman-ai/realistic-render-engine
      url: https://github.com/copilot/tasks/pull/PR_kwDORtjZVs7Mez_d?session_id=b777be20-170b-456d-b503-7e8c23fe7631
      state: queued

User: Let continue to fix PR #3.

Assistant: Done — I’ve sent the continuation/fix request for PR #3 and resumed work on the deferred pipeline issues (G-buffer, PBR/IBL, shadows, ACES, and demo stability) on openhuman-ai/realistic-render-engine (main).

User: @copilot Accepted Confirmation: Confirm agent session

Assistant: Great — I’ve continued the PR #3 fix pass and queued focused fixes.

Track progress here:

data:
    - title: '[WIP] Fix deferred rendering pipeline issues in PR #3'
      repository: openhuman-ai/realistic-render-engine
      url: https://github.com/copilot/tasks/pull/PR_kwDORtjZVs7Me_WY?session_id=d822f307-fb70-4128-bc0e-f6bd191efd12
      state: queued

User: #PR3 still not work, Let continue to fix by following list guide, [x] is already complete, [ ] is not complete yet. Let complete all unfinish task following:

  • Explore existing codebase (ForwardRenderer, RenderTarget, Shader, StateCache, SDK, demo)
  • Update src/core/RenderTarget.js — add depth-texture support (for shadow maps)
  • Implement src/renderer/ShadowMap.js — depth FBO, orthographic light matrix, shadow pass, PCF
  • Implement src/renderer/PostProcessStack.js — fullscreen quad, ACES tonemapping shader, pass chain
  • Implement src/renderer/DeferredRenderer.js — G-buffer MRT, geometry pass (static+skinned), PBR lighting pass, IBL (BRDF LUT + ...

This pull request was created from Copilot chat.


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

@hmthanh
Copy link
Copy Markdown
Contributor

hmthanh commented Mar 22, 2026

@copilot let continue

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 22, 2026

@copilot let continue

Continued and pushed in 27a2b3f.

Implemented and wired: deferred SSS integration (including SDK controls), advanced shading demo controls/toggles, and demo scene updates for SSS/eye/hair visibility.

Screenshot: https://github.com/user-attachments/assets/6ec629af-7251-46ec-b75b-256af67b0f10

Copilot AI changed the title [WIP] Add advanced rendering features including SSS and eye shader [WIP] Implement advanced rendering features: skin SSS, eye shader, and hair shader with SDK/demo controls Mar 22, 2026
@hmthanh hmthanh marked this pull request as ready for review March 22, 2026 18:15
@hmthanh hmthanh merged commit e13301e into main Mar 22, 2026
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.

2 participants