Page 3 of 4

Posted: Tue Feb 26, 2008 9:26 pm
by agi_shi
BlindSide wrote:...
Aha, interesting approach (gamedev article :D?). Never tried that way, myself. High quality stuff, I must say - very excellent job.

Posted: Wed Feb 27, 2008 3:10 pm
by BlindSide
I pretty much made everything up myself, using my own quirky techniques here and there. I even had the whole idea of a "texture atlas for cubemaps" on my own (Without knowing the terminology offcourse :P ), but only when John Carmack re-affirmed its possibility in his QuakeCon speech that I took it into further serious consideration. (All he said was "Dont use cubemaps, they have sucky support, stick everything on a big texture instead.")

No articles really helped me because even the Nvidia ones that use a texture atlas required a regular cubemap texture to provide texcoord, where as due to lack of cubemap capability I had to use my own method of generating them, this was simply 3 90 degree projection alongside each axis, and using the highest absolute value, inverting the y coord if its in the negative direction of the axis, etc.

Cheers

Posted: Sun Mar 09, 2008 11:56 pm
by agi_shi
Interesting. Can you explain the texture coordinate generation for the virtual cube map more in depth? I take it you use the vector from the light to the point being shaded (well, for omni light shadow mapping, that is)? Any specific code you can show (reason is, won't the final coords be "warped" by the 90 fov perspective)? I'm not really interested in code as much as a good, wholesome description :twisted:... also, how is your atlas organized (which direction goes where)? I appreciate any sort of description :)

Posted: Mon Mar 10, 2008 1:01 pm
by BlindSide
agi_shi wrote:Interesting. Can you explain the texture coordinate generation for the virtual cube map more in depth? I take it you use the vector from the light to the point being shaded (well, for omni light shadow mapping, that is)? Any specific code you can show (reason is, won't the final coords be "warped" by the 90 fov perspective)? I'm not really interested in code as much as a good, wholesome description :twisted:... also, how is your atlas organized (which direction goes where)? I appreciate any sort of description :)
how is your atlas organized
Haha the short answer is, not very. I just kept changing which viewport belonged to which camera until the correct textures fell into their places, I didn't really plan ahead which sides of the cube go where, though I should do it sometime to improve filtering. Press R in the demo to see the texture in fullscreen.
Any specific code you can show (reason is, won't the final coords be "warped" by the 90 fov perspective)?
I'm not on my main coding computer right now, but it basically involves just general projective texturing with 3 cameras one for each axis, and inverting the Y coord of the uv if the pixel happens to be in the negative direction. In essence they are, and should be warped by the 90 degree FOV, if it was orthogonal projection then this just wouldn't work ;) You can see how the texture bends and stretches when you throw the cube, I find it very interesting behavior, but the shadow mapping tests look ok so I'll assume its supposed to do that. At first I used another method which is to test the area of each cameras projection (Just the general saturation test), which is nice because it allows me to rotate the cubemap projection but it showed artifacts at the seems. The new method is cleaner requires me to perform a rotation on the coordinates to match the cubes rotation first.
I take it you use the vector from the light to the point being shaded (well, for omni light shadow mapping, that is)?
Yeah, I took the recommended route of recording the distance from the light in the shadow map instead of the clip coordinates Z position. I'm not sure if this is necessary, but it works. Note I packed this into RGBA channels for 32-bit accuracy. This method makes it hard to judge your boundaries though, as theres no "FarValue" to divide by, you just have to guess a constant number for the current scene (Or the light's range?).

I'm sorry for taking so long with that shadowmapping demo, I've been very busy lately and I don't want to release something thats rushed or unpolished.

Cheers

