Skip to content

Commit 2d978cb

Browse files
authored
Move variable declarations above the line that includes clipping planes shader (#31144)
1 parent efcca9a commit 2d978cb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

examples/jsm/lines/LineMaterial.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ ShaderLib[ 'line' ] = {
311311
312312
void main() {
313313
314+
float alpha = opacity;
315+
vec4 diffuseColor = vec4( diffuse, alpha );
316+
314317
#include <clipping_planes_fragment>
315318
316319
#ifdef USE_DASH
@@ -321,8 +324,6 @@ ShaderLib[ 'line' ] = {
321324
322325
#endif
323326
324-
float alpha = opacity;
325-
326327
#ifdef WORLD_UNITS
327328
328329
// Find the closest points on the view ray and the line segment
@@ -387,8 +388,6 @@ ShaderLib[ 'line' ] = {
387388
388389
#endif
389390
390-
vec4 diffuseColor = vec4( diffuse, alpha );
391-
392391
#include <logdepthbuf_fragment>
393392
#include <color_fragment>
394393

0 commit comments

Comments
 (0)