Reflections #218
Replies: 5 comments 5 replies
-
|
i also thought same and tried using portals onto scenes with reflected geometry. ( too old to be any use other than a suggestion) i remember having issues with support for reflected geometry, i was scaling by negative one, might work now. |
Beta Was this translation helpful? Give feedback.
-
|
Neat!
This may not be appropriate for the water use case, but rather mirrors:
https://doc.x3dom.org/tutorials/lighting/mirror/example.html
... re fidelity:
there are also deeper physics that could be modelled as seen in the recent webgpu demo
…________________________________
From: vralexllobet ***@***.***>
Sent: Monday, March 16, 2026 3:32:15 PM
To: create3000/x_ite ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [create3000/x_ite] Reflections (Discussion #218)
I've been messing around a bit with this code.
It's a combination of the TextureCoordinateGenerator and a reflection code that Holger posted here on reflections.
You can see a copy of the cube and box below to plane to mimic what a reflection should look like.
I think that the concept of creating an image on the plane and have it change as you move the viewpoint around is what would be needed. Currently, the mode "SPHERE-REFLECT-LOCAL" creates a spherical image onto the plane.
I'll play more with this as I have time.
You can paste this into the playground and see what I mean...
`#X3D V4.0 utf8 X_ITE V14.0.8
PROFILE Interchange
COMPONENT CubeMapTexturing : 3
COMPONENT EnvironmentalSensor : 3
COMPONENT Scripting : 1
META "created" "Wed, 17 Sep 2025 13:34:20 GMT"
META "creator" "Holger Seelig"
META "generator" "Sunrize X3D Editor V1.10.0, https://create3000.github.io/sunrize/"
META "modified" "Wed, 17 Sep 2025 13:38:08 GMT"
WorldInfo {
metadata DEF Sunrize MetadataSet {
name "Sunrize"
reference "https://create3000.github.io/sunrize/"
value DEF GridTool MetadataSet {
name "GridTool"
reference "https://create3000.github.io/sunrize/"
value DEF visible MetadataBoolean {
name "visible"
reference "https://create3000.github.io/sunrize/"
value TRUE
}
}
}
}
Viewpoint {
description "Initial View"
position 2.869677 3.854335 8.769781
orientation -0.7765887 0.6177187 0.1238285 0.5052317
}
EnvironmentLight {
specularTexture ImageCubeMapTexture {
url ***@***.***/src/images/helipad.avif"
}
}
DEF Things Group{
children[
DEF Box Transform {
translation -2 2 0
children Shape {
appearance DEF _1 Appearance {
material PhysicalMaterial {
baseColor 1 1 0 # 0.6460996 0.6460996 0.6460996
metallic 1 # 0.9156661
roughness 0 # 0.1978575
}
}
geometry Box { }
}
}
DEF Sphere Transform {
translation 1 2 0
children Shape {
appearance USE _1
geometry Sphere { }
}
}
]
}
Transform{
#translation 0 -4 0
scale 1 -1 1
children[
USE Things
]
}
#plane
Shape{
appearance Appearance{
material PhysicalMaterial {
baseColor 1 1 0 # 0.6460996 0.6460996 0.6460996
metallic 0.9
roughness 0.01
transparency 0.3
}
texture GeneratedCubeMapTexture {
update "ALWAYS"
}
}
geometry IndexedFaceSet{
texCoord DEF TexCG TextureCoordinateGenerator {
mode "SPHERE-REFLECT-LOCAL"
parameter [ 1, 1, 1, 1 ]
}
coord Coordinate{
point[ 10 0 10, 10 0 -10, -10 0 -10, -10 0 10 ]
}
coordIndex[
0 1 2 3 -1
]
}
}
DEF PS ProximitySensor {
size 200 200 200
}
DEF ReflectionScript Script {
inputOnly SFVec3f set_position
outputOnly MFFloat parameter_changed
url "ecmascript:
function set_position (value, time)
{
parameter_changed [0] = value.y ** 0.8 ;
parameter_changed [1] = value.x * 0.4 ;
parameter_changed [2] = value.y * 1;
parameter_changed [3] = value.z * 0.4;
}
"
}
ROUTE PS.position_changed TO ReflectionScript.set_position
ROUTE ReflectionScript.parameter_changed TO TexCG.set_parameter `
—
Reply to this email directly, view it on GitHub<#218 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB2TSMZQ7SRA4PVU2BICB234RBJD7AVCNFSM6AAAAACWJSM44GVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTMMJWGUZDMMI>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
I'm already working on creating a RenderedTexture, and it's working really well so far. I think we can have it ready for the next release, and there will be an example included. Since Castle and X3DOM also have a RenderedTexture node, I think there's a good chance it will be included in the standard. |
Beta Was this translation helpful? Give feedback.
-
The latest version of X_ITE now includes the new RenderedTexture node. Description RenderedTexture is a texture rendered from a specified viewpoint in the 3D scene. This can be used for a wide range of graphic effects, the most straightforward use is to make something like a "security camera" or a "portal", through which a player can peek what happens at a other place in 3D world, or to make a mirror. Documentation for the Node https://create3000.github.io/x_ite/components/texturing/renderedtexture/ Example file in X_ITE Playground Best regards, |
Beta Was this translation helpful? Give feedback.
-
|
I updated the example at https://github.com/create3000/media/tree/main/docs/examples/Texturing/RenderedTexture to contain a Mirror proto now, which does all the calculations for the mirror viewpoint and the heavy stuff for the texture matrix. This proto can be used and should work in other environments as well. |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
Is there a way of creating realistic reflections on shapes?
For instance, let's say we have a reflective plane with a box and a sphere sitting on top of it.
Can we make the box and sphere reflect onto the plane?
Also, can the box and sphere show reflections of each other if they are reflective also?
I'm just trying to create more realistic looking worlds and I feel that reflections would make the world look so much better.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions