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

fix(entwine): change transparency settings #2327

Merged
merged 7 commits into from
May 24, 2024

Conversation

ftoromanoff
Copy link
Contributor

@ftoromanoff ftoromanoff commented May 13, 2024

Fix for issue #2323.

This issue point out a bug with the rendering of point cloud where points should be rendered with differentes values of opacity.

@airnez
Copy link

airnez commented May 14, 2024

Do you think it will fix this issue (#2323) ?

@ftoromanoff
Copy link
Contributor Author

Do you think it will fix this issue (#2323) ?

Currently, I only have look up for a fix for PointCloudLayer (entwine Potree Layers). I will try to continue toward 3DTilesLayer

@airnez
Copy link

airnez commented May 16, 2024

Do you think it will fix this issue (#2323) ?

Currently, I only have look up for a fix for PointCloudLayer (entwine Potree Layers). I will try to continue toward 3DTilesLayer

Understood. Thank you for your answer 👍

@ftoromanoff ftoromanoff force-pushed the fixTransparence branch 8 times, most recently from 2f3e269 to a2e5fa1 Compare May 21, 2024 09:51
@ftoromanoff ftoromanoff marked this pull request as ready for review May 21, 2024 13:36
@AnthonyGlt
Copy link
Contributor

Thank you @ftoromanoff for this MR !
Looks like it solves the transparency issue 👍
It also exposed the fact that the 3dtiles is a PointCloud (or contains points) with hasPnts. I like this idea.
Looks good to me !

I have an interrogation, it's not really related to this MR but it's about PointsMaterial.js

export const ClassificationScheme = {
DEFAULT: {
0: { visible: true, name: 'never classified', color: new THREE.Color(0.5, 0.5, 0.5), opacity: 1.0 },
1: { visible: true, name: 'unclassified', color: new THREE.Color(0.5, 0.5, 0.5), opacity: 1.0 },
2: { visible: true, name: 'ground', color: new THREE.Color(0.63, 0.32, 0.18), opacity: 1.0 },
3: { visible: true, name: 'low vegetation', color: new THREE.Color(0.0, 1.0, 0.0), opacity: 1.0 },
4: { visible: true, name: 'medium vegetation', color: new THREE.Color(0.0, 0.8, 0.0), opacity: 1.0 },
5: { visible: true, name: 'high vegetation', color: new THREE.Color(0.0, 0.6, 0.0), opacity: 1.0 },
6: { visible: true, name: 'building', color: new THREE.Color(1.0, 0.66, 0.0), opacity: 1.0 },
7: { visible: true, name: 'low point(noise)', color: new THREE.Color(1.0, 0.0, 1.0), opacity: 1.0 },
8: { visible: true, name: 'key-point', color: new THREE.Color(1.0, 0.0, 0.0), opacity: 1.0 },
9: { visible: true, name: 'water', color: new THREE.Color(0.0, 0.0, 1.0), opacity: 1.0 },
10: { visible: true, name: 'rail', color: new THREE.Color(0.8, 0.8, 1.0), opacity: 1.0 },
11: { visible: true, name: 'road Surface', color: new THREE.Color(0.4, 0.4, 0.7), opacity: 1.0 },
12: { visible: true, name: 'overlap', color: new THREE.Color(1.0, 1.0, 0.0), opacity: 1.0 },
DEFAULT: { visible: true, name: 'default', color: new THREE.Color(0.3, 0.6, 0.6), opacity: 1.0 },
},
};
const DiscreteScheme = {
DEFAULT: {
0: { visible: true, name: '0', color: new THREE.Color('rgb(67, 99, 216)'), opacity: 1.0 },
1: { visible: true, name: '1', color: new THREE.Color('rgb(60, 180, 75);'), opacity: 1.0 },
2: { visible: true, name: '2', color: new THREE.Color('rgb(255, 255, 25)'), opacity: 1.0 },
3: { visible: true, name: '3', color: new THREE.Color('rgb(145, 30, 180)'), opacity: 1.0 },
4: { visible: true, name: '4', color: new THREE.Color('rgb(245, 130, 49)'), opacity: 1.0 },
5: { visible: true, name: '5', color: new THREE.Color('rgb(230, 25, 75)'), opacity: 1.0 },
6: { visible: true, name: '6', color: new THREE.Color('rgb(66, 212, 244)'), opacity: 1.0 },
7: { visible: true, name: '7', color: new THREE.Color('rgb(240, 50, 230)'), opacity: 1.0 },
DEFAULT: { visible: true, name: 'default', color: white, opacity: 1.0 },
},
};

WHat's the point of having a DEFAULT object in the ClassificationScheme & in the DiscreteScheme ?
Couldn't we put the DiscreteScheme directly in the ClassificationScheme ? We could access it with
ClassificationScheme.DISCRETE

export const ClassificationScheme = {
    DEFAULT: {
        0: { visible: true, name: 'never classified', color: new THREE.Color(0.5,  0.5,  0.5), opacity: 1.0 },
        1: { visible: true, name: 'unclassified', color: new THREE.Color(0.5,  0.5,  0.5), opacity: 1.0 },
        2: { visible: true, name: 'ground', color: new THREE.Color(0.63, 0.32, 0.18), opacity: 1.0 },
        3: { visible: true, name: 'low vegetation', color: new THREE.Color(0.0,  1.0,  0.0), opacity: 1.0 },
        4: { visible: true, name: 'medium vegetation', color: new THREE.Color(0.0,  0.8,  0.0), opacity: 1.0 },
        5: { visible: true, name: 'high vegetation', color: new THREE.Color(0.0,  0.6,  0.0), opacity: 1.0 },
        6: { visible: true, name: 'building', color: new THREE.Color(1.0,  0.66, 0.0), opacity: 1.0 },
        7: { visible: true, name: 'low point(noise)', color: new THREE.Color(1.0,  0.0,  1.0), opacity: 1.0 },
        8: { visible: true, name: 'key-point', color: new THREE.Color(1.0,  0.0,  0.0), opacity: 1.0 },
        9: { visible: true, name: 'water', color: new THREE.Color(0.0,  0.0,  1.0), opacity: 1.0 },
        10: { visible: true, name: 'rail', color: new THREE.Color(0.8,  0.8,  1.0), opacity: 1.0 },
        11: { visible: true, name: 'road Surface', color: new THREE.Color(0.4,  0.4,  0.7), opacity: 1.0 },
        12: { visible: true, name: 'overlap', color: new THREE.Color(1.0,  1.0,  0.0), opacity: 1.0 },
        DEFAULT: { visible: true, name: 'default', color: new THREE.Color(0.3, 0.6, 0.6), opacity: 1.0 },
    },
 DISCRETE : {

        0: { visible: true, name: '0', color: new THREE.Color('rgb(67, 99, 216)'), opacity: 1.0 },
        1: { visible: true, name: '1', color: new THREE.Color('rgb(60, 180, 75);'), opacity: 1.0 },
        2: { visible: true, name: '2', color: new THREE.Color('rgb(255, 255, 25)'), opacity: 1.0 },
        3: { visible: true, name: '3', color: new THREE.Color('rgb(145, 30, 180)'), opacity: 1.0 },
        4: { visible: true, name: '4', color: new THREE.Color('rgb(245, 130, 49)'), opacity: 1.0 },
        5: { visible: true, name: '5', color: new THREE.Color('rgb(230, 25, 75)'), opacity: 1.0 },
        6: { visible: true, name: '6', color: new THREE.Color('rgb(66, 212, 244)'), opacity: 1.0 },
        7: { visible: true, name: '7', color: new THREE.Color('rgb(240, 50, 230)'), opacity: 1.0 },
        DEFAULT: { visible: true, name: 'default', color: white, opacity: 1.0 },
    },
};

WDYT ?

@ftoromanoff ftoromanoff requested review from mgermerie and removed request for Desplandis May 23, 2024 08:17
@ftoromanoff
Copy link
Contributor Author

Thank you @ftoromanoff for this MR ! Looks like it solves the transparency issue 👍 It also exposed the fact that the 3dtiles is a PointCloud (or contains points) with hasPnts. I like this idea. Looks good to me !

I have an interrogation, it's not really related to this MR but it's about PointsMaterial.js

export const ClassificationScheme = {
DEFAULT: {
0: { visible: true, name: 'never classified', color: new THREE.Color(0.5, 0.5, 0.5), opacity: 1.0 },
1: { visible: true, name: 'unclassified', color: new THREE.Color(0.5, 0.5, 0.5), opacity: 1.0 },
2: { visible: true, name: 'ground', color: new THREE.Color(0.63, 0.32, 0.18), opacity: 1.0 },
3: { visible: true, name: 'low vegetation', color: new THREE.Color(0.0, 1.0, 0.0), opacity: 1.0 },
4: { visible: true, name: 'medium vegetation', color: new THREE.Color(0.0, 0.8, 0.0), opacity: 1.0 },
5: { visible: true, name: 'high vegetation', color: new THREE.Color(0.0, 0.6, 0.0), opacity: 1.0 },
6: { visible: true, name: 'building', color: new THREE.Color(1.0, 0.66, 0.0), opacity: 1.0 },
7: { visible: true, name: 'low point(noise)', color: new THREE.Color(1.0, 0.0, 1.0), opacity: 1.0 },
8: { visible: true, name: 'key-point', color: new THREE.Color(1.0, 0.0, 0.0), opacity: 1.0 },
9: { visible: true, name: 'water', color: new THREE.Color(0.0, 0.0, 1.0), opacity: 1.0 },
10: { visible: true, name: 'rail', color: new THREE.Color(0.8, 0.8, 1.0), opacity: 1.0 },
11: { visible: true, name: 'road Surface', color: new THREE.Color(0.4, 0.4, 0.7), opacity: 1.0 },
12: { visible: true, name: 'overlap', color: new THREE.Color(1.0, 1.0, 0.0), opacity: 1.0 },
DEFAULT: { visible: true, name: 'default', color: new THREE.Color(0.3, 0.6, 0.6), opacity: 1.0 },
},
};
const DiscreteScheme = {
DEFAULT: {
0: { visible: true, name: '0', color: new THREE.Color('rgb(67, 99, 216)'), opacity: 1.0 },
1: { visible: true, name: '1', color: new THREE.Color('rgb(60, 180, 75);'), opacity: 1.0 },
2: { visible: true, name: '2', color: new THREE.Color('rgb(255, 255, 25)'), opacity: 1.0 },
3: { visible: true, name: '3', color: new THREE.Color('rgb(145, 30, 180)'), opacity: 1.0 },
4: { visible: true, name: '4', color: new THREE.Color('rgb(245, 130, 49)'), opacity: 1.0 },
5: { visible: true, name: '5', color: new THREE.Color('rgb(230, 25, 75)'), opacity: 1.0 },
6: { visible: true, name: '6', color: new THREE.Color('rgb(66, 212, 244)'), opacity: 1.0 },
7: { visible: true, name: '7', color: new THREE.Color('rgb(240, 50, 230)'), opacity: 1.0 },
DEFAULT: { visible: true, name: 'default', color: white, opacity: 1.0 },
},
};

WHat's the point of having a DEFAULT object in the ClassificationScheme & in the DiscreteScheme ? Couldn't we put the DiscreteScheme directly in the ClassificationScheme ? We could access it with ClassificationScheme.DISCRETE

export const ClassificationScheme = {
    DEFAULT: {
        0: { visible: true, name: 'never classified', color: new THREE.Color(0.5,  0.5,  0.5), opacity: 1.0 },
        1: { visible: true, name: 'unclassified', color: new THREE.Color(0.5,  0.5,  0.5), opacity: 1.0 },
        2: { visible: true, name: 'ground', color: new THREE.Color(0.63, 0.32, 0.18), opacity: 1.0 },
        3: { visible: true, name: 'low vegetation', color: new THREE.Color(0.0,  1.0,  0.0), opacity: 1.0 },
        4: { visible: true, name: 'medium vegetation', color: new THREE.Color(0.0,  0.8,  0.0), opacity: 1.0 },
        5: { visible: true, name: 'high vegetation', color: new THREE.Color(0.0,  0.6,  0.0), opacity: 1.0 },
        6: { visible: true, name: 'building', color: new THREE.Color(1.0,  0.66, 0.0), opacity: 1.0 },
        7: { visible: true, name: 'low point(noise)', color: new THREE.Color(1.0,  0.0,  1.0), opacity: 1.0 },
        8: { visible: true, name: 'key-point', color: new THREE.Color(1.0,  0.0,  0.0), opacity: 1.0 },
        9: { visible: true, name: 'water', color: new THREE.Color(0.0,  0.0,  1.0), opacity: 1.0 },
        10: { visible: true, name: 'rail', color: new THREE.Color(0.8,  0.8,  1.0), opacity: 1.0 },
        11: { visible: true, name: 'road Surface', color: new THREE.Color(0.4,  0.4,  0.7), opacity: 1.0 },
        12: { visible: true, name: 'overlap', color: new THREE.Color(1.0,  1.0,  0.0), opacity: 1.0 },
        DEFAULT: { visible: true, name: 'default', color: new THREE.Color(0.3, 0.6, 0.6), opacity: 1.0 },
    },
 DISCRETE : {

        0: { visible: true, name: '0', color: new THREE.Color('rgb(67, 99, 216)'), opacity: 1.0 },
        1: { visible: true, name: '1', color: new THREE.Color('rgb(60, 180, 75);'), opacity: 1.0 },
        2: { visible: true, name: '2', color: new THREE.Color('rgb(255, 255, 25)'), opacity: 1.0 },
        3: { visible: true, name: '3', color: new THREE.Color('rgb(145, 30, 180)'), opacity: 1.0 },
        4: { visible: true, name: '4', color: new THREE.Color('rgb(245, 130, 49)'), opacity: 1.0 },
        5: { visible: true, name: '5', color: new THREE.Color('rgb(230, 25, 75)'), opacity: 1.0 },
        6: { visible: true, name: '6', color: new THREE.Color('rgb(66, 212, 244)'), opacity: 1.0 },
        7: { visible: true, name: '7', color: new THREE.Color('rgb(240, 50, 230)'), opacity: 1.0 },
        DEFAULT: { visible: true, name: 'default', color: white, opacity: 1.0 },
    },
};

WDYT ?

The discrete cheme is indeed a scheme for point classification. But ClassificationScheme is for the 'classification' point classification. That's the reason why there is 2 differentes schemes, One for the classification using point classification and an other one for all the other (return number, type of return etc...). We can imagine that in a future (or a user) want to have different discrete scheme: one for the type of return and another one for the point source ID.

@ftoromanoff
Copy link
Contributor Author

ftoromanoff commented May 23, 2024

@AnthonyGlt Can you start a review, and validate it if you have no remarks on the code ?
Thks

@ftoromanoff ftoromanoff merged commit af4d061 into iTowns:master May 24, 2024
9 checks passed
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.

[BUG] Transparent individual pointcloud classes don't get rendered as transparent
3 participants