Well every little bit helps, and it doesn't hurt to give some other type than what is asked. And it also isn't like it hasn't been asked, and explained, on gamedev.net.Dorth wrote:That is nice. But I think he pretty much asked for a textual description, not a visual demo.
Virtual Cubemapping demo
Halifax, I usually like your help. But saying it's been explained elsewhere is like saying google it, rtfm, or anything like that. It is not a useful comment and unless someone clearly shows he hasn't tried anything to find the info or is rude about it, you should give the minimal help. My take on it anyway
I understand your take on it, and I am just providing my abilites. I am not going to sit here and BS like I know the exact details (so I provided a minimal place to find an explanation), but I have seen what it can do, and if I understand correctly it basically miminzes the calcluations for 360 degree lighting.Dorth wrote:Halifax, I usually like your help. But saying it's been explained elsewhere is like saying google it, rtfm, or anything like that. It is not a useful comment and unless someone clearly shows he hasn't tried anything to find the info or is rude about it, you should give the minimal help. My take on it anyway
It reduces the calcluations by taking away the need to use raycasting in your code by just projecting a cubemap on the scene, and making the shadow with that. It significantly reduces the calculations needed.
(That it is what I know to the best of my ability, feel free to correct me. (BlindSide))
And by the way, sorry Dorth, I will take your criticism in to min d next time. Thanks.
TheQuestion = 2B || !2B
Technical description:
Cubemap: A cubemap is a texture array packed with 6 textures, each one simulating the face of a cube.
Virtual Cubemap: Simulates a cubemap by sticking 6 textures into one big texture then offsetting the texcoords to simulate reading from the different sides.
Projected cubemap: Each side of the face is projected in a 90 degree FOV in each direction of the cube.
Nothing more, nothing less
Ok ok, heres some screenshots of the "360 shadowmaps". You can see they are quite different from the original:
The spheres are lights.
Cubemap: A cubemap is a texture array packed with 6 textures, each one simulating the face of a cube.
Virtual Cubemap: Simulates a cubemap by sticking 6 textures into one big texture then offsetting the texcoords to simulate reading from the different sides.
Projected cubemap: Each side of the face is projected in a 90 degree FOV in each direction of the cube.
Nothing more, nothing less
Ok ok, heres some screenshots of the "360 shadowmaps". You can see they are quite different from the original:
The spheres are lights.
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
Yes, demo is crash on startup, only Win98/WinNT mode demo work properly. looks very good:)BlindSide wrote:This is an OpenGL app. What kind of problem happens? Does it crash? I would really appreciate any info regarding this. Thanks.Nadro wrote:I can't run this demo... I have problems with Your DirectX apps BlindSide (with this demo and the latest XEffects in DX mode) OpenGL apps work without problems This is maybe cause by my drivers for HD2600 for AGP:P But demo on screenshot looks very good:) Good work BlindSide!
This is Irrlicht OpenGL RTT problem. Radeon series lower than 2xxx hasn't got depth and stencil texture support (this textures are use in Irrlicht OpenGL RTT process). I put patch for improve it in this topic:BlindSide wrote:Please note: On ATI cards this demo runs a 512x512 texture because ATI cards seem to have poor framebuffer support (Or atleast my 200M does ). Nvidia cards run at a full 1024x1536 (Giving 512x512 for each face of the cubemap.).
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=25469
I replace depth and stencil textures by renderbuffer. With OpenGL renderbuffer all works properly:)
Thanks BlindSide. New demo look very interesting:) I'm waiting for download link
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
wow... i want to try the demo.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
Nice work Blind Side
Just one question to second screenshot with multiple lights: There is something wrong with light in the scene as well as color of shadows ...shadows are colored while they should have no color since shadows are places where no light from lightsource reach. So yellow light should not project yellow shadow but the dark one.
And on the opposite side, there are three lights: yellow, blue and white ...but scene is lit as if they combine in to white color which they should not. Yellow+blue+white=light green.
Just curious...
Just one question to second screenshot with multiple lights: There is something wrong with light in the scene as well as color of shadows ...shadows are colored while they should have no color since shadows are places where no light from lightsource reach. So yellow light should not project yellow shadow but the dark one.
And on the opposite side, there are three lights: yellow, blue and white ...but scene is lit as if they combine in to white color which they should not. Yellow+blue+white=light green.
Just curious...
I've already applied your multi-largertt-fpptextures-mrt-etc patch a long time ago (Although I haven't used any of those features in this demo) and I think that this was already fixed in there, but I'll look into it and make sure the sources match up with the ATI FBO patch, Thanks.Nadro wrote: This is Irrlicht OpenGL RTT problem. Radeon series lower than 2xxx hasn't got depth and stencil texture support (this textures are use in Irrlicht OpenGL RTT process). I put patch for improve it in this topic:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=25469
I replace depth and stencil textures by renderbuffer. With OpenGL renderbuffer all works properly:)
Thanks BlindSide. New demo look very interesting:) I'm waiting for download link
The new demo might come soon, there is still alot of polish to do.
I'm sorry but you are completely confused . If you look closer at the shadows, you will notice that the yellow ball casts the BLUE shadow, and that the blue ball casts the YELLOW shadow.arras wrote: Nice work Blind Side Smile
Just one question to second screenshot with multiple lights: There is something wrong with light in the scene as well as color of shadows ...shadows are colored while they should have no color since shadows are places where no light from lightsource reach. So yellow light should not project yellow shadow but the dark one.
And on the opposite side, there are three lights: yellow, blue and white ...but scene is lit as if they combine in to white color which they should not. Yellow+blue+white=light green.
Just curious...
That is because I am using an additive technique that sums up all lights, this closely represents how lights work in real life. The shadowed areas are still lit by lights in which they are not in shadow from.
About the colour, when there are enough lights, the intensity is strong so it is capped at white, as there is no other colour to represent such greater brightness (Maybe I can use a higher multiplication effect at the end to represent over-brightness). Also remember that yellow and blue != green, this only applies to ink-based colours.
Thanks for the comments, everyone.
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
Excellent work! I've been working on soft shadow mapping myself (Ogre ), and have a few questions:
- you're using PCF, right? Any specifics to avoiding sampling the wrong "virtual face" with the PCF filter?
- does this require PS3.0? I'd assume so, since you're probably using some kind of dynamic branching for the "virtual face" selection. I take it you just take the highest component of the light-to-vertex vector to figure the "virtual face" (+/- X/Y/Z), and then offset the texture coordinate based on which face you're using? Mind sharing a bit of an explanation here? I'd try stuff out right now, but I'm away from my coding environment for a while, and am really itching .
- not sure if you mentioned this, but what resolution is the shadow map you're rendering to? For some good resolution shadow textures, wouldn't you need 6x1024^2? Mind rendering the shadow texture to an onscreen quad so we can see what it looks like ?
- about your shadow mapping... won't it be tied to your own shader? If you were to use a specialized shader (for example, you wrote some special "sparky" shader or whatever for some game object), you'd need to manually recreate all of the shadowing/filtering code, amiright?
Either way, like I said: looks great!
- you're using PCF, right? Any specifics to avoiding sampling the wrong "virtual face" with the PCF filter?
- does this require PS3.0? I'd assume so, since you're probably using some kind of dynamic branching for the "virtual face" selection. I take it you just take the highest component of the light-to-vertex vector to figure the "virtual face" (+/- X/Y/Z), and then offset the texture coordinate based on which face you're using? Mind sharing a bit of an explanation here? I'd try stuff out right now, but I'm away from my coding environment for a while, and am really itching .
- not sure if you mentioned this, but what resolution is the shadow map you're rendering to? For some good resolution shadow textures, wouldn't you need 6x1024^2? Mind rendering the shadow texture to an onscreen quad so we can see what it looks like ?
- about your shadow mapping... won't it be tied to your own shader? If you were to use a specialized shader (for example, you wrote some special "sparky" shader or whatever for some game object), you'd need to manually recreate all of the shadowing/filtering code, amiright?
Either way, like I said: looks great!
Right now I'm post-blurring the shadows in screen space, so its not a problem. However I've used PCF with it before and I didnt notice any problems there either, probably because I clamp my coordinates so that the filtering doesnt reach other faces of the cube.agi_shi wrote:Excellent work! I've been working on soft shadow mapping myself (Ogre ), and have a few questions:
- you're using PCF, right? Any specifics to avoiding sampling the wrong "virtual face" with the PCF filter?
This should work fine on PS 2.0. I've tested the Virtual Cubemapping on my ATI 200M and it ran fine.agi_shi wrote: - does this require PS3.0?
This is all adjustable. Cubemaps dont seem to suffer as much from aliasing because all maps are captured in a single direction at exactly 90 degrees FOV, this makes things like the edges of the pillars perfectly straight and so line up nicely. Right now I am using the sizes mentioned on the first post, and I also tried 6x1024^2 but I didnt notice too much of a visual improvement.agi_shi wrote: - not sure if you mentioned this, but what resolution is the shadow map you're rendering to? For some good resolution shadow textures, wouldn't you need 6x1024^2? Mind rendering the shadow texture to an onscreen quad so we can see what it looks like ?
I would show you what the shadowmap looks like but it wouldn't tell you much because I am using 32-bit depth packing that uses all the colour components resulting in alot of randomly coloured pixels.
Not at all! This does the shadows in 2 passes, renders all the lights additively to the shadow buffer, then combines it with the colours of a fullbright scene in a post-processing pass.agi_shi wrote: - about your shadow mapping... won't it be tied to your own shader? If you were to use a specialized shader (for example, you wrote some special "sparky" shader or whatever for some game object), you'd need to manually recreate all of the shadowing/filtering code, amiright?
This means that the actual materials of the shadows and your own are completely seperate and you are free to use whatever materials you want and still cast/recieve shadows.
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
TrueIf you look closer at the shadows, you will notice that the yellow ball casts the BLUE shadow, and that the blue ball casts the YELLOW shadow.
Yes thats true ...when adding light colors together (mathematically speaking) yellow+green+white = white not green.That is because I am using an additive technique that sums up all lights, this closely represents how lights work in real life.
also true ...yellow (255,255,0) + blue(0,0,255) = white(255,255,255)yellow and blue != green, this only applies to ink-based colours
Ok ...keep it up BlindSide, good luck
B.T.W.: what it was with those ATI cards arrays and GLSL? Do you have some more info about it (I do have ATI myself and I am unable to pass array in to shader)
Those pics are so beautiful. Looks alot like shadowmapping, good job. Looks a little blur but I like it.
I'm wondering if Irrlicht will have cubemaps support soon(1-2 mths perhaps ), if not, I'm going to try to create something like this (I mean the cubemap) too when I find the time.
I've given up on shadows since my last PCF gives pockets of random artifacts.
Keep up the good work.
I'm wondering if Irrlicht will have cubemaps support soon(1-2 mths perhaps ), if not, I'm going to try to create something like this (I mean the cubemap) too when I find the time.
I've given up on shadows since my last PCF gives pockets of random artifacts.
Keep up the good work.