How can I get for example the Google 3D Photorealisitc Tileset transparent. I want to build an underground map. I created a new material with the CesiumDefaultTileshader and reduced the Alpha Channel and put it into the opaque material field but it doesn’t work. Is there an option? In CeisumJr you can use Cesium.Cesium3DTileStyle. How can I adress this in Unity?
Hi @ErtiG, welcome to the community!
I have a feeling it doesn’t work because there is an only an option for changing opaque materials on the tileset. Support for translucent materials has not been added, but we have a Github issue open for the future.
However, there may be workarounds we can find. What settings did you change on the material? If you can share what you did, we’ll try to replicate your results and keep exploring from there. Thanks!
Hi @janine, I managed to make a new shader supporting URP. The google 3d tileset is now transparent. Thank you
Shader “Universal Render Pipeline/Custom/TransparentShaderURP”
{
Properties
{
_BaseMap(“Base Map”, 2D) = “white” {}
_BaseColor(“Base Color”, Color) = (1,1,1,0.5)
}
SubShader
{
Tags { “RenderType”=“Transparent” “Queue”=“Transparent” }
LOD 200Pass { Blend SrcAlpha OneMinusSrcAlpha Cull Off ZWrite Off HLSLPROGRAM #pragma vertex vert #pragma fragment frag #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" TEXTURE2D(_BaseMap); SAMPLER(sampler_BaseMap); half4 _BaseColor; struct Attributes { float4 positionOS : POSITION; float2 uv : TEXCOORD0; }; struct Varyings { float4 positionHCS : SV_POSITION; half2 uv : TEXCOORD0; }; Varyings vert(Attributes IN) { Varyings OUT; OUT.positionHCS = TransformObjectToHClip(IN.positionOS); OUT.uv = IN.uv; return OUT; } half4 frag(Varyings IN) : SV_Target { half4 baseColor = _BaseColor * SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, IN.uv); return baseColor; } ENDHLSL } } FallBack "Hidden/InternalErrorShader"
}