pmndrs / pmndrs/three-stdlib

CSM Shader broken

Open
#386 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
858
Forks
144
PR merge metrics
No merged PRs in 30d

Description

  • three version: 0.170.0
  • @types/three version: 0.170.0
  • three-stdlib version: 2.34.0
Problem description:

Creating the CSM fails with the following error: Can not resolve #include <lights_pars_begin>
The original library broke with three 157, see issue and PR, but isn't receiving updates anymore from what it looks like. Would be nice to have a working version in here, not sure if these fixes apply in the same way (original library errors in a different way).

Relevant code:
const csm = new CSM({
            maxFar: camera.far,
            cascades: 4,
            shadowMapSize: 1024,
            lightDirection: new Vector3(0, -1, 0).normalize(),
            camera: camera,
            parent: scene
});

const material = new THREE.MeshStandardMaterial(); // works with Phong and Standard materials
csm.setupMaterial(material); // must be called to pass all CSM-related uniforms to the shader


Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with three 0.170.0 using the CSM constructor and setupMaterial call shown in the issue. Review the CSM shader path alongside the linked upstream issue and PR, then verify that MeshStandardMaterial and Phong materials no longer fail to resolve the lights_pars_begin include.

Written by the indexing model from the issue text.

Assessment

Tech stack
three.js
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.