XEffects - (Indoor Soft-Shadows + Post-Processing)
Sorry I haven't had much time to work on this, I'll get those improvements in. As for the WaterSceneNode, both this and the water use 2 passes in their rendering process, so this might be interfering with each other. If you could post some code about how and when you are updating each one that would be great. (You might need to update the effectwrapper twice, for the reflections and for the final output).
Cheers
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
The RealisticWaterSceneNode updates automatically. I tried to replace every SceneManager->drawAll(); by effectsHandler->update(); but I get a DIRECT3D9 Failed error.
I'm using the original RealisticWaterSceneNode code, so I think you can take a look at it. And in my main loop, I just do a effectsHandler->update();
I'm using the original RealisticWaterSceneNode code, so I think you can take a look at it. And in my main loop, I just do a effectsHandler->update();
Did you know that you don't use #ifndef #define.. in your .h ?and that can generate horribles problems.
I had included 2 times you effectWrapper.h, and pass a day trying to find the errors that c++ compiler gives.
Just today, I found that I have two includes, and said "hey, it has nothing to do with this, this is resolved with the #ifndef" and then I saw that your files doesn't have them.
Is a little thing but with c++ compilers...
Good job again.
I had included 2 times you effectWrapper.h, and pass a day trying to find the errors that c++ compiler gives.
Just today, I found that I have two includes, and said "hey, it has nothing to do with this, this is resolved with the #ifndef" and then I saw that your files doesn't have them.
Is a little thing but with c++ compilers...
Good job again.
I'm not using header guards? How silly, I'll fix that also in the update (Coming soon).
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
- Posts: 86
- Joined: Thu Feb 14, 2008 7:30 pm
- Location: Portugal
just an idea
a few days ago i was a bit bored and decided to try a game in my linux box.
it's sauerbraten (cube 2 engine) and much to my surprise it had some interesting fetures, so i downloaded the cvs version and found even more interesting effects, so i searched throw the code and realised that it was basic and missed most of the 3d andlings file formats and animation when comparing with irrlicht, also there is no documentation and the code is non intuitive, but non the less it has correct normal mapping soft shadows, character overbright, bloom, water with refraction, reflexion and caustic, grass, etc... another thing is it uses enet and with a very stable implementation, it uses sdl sound and its is extremely fast (disabeling some shaders it runs on my old ati 9100 igp) and runs at max on my GF6200LE
anyway i am posting this here because i think sauerbraten source code (zlib style lisence) from cvs could be usefull to port some of the effects to irrlicht (soft shadows could make a good adiction the xeffects with more option to select pre computed shadows or volumetric shadows) this could bring irrlicht more close to the popular graphics engines and also some game engines even irrlicht being just a graphics engine in relation to high quality effects (has for mesh manipulation, conpreensive code and easy to use and implement irrlicht is perfect has it is). i'll be trying to do it myself (but i am not has skilled has most of the developers here and also i only develop in linux witch means no directx support)
note: the main developer worked on far cry fom crytech and some effects resemble the light effects on crysis, try the lvl fanatic_caves with full effects turned, light bloom set to 140 and walk arround the map on to see what i mean.
it's sauerbraten (cube 2 engine) and much to my surprise it had some interesting fetures, so i downloaded the cvs version and found even more interesting effects, so i searched throw the code and realised that it was basic and missed most of the 3d andlings file formats and animation when comparing with irrlicht, also there is no documentation and the code is non intuitive, but non the less it has correct normal mapping soft shadows, character overbright, bloom, water with refraction, reflexion and caustic, grass, etc... another thing is it uses enet and with a very stable implementation, it uses sdl sound and its is extremely fast (disabeling some shaders it runs on my old ati 9100 igp) and runs at max on my GF6200LE
anyway i am posting this here because i think sauerbraten source code (zlib style lisence) from cvs could be usefull to port some of the effects to irrlicht (soft shadows could make a good adiction the xeffects with more option to select pre computed shadows or volumetric shadows) this could bring irrlicht more close to the popular graphics engines and also some game engines even irrlicht being just a graphics engine in relation to high quality effects (has for mesh manipulation, conpreensive code and easy to use and implement irrlicht is perfect has it is). i'll be trying to do it myself (but i am not has skilled has most of the developers here and also i only develop in linux witch means no directx support)
note: the main developer worked on far cry fom crytech and some effects resemble the light effects on crysis, try the lvl fanatic_caves with full effects turned, light bloom set to 140 and walk arround the map on to see what i mean.
I guess theres a bug, I'll have to take a closer look at another time. In the meantime, feel free to look through my source and point out anything suspicious.
Cheers
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Just tried your demo on my new machine (Vista 64 with a GeForce 9800GX2)
It work really well.
Here is a screenshot with a 4096 pixel shadow map and the filtering at the maximum (16PCF)
DirectX 9.0
OpenGL
Have someone have ideas about the FPS rate on a GeForce 7600?
Have this been tried with Normal maps? (From the thread seem to have a little problem with bump maps, so perhaps normal maps are affected as well)
It work really well.
Here is a screenshot with a 4096 pixel shadow map and the filtering at the maximum (16PCF)
DirectX 9.0
OpenGL
Have someone have ideas about the FPS rate on a GeForce 7600?
Have this been tried with Normal maps? (From the thread seem to have a little problem with bump maps, so perhaps normal maps are affected as well)
-
- Posts: 86
- Joined: Thu Feb 14, 2008 7:30 pm
- Location: Portugal
if i remember correctly what blindside said, xeffects are not integrated with the irrlicht shaders inside the engine therefore until someone get the time to do it will only work with post process shaders applyed over xeffects (ex: tgm shader pack). from what i understand it has something to do with the textures, both xeffects and the irrlicht (normal, bump or parallax mapping, maybe some others too) works by modifying and reapplying the textures so the 2nd applyed shader will completly mess up what the 1st applyed shader has done resulting in either no change on the image, a messed up image or no image at all.
Ok small update, the "update()" function now takes an (optional) parameter for the output rendertarget. Before it would carelessly render to the backbuffer, but now you are free to specify what rendertarget you want to output to. If you don't use this parameter, it will just output to the backbuffer, so you can still use it exactly the same way as before.
I also added a new method "setPostProcessingUserTexture" to allow the user to specify a 4th custom texture to be used in post-processing effects. This allows things beyond trivial multiple blur style post-processing effects, and may be used for things such as a random texture for offsetting lookups or a screen overlay.
Here are some important things to note:
- Any material scene node can be used in EMT_CAST only mode, as the scene node itself only casts shadows, it does not need its material modified for shadow rendering.
- There is an easy way to have the entire scene shadowed regardless of what material is used (Normalmapping, bumpmapping, even a custom shader.):
You see, I added the features from before (A custom output texture in update() and a custom user texture in post-processing) specifically because, if you do the rendering in two passes, and combine the shadowed output with the original output, you can get over the different material type limitations and use any material you wish. I may add a specific method for this later, but it is possible to do this yourself using the current version.
Basically you:
- Render the normal shadow mapping output using white textures, and pass a screen-size render target as the parameter to "update()" (The black/white shadow and lighting will be outputted to this texture.)
- Render your scene nodes again using any materials, setting the textures back to normal.
- Set the render target you used before as the post-processing user texture.
- Combine the two textures by multiplying in a post-processing pass.
It may be a little fiddly to get working at first (Alot of setting/unsetting of textures/materials etc), so I'll post a clear example based on the 08.SpecialFX example when I have time. (Or better yet make a new XEffects version specifically for this multiple-pass technique).
Good luck.
I also added a new method "setPostProcessingUserTexture" to allow the user to specify a 4th custom texture to be used in post-processing effects. This allows things beyond trivial multiple blur style post-processing effects, and may be used for things such as a random texture for offsetting lookups or a screen overlay.
I think dlangdev is being sarcastic here about it being a bug (But it is hard to tell with him sometimes ). What he is actually saying is that he would like a feature to allow shadowing on bumpmapped objects (Currently I only implemented materials for solid, detailmap and lightmapped.).Have this been tried with Normal maps? (From the thread seem to have a little problem with bump maps, so perhaps normal maps are affected as well)
Here are some important things to note:
- Any material scene node can be used in EMT_CAST only mode, as the scene node itself only casts shadows, it does not need its material modified for shadow rendering.
- There is an easy way to have the entire scene shadowed regardless of what material is used (Normalmapping, bumpmapping, even a custom shader.):
You see, I added the features from before (A custom output texture in update() and a custom user texture in post-processing) specifically because, if you do the rendering in two passes, and combine the shadowed output with the original output, you can get over the different material type limitations and use any material you wish. I may add a specific method for this later, but it is possible to do this yourself using the current version.
Basically you:
- Render the normal shadow mapping output using white textures, and pass a screen-size render target as the parameter to "update()" (The black/white shadow and lighting will be outputted to this texture.)
- Render your scene nodes again using any materials, setting the textures back to normal.
- Set the render target you used before as the post-processing user texture.
- Combine the two textures by multiplying in a post-processing pass.
It may be a little fiddly to get working at first (Alot of setting/unsetting of textures/materials etc), so I'll post a clear example based on the 08.SpecialFX example when I have time. (Or better yet make a new XEffects version specifically for this multiple-pass technique).
Good luck.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Thanks Blindside. So it could work as a "pre-render" solution (as it create some kind of "realtime" ligthmap? (From what I can understand)
If I could use it, I would like to use it with the IRRcg (Normal maps).
I would like to have shadowing with normal mapped models (and some static meshes that have pre-rendered lightmaps (occlusion shading perhaps). I plan to use normal mapping on everything in my project.
(Millions poly details environnement & character baked in a normal maps), so the detail would look great.
My first prototype would not use that, but I really plan to use that in the next release of the prototype.
If I could use it, I would like to use it with the IRRcg (Normal maps).
I would like to have shadowing with normal mapped models (and some static meshes that have pre-rendered lightmaps (occlusion shading perhaps). I plan to use normal mapping on everything in my project.
(Millions poly details environnement & character baked in a normal maps), so the detail would look great.
My first prototype would not use that, but I really plan to use that in the next release of the prototype.