As one can see, I am using baked lighting in my Unity Scene and have two reflection probes set to custom and baked into the scene. In Unity, the reflection looks great, where I am also using some Volume PoP features, such as tonemapping and white balance. For the Glass material, I am just using a basic transparent Unity material with alpha set to 0 and faking the glossiness. Even though the lightmap is baked, the results do not seem the same as in the Unity scene.
Hi Samsmeep, this discrepancy is common when moving from Unity’s baked lighting workflow to Needle Engine’s Three.js‑based renderer. In Unity, your baked reflection probes combined with the Volume Post Processing (tone mapping, white balance, etc.) simulate glossy reflections quite effectively, but when you export your scene to the web the baked lightmap won’t automatically recreate that specular gloss.
In Needle Engine the baked lightmap usually only affects the diffuse contribution. To get proper glossy and reflective effects on glass, you’ll need to assign an actual environment cubemap to your material and use a physically based material that supports clear reflections. For example, instead of relying on a basic transparent material, you can use Three.js’s MeshPhysicalMaterial that offers transmission and clearcoat properties to mimic glass. You can load your baked reflection probe’s cubemap (or a similar environment texture) via a CubeTextureLoader and assign it to the material’s envMap. Then adjust roughness and clearcoatRoughness to simulate the subtle glossiness you saw in Unity.
Here’s an example Needle Engine component written in TypeScript:
import { Behaviour } from "@needle-tools/engine";
import { MeshPhysicalMaterial, CubeTextureLoader } from "three";
export class GlassReflectionMaterial extends Behaviour {
awake() {
const renderer = this.gameObject.getComponent("MeshRenderer");
if (!renderer) return;
// Create or update the material to a MeshPhysicalMaterial.
let material = renderer.material;
if (!(material instanceof MeshPhysicalMaterial)) {
material = new MeshPhysicalMaterial({
transparent: true,
opacity: 0.5,
transmission: 1, // Enables real-world glass transmission
roughness: 0.05, // Low roughness for high gloss
metalness: 0,
clearcoat: 1, // Adds a clear reflective coating
clearcoatRoughness: 0.1,
});
renderer.material = material;
}
// Load your environment cubemap for accurate reflections.
const loader = new CubeTextureLoader();
loader.load([
'/path/px.jpg', '/path/nx.jpg',
'/path/py.jpg', '/path/ny.jpg',
'/path/pz.jpg', '/path/nz.jpg'
], (cubeTexture) => {
material.envMap = cubeTexture;
material.envMapIntensity = 1;
material.needsUpdate = true;
});
}
}
Keep in mind that the tone mapping and white balance differences are also due to the different render pipelines. In Needle Engine you may need to adjust your post‑processing settings to closely match Unity’s Volume PoP effects. You can do this via Needle Engine’s post‑processing components or directly in the Three.js renderer settings (for instance, by setting the appropriate tone mapping and exposure values as noted in recent changelog updates at CHANGELOG.md).
By combining a physically‑based material, an accurate environment map, and properly configured post‑processing, you’ll get much closer to the glossy glass look you achieved in Unity.
Let me know if you need any more help!
1 replies left - Become PRO for more replies.
thread_xmv2huo3WAJo3NXAlX0DbzF5
Reply to this post directly if you need further help (bottom right button)
I recommend using proper PBR materials if you want to get realistic results. Unity, not having proper opacity support, has various workarounds in place to get close, but making proper glass surfaces is not really possible in URP/BiRP.
It is though, in UnityGLTF and Needle, so I recommend you read this section: GitHub - KhronosGroup/UnityGLTF: Runtime glTF 2.0 Loader for Unity3D
The UnityGLTF/PBRShader for any material in Unity 6 shows magenta color under URP and converting it shows having no convertor available.
Please reimport the UnityGLTF package, or check if you have other script errors in your projects. UnityGLTF is well tested under all Unity 6 versions. If it still doesn’t work, open an issue at that repo please (GitHub - KhronosGroup/UnityGLTF: Runtime glTF 2.0 Loader for Unity3D).