Posted: Mon Mar 10, 2008 7:25 pm
by agi_shi
BlindSide wrote:
agi_shi wrote:Interesting. Can you explain the texture coordinate generation for the virtual cube map more in depth? I take it you use the vector from the light to the point being shaded (well, for omni light shadow mapping, that is)? Any specific code you can show (reason is, won't the final coords be "warped" by the 90 fov perspective)? I'm not really interested in code as much as a good, wholesome description :twisted:... also, how is your atlas organized (which direction goes where)? I appreciate any sort of description :)
how is your atlas organized
Haha the short answer is, not very. I just kept changing which viewport belonged to which camera until the correct textures fell into their places, I didn't really plan ahead which sides of the cube go where, though I should do it sometime to improve filtering. Press R in the demo to see the texture in fullscreen.
Any specific code you can show (reason is, won't the final coords be "warped" by the 90 fov perspective)?
I'm not on my main coding computer right now, but it basically involves just general projective texturing with 3 cameras one for each axis, and inverting the Y coord of the uv if the pixel happens to be in the negative direction. In essence they are, and should be warped by the 90 degree FOV, if it was orthogonal projection then this just wouldn't work ;) You can see how the texture bends and stretches when you throw the cube, I find it very interesting behavior, but the shadow mapping tests look ok so I'll assume its supposed to do that. At first I used another method which is to test the area of each cameras projection (Just the general saturation test), which is nice because it allows me to rotate the cubemap projection but it showed artifacts at the seems. The new method is cleaner requires me to perform a rotation on the coordinates to match the cubes rotation first.
Interesting. I was thinking of getting the direction from the light to the point being shaded (like a usual cube map solution), and basically emulating texCUBE. I could get the actual texture coordinate as texCUBE does it, and then move it over on the X axis based on which face I needed to sample from (if I were to organize the atlas as +X -X +Y -Y +Z -Z). Another thing, which seems to do what that NVidia demo you mentioned seems to do, is just use a texCUBE to get my 2D coords, which can be prebaked such that I don't need to move/calculate anything other than the usual shadow mapping.
I take it you use the vector from the light to the point being shaded (well, for omni light shadow mapping, that is)?
Yeah, I took the recommended route of recording the distance from the light in the shadow map instead of the clip coordinates Z position. I'm not sure if this is necessary, but it works. Note I packed this into RGBA channels for 32-bit accuracy. This method makes it hard to judge your boundaries though, as theres no "FarValue" to divide by, you just have to guess a constant number for the current scene (Or the light's range?).
You mean byte RGBA? Interesting approach. Too bad I can't try this myself - I need a few floating values, which forces me into RGB/RGBA which 16 bits for each channel. I actually use full 32 bits per channel for high end machines (8800+).
I'm sorry for taking so long with that shadowmapping demo, I've been very busy lately and I don't want to release something thats rushed or unpolished.

Cheers
No problem. I know what it feels like - I promised an Ogre soft shadowing demo with non "ExampleApplication" code, and am yet to release it :oops: Good luck, so far your stuff looks excellent!

Posted: Tue Mar 11, 2008 4:53 am
by BlindSide
agi_shi wrote: Interesting. I was thinking of getting the direction from the light to the point being shaded (like a usual cube map solution), and basically emulating texCUBE. I could get the actual texture coordinate as texCUBE does it, and then move it over on the X axis based on which face I needed to sample from (if I were to organize the atlas as +X -X +Y -Y +Z -Z). Another thing, which seems to do what that NVidia demo you mentioned seems to do, is just use a texCUBE to get my 2D coords, which can be prebaked such that I don't need to move/calculate anything other than the usual shadow mapping.
Well I already told you I couldn't use the NVidia one because Irrlicht does not have cube mapping support, so where the hell do I get that texCUBE from?

Yeah there is a better way to do this which i might try later which is to just take the world coords and proportionate them according to Z (I think just divide by Z + some tweaking.), although I don't have time to try this right now.
agi_shi wrote: No problem. I know what it feels like - I promised an Ogre soft shadowing demo with non "ExampleApplication" code, and am yet to release it :oops: Good luck, so far your stuff looks excellent!
OGRE already has point soft shadowing built in, it even has LiPSM right?

PS: Irrlicht rules, OGRE drools :P hehehe

Cheers

Posted: Tue Mar 11, 2008 2:17 pm
by agi_shi
BlindSide wrote:
agi_shi wrote: Interesting. I was thinking of getting the direction from the light to the point being shaded (like a usual cube map solution), and basically emulating texCUBE. I could get the actual texture coordinate as texCUBE does it, and then move it over on the X axis based on which face I needed to sample from (if I were to organize the atlas as +X -X +Y -Y +Z -Z). Another thing, which seems to do what that NVidia demo you mentioned seems to do, is just use a texCUBE to get my 2D coords, which can be prebaked such that I don't need to move/calculate anything other than the usual shadow mapping.
Well I already told you I couldn't use the NVidia one because Irrlicht does not have cube mapping support, so where the hell do I get that texCUBE from?
I know that. I was simply stating my approach :roll:
agi_shi wrote: No problem. I know what it feels like - I promised an Ogre soft shadowing demo with non "ExampleApplication" code, and am yet to release it :oops: Good luck, so far your stuff looks excellent!
OGRE already has point soft shadowing built in, it even has LiPSM right?
You mean point light soft shadowing? No. Heck, it doesn't even have spot light soft shadowing. It doesn't even have point light texture shadowing. It does support (a non-broken impl. :P) point light stencil shadows (and texture shadows for spot lights), if that's what you're confusing it with ;). It also has various camera setups, like the LiPSM that you mentioned. I don't like it though, I set up my camera the right way :twisted:
PS: Irrlicht rules, OGRE drools :P hehehe

Cheers
I'd say vice-versa, but then I'd start an Ogre/Irrlicht war with an Irrlicht developer that is interesting to talk to ;)

Posted: Tue Mar 11, 2008 4:48 pm
by hybrid
agi_shi wrote: I'd say vice-versa, but then I'd start an Ogre/Irrlicht war with an Irrlicht developer that is interesting to talk to ;)
I wonder which one that would be, because none of the dev team members ever participated actively in such discussions.

Posted: Tue Mar 11, 2008 7:29 pm
by agi_shi
hybrid wrote:
agi_shi wrote: I'd say vice-versa, but then I'd start an Ogre/Irrlicht war with an Irrlicht developer that is interesting to talk to ;)
I wonder which one that would be, because none of the dev team members ever participated actively in such discussions.
:roll:

Posted: Wed Mar 12, 2008 3:07 am
by Vsk
agi_shi wrote:
hybrid wrote:
agi_shi wrote: I'd say vice-versa, but then I'd start an Ogre/Irrlicht war with an Irrlicht developer that is interesting to talk to ;)
I wonder which one that would be, because none of the dev team members ever participated actively in such discussions.
:roll:
agi_shi if you continue that way I won't let the procedural spiders go through your portals :P
By the way, I continue thinking that if you send direct link portal though the other the world will collapsse into neutrin star :P

Posted: Wed Mar 12, 2008 5:56 am
by BlindSide
I'm locking this incase something bad happens. :P

EDIT: I can't lock my own thread? Oh noes..
agi_shi if you continue that way I won't let the procedural spiders go through your portals :P
You made the spider things?!

Posted: Wed Mar 12, 2008 12:28 pm
by agi_shi
BlindSide wrote:I'm locking this incase something bad happens. :P

EDIT: I can't lock my own thread? Oh noes..
agi_shi if you continue that way I won't let the procedural spiders go through your portals :P
You made the spider things?!
No don't lock it, nothing bad will happen. In fact, good will happen, if I have more questions of virtual cube maps. Because I can't find any other good, active discussion of them.

Also, Vsk... you're not the one who did the spiders, Sundown is :|

Posted: Wed Mar 12, 2008 2:13 pm
by Vsk
BlindSide wrote:I'm locking this incase something bad happens. :P

EDIT: I can't lock my own thread? Oh noes..
agi_shi if you continue that way I won't let the procedural spiders go through your portals :P
You made the spider things?!
No, obviusly I didn't.

I am just kinding, I was mading when a father get angry with his sons and try to punished him. But obviously it was not very clear :?

And obviuly I am not fithning with anyone, I like agi_shi portals, and I love becaue he is young and take too seriouly everything we say ;-).

(But the portals collapse into a neutrin star :P) It is a dangerous for humanity and universe. :P:lol:

Posted: Wed Mar 12, 2008 3:40 pm
by agi_shi
Vsk wrote:
BlindSide wrote:I'm locking this incase something bad happens. :P

EDIT: I can't lock my own thread? Oh noes..
agi_shi if you continue that way I won't let the procedural spiders go through your portals :P
You made the spider things?!
No, obviusly I didn't.

I am just kinding, I was mading when a father get angry with his sons and try to punished him. But obviously it was not very clear :?

And obviuly I am not fithning with anyone, I like agi_shi portals, and I love becaue he is young and take too seriouly everything we say ;-).

(But the portals collapse into a neutrin star :P) It is a dangerous for humanity and universe. :P:lol:
I see. Ok. :lol:

Posted: Wed Mar 12, 2008 5:59 pm
by fmx
BlindSide, a quick question...

are you doing the UV calculations (to extract the colour from your texture-atlas) in the vertex shader, or your pixel shader?

I've had a go at my own RTT-based cubemapping in the vertex-shader, but I get wierd results...

could it be because the frag-shader tends to interprolate the uv's calculated in the vertex-shader?

My guess is that my texture-atlas is all wrong...
I'm not really sure about the best way of going about calculating UV's, but even more importantly, I'd like to be sure that the texture-atlas I'm using is actually usable

(ie, the texture which gets passed to the shader - not as a texCUBE, but a standard one (I don't want to use extensions) )

*is* it possible to use a minimilistic texture-atlas such as:

Code: Select all

+------+------+
| posx | negx |
+------+------+
| posy | negy |
+------+------+
| posz | negz |
+------+------+
or do the cube faces *have* to be panoramic (like traditional cubemaps):

Code: Select all

+------+------+------+------+
|      | posy |      |      |
+------+------+------+------+
| negx | posz | posx | negz |
+------+------+------+------+
|      | negy |      |      |
+------+------+------+------+
Thanks!


---
agi_shi wrote: No don't lock it, nothing bad will happen. In fact, good will happen, if I have more questions of virtual cube maps. Because I can't find any other good, active discussion of them.
I agree... which is why I decided to post here and not PM him

:D