Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Help with custom shader water layer #2388

Open
d3vilsn0w opened this issue Mar 22, 2022 · 4 comments
Open

Help with custom shader water layer #2388

d3vilsn0w opened this issue Mar 22, 2022 · 4 comments

Comments

@d3vilsn0w
Copy link

Something like this.
#1854

Thanks

@d3vilsn0w
Copy link
Author

Screenshot 2022-03-22 at 5 46 52 PM

My output is like this currently
            theme: {
                extends: "resources/berlin_tilezen_base.json",
                styles: {
                    tilezen: [
                        {
                            layer: "water",
                            when: ["==", ["geometry-type"], "Polygon"],
                            renderOrder: 10000,
                            technique: "shader",
			                description: "water",
                            primitive: "mesh",
                            textureCoordinateType: "feature-space",
                            transparent: true,
                            params: {
                                vertexShader: `
                                varying vec2 vUv;
                                void main()
                                {
                                    vUv = uv;
                                    gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
                                }
                                `,
                                fragmentShader: `
                                varying vec2 vUv;
                                void main()
                                {
                                    vec2 p = vUv - 0.5;
                                    float r = sqrt(dot(p, p));
                                    gl_FragColor = vec4(0, r, r, r);
                                }
                                `
                            }
                        }
                    ]
                }
            }

@d3vilsn0w d3vilsn0w changed the title Does anyone have an example with three.js ocean? Help with custom shader water layer Mar 22, 2022
@d3vilsn0w
Copy link
Author

Screenshot 2022-03-22 at 7 39 19 PM

Shows something like that now. texture do not appear.

@nzjony
Copy link
Member

nzjony commented Mar 22, 2022

Does this help: #1854 (comment) ?

@d3vilsn0w
Copy link
Author

Does this help: #1854 (comment) ?

It did not help. i will try again later today. Keep you updated soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants