Page 1 of 3

Environment Mapping with Irrlicht

Posted: Tue Dec 22, 2015 5:23 pm
by Mel
Long time i didn't release an irrlicht demo!....

Image

These are the results of my experiments with the spherical mapping. Actually, the advantages of using a single texture to generate environment maps are many, compared to the potential drawbacks (even if they are as little or ignoreable as this technique has) They can be stored on texture atlases and a single texture could be used to store many at the same time, without the need of texture arrays, for instance.

This demo also features IImage manipulation. An aspect that i think is overlooked on the main examples, as it is somehow left as a secondary tool, and a helper, as Irrlicht mainly focuses on the hardware drivers, leaving the software manipulation abandoned. For instance, a filtered 2D reading from the software images could be a nice feature to add. And many other things i sure forget to mention.

Also, there is code for both OpenGL and DirectX, so, in theory, the demo should be able to compile and run under any environment, i haven't provided any projects, only a windows executable, a compiled, unmodified, version of Irrlicht, the data directory, which just uses some of the media files from the Irrlicht distribution, and the source code in the source directory. Any part of it is freely useable.

http://omegasection.g0dsoft.com/backup/ ... rlicht.zip

Anyway! i hope you find them interesting!

Re: Environment Mapping with Irrlicht

Posted: Wed Dec 23, 2015 11:45 am
by thanhle
Hi Nice stuff,
This at the moment seems to work only on OpenGL NVidia graphic card. DirectX doesn't work, it said could not load D3DXAssemleShader from dll.

Intell card doesn't work in openGL nor DirectX. My graphic card is GTX 860M 4Gb.

Regards

Re: Environment Mapping with Irrlicht

Posted: Wed Dec 23, 2015 3:24 pm
by Mel
The source is there for you to compile your own version. If Irrlicht on DirectX works properly on your system you can try that :) Create a project on your preferred work environment (code::blocks, DevC++, Visual Studio Express...) add that source code, link the irrlicht library and you should be done with ease.

Anyway, i also would recomend you to install a DirectX9C redistributable because that DLL error seems to be more like a missing D3D9 lib.

Re: Environment Mapping with Irrlicht

Posted: Wed Dec 23, 2015 4:56 pm
by The_Glitch
Looks good works on my d3d9 driver. I'll look into this if it takes nadro along time to add cubemap support.

Re: Environment Mapping with Irrlicht

Posted: Thu Dec 24, 2015 1:26 am
by Mel
I hope you find my code useful. The cubemap support shouldn't be too hard to implement on DX either. The interfaces are ready, the only thing left is to write the proper cubemap generation.

Re: Environment Mapping with Irrlicht

Posted: Sat Jan 02, 2016 8:28 pm
by Vectrotek
I tried running the app, but my system says no go..(no permission).
I have Windows XP and Nvidia card. What is the problem?

Re: Environment Mapping with Irrlicht

Posted: Sun Jan 03, 2016 12:36 am
by Nadro
Hi Mel,

I see a following issue in OpenGL:
GLSL shader failed to compile
Fragment shader failed to compile with the following errors:
ERROR: 0:16: error(#143) Undeclared identifier: atan2
ERROR: 0:16: error(#202) No matching overloaded function found: atan2
ERROR: error(#273) 2 compilation errors. No code generated
Do you have a NV card? NV drivers are problematic for develop OpenGL...(atan2 isn't available in GLSL, this is the same situation like with a float4 etc, IIRC you can avoid those problems by adding '#version 110' or higher - NV drivers works better if you provide '#version').

Anyway this demo looks really nice, thanks for share it! :)

Cheers,

Re: Environment Mapping with Irrlicht

Posted: Mon Jan 04, 2016 4:13 pm
by devsh
using trigonometric functions in rendering code is a grave sin

Re: Environment Mapping with Irrlicht

Posted: Wed Jan 06, 2016 12:01 am
by chronologicaldot
devsh wrote:using trigonometric functions in rendering code is a grave sin
I guess that makes me the devil. lol. jk

Re: Environment Mapping with Irrlicht

Posted: Wed Jan 06, 2016 4:38 pm
by Mel
Trigonometrics are there for some reason, and so far i've never found a justification to the ATAN2 operation in shader language other than the spherical mapping.

In fact, it is perfectly posible to create another environment mapping solution which won't use the trigonometrics at all, and will look the same, the only diference would be the distribution of the pixels in the final skysphere, but the final result would be almost the same looking.

Re: Environment Mapping with Irrlicht

Posted: Sat Jan 09, 2016 11:20 pm
by Nadro
Maybe this will be helpful for someone here, so the latest trunk rev has support for cubemaps in both OGL and D3D9 :)

Re: Environment Mapping with Irrlicht

Posted: Sun Jan 10, 2016 3:32 pm
by Mel
Nice! I think it would be an important addition as well to create materials that used the cubemaps directly with the engine, so people at least knew there is support for them, but it is a great job, none the less :)

This, the support for flexible vertex formats, and the instancing would definitely cover some of the gaps that Irrlicht needs to fill.

EDIT:
By the way, this is USING CUBEMAPS, no extra stuff, no extra nothing. REAL cubemaps
Image

So, good work, NADRO! :)

I will release another demo as soon as I implement the other shaders :P

Re: Environment Mapping with Irrlicht

Posted: Sun Jan 10, 2016 6:33 pm
by Nadro
Thanks, good to see that it works fine :) At now shader-pipeline is slightly behind of trunk with features, however after v1.9 will be released (I hope that we'll be able to push this version soon) I immadiately merge changes from trunk to shader-pipeline or even maybe merge shader-pipeline into trunk.

BTW. In upcoming days I'll add support for load cubemaps directly from PVR files (IVideoDriver::getTexture).

Re: Environment Mapping with Irrlicht

Posted: Mon Jan 11, 2016 3:38 pm
by The_Glitch
Okay great looking forward to latest changes.

Re: Environment Mapping with Irrlicht

Posted: Wed Jan 13, 2016 5:29 am
by chronologicaldot
Yay! Thanks Nadro!