Skip to content

WebGLProgram: Do not define USE_UV#25740

Merged
mrdoob merged 1 commit into
devfrom
dev-patch
Mar 30, 2023
Merged

WebGLProgram: Do not define USE_UV#25740
mrdoob merged 1 commit into
devfrom
dev-patch

Conversation

@mrdoob
Copy link
Copy Markdown
Owner

@mrdoob mrdoob commented Mar 30, 2023

Related issue: #25721

Description

This should hopefully fix this issue in drei:
https://twitter.com/0xca0a/status/1641555401073098752

@mrdoob mrdoob added this to the r151 milestone Mar 30, 2023
@github-actions
Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize Gzipped Diff from dev
627.3 kB 156 kB -92 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize Gzipped Diff from dev
418.9 kB 102.1 kB -92 B

@Mugen87
Copy link
Copy Markdown
Collaborator

Mugen87 commented Mar 31, 2023

How is USE_UV now supposed to be set? The uv_* shader chunks still check the define.

@mrdoob
Copy link
Copy Markdown
Owner Author

mrdoob commented Mar 31, 2023

I left the USE_UV code there because I noticed this pattern...

vertexShader: [
'#define USE_UV',
ShaderChunk[ 'meshphong_vert' ],
].join( '\n' ),

shader.vertexShader =
'#define USE_UV\n' +
shader.vertexShader.slice( 0, - 1 ) +
' gl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }';

So I thought leaving a a couple of lines was worth it to not break an unknown amount of hacks... 😅

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