Page 1 of 1

Cube Map support

Posted: Mon Apr 18, 2011 12:09 am
by elvman
I am planning to create patch for Irrlicht to add cube map support (I guess I will call it ITextureCube, similarly as in IrrSpintz). I do it to improve my Realistic Water Scene Node (more realistic reflections).

To start working on it I should hear your suggestions (and maybe code snippets to do it faster) on how to add them.

Should I add getTexture method to IVideoDriver that takes 6 string parameters (one filename for each face) and returns ITextureCube*? Maybe you have other suggestions?

Later, when the cube map support is complete, I am planning to add CubeMap RTTs. I would like this thread to be a place for your ideas and suggestions about cube maps.

Posted: Mon Apr 18, 2011 12:22 am
by stefbuet
I don't see the point in using environment mapping for large surfaces as water?

Posted: Mon Apr 18, 2011 12:26 am
by elvman
I can't think of any other method for making sky reflections (whole sky, not only sun) like this without cube maps:
Image

Posted: Mon Apr 18, 2011 1:16 am
by elvman
I thought of the name for method and concluded, that the name should be addTextureCube, which takes 1 or 6 strings. If 1 string is given, then it is cubemap dds file.

Posted: Mon Apr 18, 2011 10:14 am
by Mel
http://irrlicht.sourceforge.net/phpBB2/ ... t=cube+map

That is a valid way to have cubemaps in your renders. While it is not the best, because it consumes more shader time than the regular tex3D op, it is a good alternative.

I only warn one thing if you plan on using it. Disable the mipmapping on the texture which acts as cubemap, or else you will have black seams on the borders.

I never could point to the reason because it happens, clamping the texture coordinates or shifting them to safe places didn't work. The only way to get rid of them is to disable the mip mapping.

Or else, have you ever thought of doing the reflective effects using dual paraboloid maps? more people here can tell you about them.

Although, having true cubemap support in irrlicht would be mostly welcome.

Posted: Mon Apr 18, 2011 2:58 pm
by Midnight
Mel wrote:"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Off-topic and I don't know if you realise it, but that's actually not a quote at all, it's a joke, which you have misstated.

The real version which you're more than welcome to change to if you like, not that hold the keys to begin with.

Carlson's Consolation: Nothing is ever a complete failure; it can
always serve as a bad example.

I'm pretty sure I saw it on a Murphy's Law poster once. That is all, good day coders.

edit: I take it back I also wanted to mention that I believe his name is Arthur J. Schmitt rather than Arthur A. Schmitt. And there inlay the irony which provoked me.

Posted: Mon Apr 18, 2011 11:31 pm
by stefbuet
I've never done water shading but I thought using an environment mapping would give bad results as it's supposed to be physically correct for 1 position only (so acceptable for relativly small objects) but maybe I'm wrong because I'm seeing it from a dual paraboloid point of view instead of a cube map one. What's the matter with the camera flip to render the reflexions?

Re: Cube Map support

Posted: Thu Jan 17, 2013 5:04 pm
by robmar
How´s the patch going? Would be a nice feature.

Re: Cube Map support

Posted: Thu Jan 17, 2013 5:59 pm
by hybrid
The patch was already almost in the engine, but since we changed too much in the texture interface, it failed to catch up with the development. So we need to update some things with textures first, and then re-apply it here. So still some concepts missing, but the base is quite good.

Re: Cube Map support

Posted: Thu Jan 17, 2013 8:50 pm
by Nadro
Texture interface improvements will be my next task after I finished OGLES2 driver. Be patient :)

Re: Cube Map support

Posted: Thu Jan 31, 2013 10:45 am
by elvman
Nadro wrote:Texture interface improvements will be my next task after I finished OGLES2 driver. Be patient :)
I am really glad to hear that.