[x3d-public] RenderedTexture support

Michalis Kamburelis michalis.kambi at gmail.com
Tue Jan 16 15:14:57 PST 2018


 2018-01-16 18:15 GMT+01:00 Andreas Plesch <andreasplesch at gmail.com>:
> Hi Michalis,
>
> thanks. I am looking into the cubemap examples at
> https://github.com/castle-engine/demo-models but could not locate
> sofar a GeneratedCubeMapNode example.

See inside "cube_environment_mapping" subdirectory,
https://github.com/castle-engine/demo-models/tree/master/cube_environment_mapping
.

Quick grep shows that these scenes use GeneratedCubeMapTexture:

compositing_shaders/cellular_texturing_mirror_fun.x3dv
rendered_texture/rendered_texture_with_background.x3dv
water/water_shaders.x3dv
cube_environment_mapping/cubemap_generated_recursive.x3dv
cube_environment_mapping/cubemap_generated_in_dynamic_world.x3dv
water/water_shaders_and_fog.x3dv
water/caustics/Barna29.x3dv

Note that some of them (the ones using GLSL tricks) need to be opened
with the latest view3dscene from snapshots (
http://michalis.ii.uni.wroc.pl/view3dscene-snapshots/ ) in order for
everything to work 100%. We had a significant change of the shader
pipeline recently (
https://castle-engine.sourceforge.io/wp/2017/10/14/shaders-unification-phong-shading-bump-mapping-and-commonsurfaceshader-on-mobile-100-modern-rendering-on-desktop/
), and the GLSL code inside ComposedShader in demo-models was changed
to follow (the GLSL inside my "shader Effect nodes" survived it better
:) ).

>(I also get an openssl
> initialization error on win10 latest view3dscene and may file an
> issue).

Hm, that's weird. View3dscene should not deal with openssl now, we
don't open https links yet. (Although we will be able to open https,
as soon as I'll find the time to test it, see
https://castle-engine.sourceforge.io/planned_features.php ).

I don't have Windows 10 to test now, but I know of at least 2 of my
coworkers that definitely used view3dscene on Windows 10.

If you can reproduce, then please report it! Thank you.

[...]
> I did see a few copyTexSubImage2D() in the linked castle code but I
> did dive deep enough to put all together,
>
> gl.FramebufferTexture2D looks promising. I think what you are suggesting is:
>
> 1) create a fbo just for the cube map
> 2) bind the fbo
> 3) bind the cube map texture
> 4) use glFramebufferTexture2D to attach the rendered texture(s) to a face
> 5) unbind
>
> Hm, that would be great since it would be probably mean no further per
> frame operations necessary.
>

Yes.

I would say that in 4, we "4) use glFramebufferTexture2D to attach the
cubemap face as the FBO attachment". But I think we're thinking about
the same thing:)

Regards,
Michalis



More information about the x3d-public mailing list