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

Examples: Clean up. #29438

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Examples: Clean up. #29438

merged 1 commit into from
Sep 18, 2024

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Sep 18, 2024

Related issue: -

Description

TiltLoader internally loads a texture for stroke rendering which isn't ready at the first frame. webgl_loader_tilt now uses an animation loop so the strokes using the texture actually appear in the example without waiting for a user interaction.

@Mugen87 Mugen87 added this to the r169 milestone Sep 18, 2024
@Mugen87 Mugen87 merged commit 01359e0 into mrdoob:dev Sep 18, 2024
11 checks passed
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Sep 18, 2024

@mrdoob TiltLoader has a dependency to RawShaderMaterial since one stroke type (Light) is implemented as a custom material. The color space handling of this particular material does not look right to me though. It converts a sRGB color to linear in the fragment shader:

void main(){
vec4 col = texture2D(mainTex, vUv);
vec3 color = vColor;
color = BloomColor(color, emission_gain);
color = color * col.rgb;
color = color * col.a;
color = SrgbToLinear(color);
gl_FragColor = vec4(color, 1.0);
}

The working color space should be linear and the output color space (usually) sRGB. The color space of the vertex colors is definitely linear-srgb right now so the current color space conversion does not make sense to me.

Would it be an option to simplify the loader a bit and always represent the strokes with MeshBasicMaterial? In this way, we don't need a separate WebGPU version of the loader.

LD2Studio pushed a commit to LD2Studio/LD2Studio-Editor that referenced this pull request Sep 20, 2024
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.

1 participant