Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

program not valid with latest three.js #39

Open
aiden-jeffrey opened this issue Nov 7, 2023 · 9 comments
Open

program not valid with latest three.js #39

aiden-jeffrey opened this issue Nov 7, 2023 · 9 comments

Comments

@aiden-jeffrey
Copy link

I'm seeing this error trying to use your library on a recent three.js release (r157):

three.module.js:19999 THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false

Program Info Log: Fragment shader is not compiled.
�

FRAGMENT

ERROR: 0:1591: 'GeometricContext' : undeclared identifier
ERROR: 0:1591: 'geometry' : syntax error
�

  1586: 	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
  1587: 	material.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y;
  1588: 	material.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y;
  1589: #endif
  1590: 
> 1591: GeometricContext geometry;
  1592: 
  1593: geometry.position = - vViewPosition;
  1594: geometry.normal = normal;
  1595: geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
  1596: 
  1597: #ifdef CLEARCOAT

Any idea what I can do to fix this? Should I just use the version of this that ships with three.js?

@aiden-jeffrey
Copy link
Author

Looks like this was the PR that broke things: mrdoob/three.js#26805

@aiden-jeffrey
Copy link
Author

I didn't want to use the three.js version mainly because they don't expose lightColor in the constructor.

@aiden-jeffrey
Copy link
Author

Had a stab at applying that diff to your shader: #40

@Sceat
Copy link

Sceat commented Dec 24, 2023

@aiden-jeffrey your fork doesn't seem to work for me in three 159, running this fails

 npm i aiden-jeffrey/three-csm#aiden/three-157

@tolgaand
Copy link

tolgaand commented Feb 5, 2024

any updates?

@aiden-jeffrey
Copy link
Author

any updates?

I just used the three.js fork of this in the end. I'm sure that the PR I linked is most of the way there, but I couldn't get the shadows to render.

@ebeaufay
Copy link

ebeaufay commented Mar 9, 2024

I'm sure that the PR I linked is most of the way there, but I couldn't get the shadows to render.

Just tried your fix with three.js 162 and I do have shadows!

@DawidSmuga
Copy link

I'm sure that the PR I linked is most of the way there, but I couldn't get the shadows to render.

Just tried your fix with three.js 162 and I do have shadows!

How you did it? I mean three-csm working with three 162.

I have this problem.

image

@ebeaufay
Copy link

How you did it? I mean three-csm working with three 162.

I forked CSM (actually just copied the files from the threejs samples: CSM.js, CSMFrustum.js and CSMShader.js)
Then I applied the fix from @aiden-jeffrey and I use my local version of CSM for now.

The file with the fix is here: https://github.com/ebeaufay/UltraGlobe/blob/master/src/csm/CSMShader.js

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

No branches or pull requests

5 participants