How to use ImageCubeMapTexture to reflect on surfaces
Hi All, This is not an issue. Just a question. I'm posting this question here because I don't know where else on the internet to post where there are knowledgeable people.
In my world, I have some shinny metallic surfaces like brushed aluminum or steel. What I'd like to do is to have a cube map with blue sky, maybe some clouds and maybe buildings. I can build that. I'd like to be able to reflect this map off of a metallic surface such as brushed metal. So basically, no detail would be necessary as would be of a reflection off of a mirror.
Right now, all I have is a surface that reflects the directional light as a bright area when the angle is right. But when the angle is away from the light reflection, the metallic surface reflects black color.
I see you have reflected imaged in your ComposedCubeMapTexture and GeneratedCubeMapTexture components. But they seem to use Shaders which I don't understand yet.
My question is... is there a simple way to reflect the cube image off of a shiny surface?
Thank you!
That's where PhysicalMaterial and EnvironmentLight come into account. Below is a simple example scene. Modify baseColor, metallic and roughness as you like.
The image to reflect is set as specularTexture of the EnvironmentLight, and here in panorama format.
See Also https://create3000.github.io/x_ite/components/lighting/environmentlight/ https://create3000.github.io/x_ite/components/shape/physicalmaterial/
#X3D V4.0 utf8 X_ITE V12.0.8
PROFILE Interchange
COMPONENT CubeMapTexturing : 3
Viewpoint {
description "Initial View"
position 2.869677 3.854335 8.769781
orientation -0.7765887 0.6177187 0.1238285 0.5052317
}
EnvironmentLight {
specularTexture ImageCubeMapTexture {
url "https://cdn.jsdelivr.net/npm/[email protected]/src/images/helipad.avif"
}
}
DEF Box Transform {
translation -2 -0 0
children Shape {
appearance DEF _1 Appearance {
material PhysicalMaterial {
baseColor 0.6460996 0.6460996 0.6460996
metallic 0.9156661
roughness 0.1978575
}
}
geometry Box { }
}
}
DEF Sphere Transform {
translation 1 0 0
children Shape {
appearance USE _1
geometry Sphere { }
}
}
Thanks so much Holger! This is exactly what I was looking for.
Added Discussions to repo. This is a place for Questions & Answers.
https://github.com/create3000/x_ite/discussions