Skip to content

Conversation

@WestLangley
Copy link
Collaborator

Fixes #14197... At least I am hopeful it will.

@pailhead
Copy link
Contributor

pailhead commented Jun 12, 2018

Lol, we made the same thing at almost the same time #14275
Reminds me of a Silicon Valley episode :)

I think it would be good development practice to announce something like this (since you did post there), i could have not coded this had i known you'd do the same thing :)

I think this is probably more valid, i split the mesh and added another value in the uv attribute. I wasn't familiar with how the uv's are used elsewhere so didn't want to modify the layout.

#ifdef USE_DASH
if ( vUv.y < 0.5 || vUv.y > 0.5 ) discard; // discard endcaps
if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
Copy link
Contributor

@pailhead pailhead Jun 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has a lot of checks though:

2x ||
1x ?
4x >
2x if

By adding another dimension, you can do it with bool isCap = vUv.z < 0.5; and two if checks.

https://github.com/pailhead/three.js/blob/8fb7884a10d81106a82568393ce3c9ea5f0ab56a/examples/js/lines/LineMaterial.js#L207-L217

@mrdoob mrdoob added this to the r94 milestone Jun 13, 2018
@mrdoob mrdoob merged commit eab03f0 into mrdoob:dev Jun 13, 2018
@mrdoob
Copy link
Owner

mrdoob commented Jun 13, 2018

Thanks!

@WestLangley WestLangley deleted the dev-fat_line_fix branch June 13, 2018 03:29
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.

3 participants