tentone / potree-core

Potree point cloud viewer library core components for easier integration in a three.js project.
https://tentone.github.io/potree-core/
Other
171 stars 53 forks source link

Shader error with THREE v154 #38

Closed iconnary closed 4 months ago

iconnary commented 4 months ago

I'm running into a shader error with latest potree-core (2.07), THREE v154, Windows 11, latest Chrome 122.

The problem appears to be the #version 300 es directive in the first line. attribute and varying are deprecated in OpenGL ES 3, in favor of in and out.

Error in vertex shader :

ERROR: 0:21: 'attribute' : Illegal use of reserved word

 1:     #version 300 es
 2:     #define SHADER_TYPE RawShaderMaterial
 3:     #define SHADER_NAME 
 4:     #define tree_type_octree
 5:     #define attenuated_point_size
 6:     #define circle_point_shape
 7:     #define color_type_rgb
 8:     #define clip_outside
 9:     #define fixed_opacity
10:     #define output_color_encoding_linear
11:     #define input_color_encoding_sRGB
12:     #define use_clip_box
13:     #define MAX_POINT_LIGHTS 0
14:     #define MAX_DIR_LIGHTS 0
15:     precision highp float;
16:     precision highp int;
17:     
18:     #define max_clip_boxes 30
19:     #define max_clip_planes 30
20:     
21:     attribute vec3 position;
22:     attribute vec3 color;

And similar error in the fragment shader :

ERROR: 0:42: 'varying' : Illegal use of reserved word

 1:     #version 300 es
 2:     #define SHADER_TYPE RawShaderMaterial
 3:     #define SHADER_NAME 
 4:     #define tree_type_octree
 5:     #define attenuated_point_size
 6:     #define circle_point_shape
 7:     #define color_type_rgb
 8:     #define clip_outside
 9:     #define fixed_opacity
10:     #define output_color_encoding_linear
11:     #define input_color_encoding_sRGB
12:     #define use_clip_box
13:     #define MAX_POINT_LIGHTS 0
14:     #define MAX_DIR_LIGHTS 0
15:     precision highp float;
16:     precision highp int;
17:     
18:     #if defined paraboloid_point_shape
19:     #extension GL_EXT_frag_depth : enable
20:     #endif
21:     
22:     uniform mat4 viewMatrix;
23:     uniform vec3 cameraPosition;
24:     
25:     uniform mat4 projectionMatrix;
26:     uniform float opacity;
27:     
28:     uniform float blendHardness;
29:     uniform float blendDepthSupplement;
30:     uniform float fov;
31:     uniform float spacing;
32:     uniform float pcIndex;
33:     uniform float screenWidth;
34:     uniform float screenHeight;
35:     
36:     uniform sampler2D depthMap;
37:     
38:     #ifdef highlight_point
39:     uniform vec4 highlightedPointColor;
40:     #endif
41:     
42:     varying vec3 vColor;
43:     
44:     #if !defined(color_type_point_index)

Thanks Iven

iconnary commented 4 months ago

Disregard this issue -- turns out I was overriding the shader myself. This issue can be closed --

Thanks