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

Can 3dtiles support custom shaders? #7652

Closed
astroschen opened this issue Mar 15, 2019 · 8 comments
Closed

Can 3dtiles support custom shaders? #7652

astroschen opened this issue Mar 15, 2019 · 8 comments

Comments

@astroschen
Copy link

When I looked at the api, I didn't find that Cesium3DTileStyle supports custom shaders, or does 3dtiles itself not support shaders? Is there any other solution?

@hpinkos
Copy link
Contributor

hpinkos commented Mar 15, 2019

@lilleyse ?

@astroschen
Copy link
Author

hi @lilleyse , look here

@OmarShehata
Copy link
Contributor

@astoroschen in general, no, Cesium doesn't support letting you override the vertex/fragment shaders in 3D Tiles.

Most common effects can be done with either the 3D Tiles Styling language, or classification primitives. There's also a PR open to allow custom uniforms in the styling language to make it even more expressive #5380.

If your tiles are b3dm (batched 3d models), this thread has some pointers on what you'd need to do to override the shaders. It involves modifying the source a bit:

https://groups.google.com/d/msg/cesium-dev/z7892t42q4M/xhN1_pyrFAAJ

Can you tell us a bit more about what you're trying to do?

@OmarShehata
Copy link
Contributor

This is relevant, some screenshots of potential effects that might be hard to do just with the styling language:

https://groups.google.com/d/msg/cesium-dev/P7i9JVenzj8/JvLWlwsmBgAJ

@astroschen
Copy link
Author

这是相关的,一些可能很难用样式语言做的潜在效果的截图:

https://groups.google.com/d/msg/cesium-dev/P7i9JVenzj8/JvLWlwsmBgAJ

Hi @OmarShehata ,Thank you for your answer.
When I was writing the project, I noticed that there was such an effect on the Internet.
tilesshader
I just want to use shader to achieve, the result is not supported.
So, After reading your answer, I feel that it is impossible to achieve the effect on the gif picture. I don't know if you have any other good methods. :)
sincere thanks

@OmarShehata
Copy link
Contributor

Yeah I can't think of a straightforward way to do this right now with the public API in CesiumJS.

We have been looking more closely at what it would take to support custom materials on 3D Tiles. There's no definite timeline on it though. We can keep this issue opened, perhaps labelled as "enhancement" ?

@OmarShehata
Copy link
Contributor

I think this would be another good application of making an easier API for custom shaders. This user on the forum wants to be able to set a plane under which the model/geometry becomes slightly transparent:

Transparent

The use case is to be able to see "pipes underground", and while a similar thing can be achieved with clipping planes, in this case it's helpful to have the geometry still visible but transparent.

@ptrgags
Copy link
Contributor

ptrgags commented Mar 31, 2022

I just came across this issue. This has been possible for a few months now with CustomShader. See the Custom Shader Guide for how it works.

@ptrgags ptrgags closed this as completed Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants