Shadowing discussion (Valin Halcyon)
Moderators: Grendel, Aus-RED-5
Shadowing discussion (Valin Halcyon)
Valin,
here are two screenshots of the polymodel shadowing.
Shot 1 shows the model body (blue) and shadow volume (orange). Both look very good to me.
Shot 2 shows the resulting shadow. For some reason I cannot figure, the stenciling hasn't grabbed all model faces (e.g. the thruster faces).
Edit:
For some reason, it is not properly determined which polygons face the light source and which don't. I have checked the surface normals and everything looks good there.
Edit 2:
I think I have it. The model data is indeed partially bogus. Some seemingly triangular or rectangular faces have 6 or 7 vertices and look like they're folded along one of their edges. Totally whacked. The guy who built the lo-res pyro model did a really bad job here.
here are two screenshots of the polymodel shadowing.
Shot 1 shows the model body (blue) and shadow volume (orange). Both look very good to me.
Shot 2 shows the resulting shadow. For some reason I cannot figure, the stenciling hasn't grabbed all model faces (e.g. the thruster faces).
Edit:
For some reason, it is not properly determined which polygons face the light source and which don't. I have checked the surface normals and everything looks good there.
Edit 2:
I think I have it. The model data is indeed partially bogus. Some seemingly triangular or rectangular faces have 6 or 7 vertices and look like they're folded along one of their edges. Totally whacked. The guy who built the lo-res pyro model did a really bad job here.
-
- DBB Admiral
- Posts: 1113
- Joined: Sun Jan 02, 2000 3:01 am
Glad you found a possible solution. I figured it'd be either setup a bit of a hack to use the existing mesh data with volumetric shadows, or use shadow maps.
It's likely you'll find some of the similar issues with the D4 GX, as I told you yesterday, it wasn't really a final version and contained several minor mesh glitches, especially where the verts and polys don't mirror at all left to right, the nose being an excellent example.
It's likely you'll find some of the similar issues with the D4 GX, as I told you yesterday, it wasn't really a final version and contained several minor mesh glitches, especially where the verts and polys don't mirror at all left to right, the nose being an excellent example.
Minor glitches aren't a problem, but polygons folding behind themselves ... tsk, tsk. Exactly the thruster poly is a blatant example. Actually, it's a square, but in the model it has 7 vertices, forming a second square behind the outer one, also facing outward.
Btw, I had a view of the pyro like a porcupine, with all the normals sticking to it ... heh!
Btw, I had a view of the pyro like a porcupine, with all the normals sticking to it ... heh!
-
- DBB Admiral
- Posts: 1113
- Joined: Sun Jan 02, 2000 3:01 am
-
- DBB Admiral
- Posts: 1113
- Joined: Sun Jan 02, 2000 3:01 am
-
- DBB Admiral
- Posts: 1113
- Joined: Sun Jan 02, 2000 3:01 am
Valin,
please post a direct link to the D4 Pyro oof file. I am not gonna fiddle it out some mission or whatever.
Top Gun,
shadowing in D2X-XL is dead. The models aren't good enough. When projecting faces to infinity for the shadow volume, you get huge gaps. I also cannot figure why the front cap doesn't arrive in the stencil buffer. I am done with this sh1t.
Edit:
I will try a take on shadow mapping. Maybe that will work. Depending on how I set it up, it can cost a lot of performance though, as you have to render the full scene as seen from the lightsource for every light source.
please post a direct link to the D4 Pyro oof file. I am not gonna fiddle it out some mission or whatever.
Top Gun,
shadowing in D2X-XL is dead. The models aren't good enough. When projecting faces to infinity for the shadow volume, you get huge gaps. I also cannot figure why the front cap doesn't arrive in the stencil buffer. I am done with this sh1t.
Edit:
I will try a take on shadow mapping. Maybe that will work. Depending on how I set it up, it can cost a lot of performance though, as you have to render the full scene as seen from the lightsource for every light source.
-
- DBB Admiral
- Posts: 1113
- Joined: Sun Jan 02, 2000 3:01 am
I no longer have the tools to do so, Diedel. I actually don't remember how. The original OOF that went into the level is on my PC, but as it's currently offline and not on hand to scavenge the hard drive from, I can't get at it for awhile. I could get it to you later once my own machine is back online.
EDIT: Erm, Diedel? I was just looking at the orange/blue screenshot again. Where exactly is the lightsource at? It LOOKS like it's actually INSIDE the ship...
Also, shadow mapping won't kill performance that badly if you do it in native OpenGL as much as possible. Nvidia and ATI both have developed that capability in hardware rather extensively, according to Rob, and is likely to be the \"future\" of shadowing, short of using shaders for shadowing.
EDIT: Erm, Diedel? I was just looking at the orange/blue screenshot again. Where exactly is the lightsource at? It LOOKS like it's actually INSIDE the ship...
Also, shadow mapping won't kill performance that badly if you do it in native OpenGL as much as possible. Nvidia and ATI both have developed that capability in hardware rather extensively, according to Rob, and is likely to be the \"future\" of shadowing, short of using shaders for shadowing.
For shadow mapping, for each light source taken into account, you will have to render the scene as seen from the light source. You can probably render directly to texture, but it's still a full render pass for each light. You will do a special render only giving you depth information -> shadow map. Then you have to merge all the shadow maps created that way with the regular scene in another render pass. Now I have to render shadow maps for all objects whos shadows are visible, and do that for the lights that affect each object most. That can easily amount to several dozen light sources. Level 1 of D2:CS alone contains 135 lights!
I cannot pull this off either, as you have to project the shadow maps so that they look right if seen from the actual viewer position, and I don't know how to do it, and cannot figure it from the tutorials and documents I've read (you may guess it: I have tried to get shadow mapping into D2X-XL). They all refer to OpenGL and GLU calls, and I'd need the basic 3D math explained first. I am constantly so tired that I just cannot think enough. I also don't know how to merge multiple shadow maps with the scene. There is no really good OpenGL course on the inet I'd know of that would teach such enhanced things, and I cannot pull it together from information bits and pieces and OpenGL references (which are poor as hell as far as I know them), because they don't even tell you what all the stuff is actually good for. You have to know the answers already. Oh yeah, and for the kind of light sources in D2, you'd need to implement hyperbolic (I think that was the term) shadow mapping to make it look good.
D2X-XL eats too much of my time, and yields too little for what I put in it.
I'd need someone who really knows how to code such stuff and would be willing to poke around in D2X-XL a little, with my support where needed. If Chris would take a look in D2X-XL and simply fix the stuff I would be more than happy ... but I doubt he would.
Oh well, I have a life at last.
I cannot pull this off either, as you have to project the shadow maps so that they look right if seen from the actual viewer position, and I don't know how to do it, and cannot figure it from the tutorials and documents I've read (you may guess it: I have tried to get shadow mapping into D2X-XL). They all refer to OpenGL and GLU calls, and I'd need the basic 3D math explained first. I am constantly so tired that I just cannot think enough. I also don't know how to merge multiple shadow maps with the scene. There is no really good OpenGL course on the inet I'd know of that would teach such enhanced things, and I cannot pull it together from information bits and pieces and OpenGL references (which are poor as hell as far as I know them), because they don't even tell you what all the stuff is actually good for. You have to know the answers already. Oh yeah, and for the kind of light sources in D2, you'd need to implement hyperbolic (I think that was the term) shadow mapping to make it look good.
D2X-XL eats too much of my time, and yields too little for what I put in it.
I'd need someone who really knows how to code such stuff and would be willing to poke around in D2X-XL a little, with my support where needed. If Chris would take a look in D2X-XL and simply fix the stuff I would be more than happy ... but I doubt he would.
Oh well, I have a life at last.
-
- DBB Admiral
- Posts: 1113
- Joined: Sun Jan 02, 2000 3:01 am