1 registered members (TipmyPip),
18,574
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: How do you display shadows on invisible surfac
[Re: frazzle]
#135979
07/16/07 18:53
07/16/07 18:53
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
I'm going to stick with my idea and give it a try when I get home.
My plan is to create my level lik I normally would, but using models and no blocks for the level. Make all models as high qality as possible, high-res textures, parallax oclusion mapping, whatever... but only render all that for one frame of every scene, then save that image as a TGA. Then all materials wil switch to the "special shader", and the last scene will be drawn on all models. The textures of the model will switch to a small 8x8 blank tex. I'll have all the quality I can get without the slow-down. I'll have an interactive 3D world as well...
We'll see how it goes...
xXxGuitar511 - Programmer
|
|
|
Re: How do you display shadows on invisible surfac
[Re: xXxGuitar511]
#135980
07/16/07 19:08
07/16/07 19:08
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
Sounds quite promising, good luck Guitar but you know that the theoretical side is always easy in opposite with the practical side  I'll try to go for shadow mapping  Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: How do you display shadows on invisible surfac
[Re: frazzle]
#135981
07/17/07 10:10
07/17/07 10:10
|
Joined: Jul 2001
Posts: 6,904
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
Well, it works: on the left side without FFP material applied, on the right with the FFP material.  But I am not able to clip the warlock model behind the dummy mesh.. Here is the FFP I'm using, it just implements the flags which are mentioned by that guy from WME: Code:
material orangeBrat { effect = "technique orangeBrat { pass p0 { SrcBlend = Zero; DestBlend = One; AlphaBlendEnable = true; } };"; } Just apply the material to every dummy mesh. I will see if I can clip the overlapped parts of the warlock model. Cheers!
Last edited by HeelX; 07/17/07 10:11.
|
|
|
Re: How do you display shadows on invisible surfac
[Re: frazzle]
#135983
07/17/07 17:39
07/17/07 17:39
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
What about the addition of some other flags, such as:
zEnable alphaBlendEnable zWriteEnable alphaTest - I need to lookup these flags on MSDN and larn exactly how each works.
And have you tried removing the alphaBlendEnable from the above test? I'm wondering if it's necesary or not.
xXxGuitar511 - Programmer
|
|
|
Re: How do you display shadows on invisible surfac
[Re: HeelX]
#135985
07/17/07 18:31
07/17/07 18:31
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
I guess that setting these render states is the only way, according to this reply from WinterMute which I qouted from one of the replies OB maded: Quote:
Hi Ryan,
the hidden geometry indeed needs to be rendered into the depth buffer, so that the shadow volume is properly mapped onto it. In Direct3D the following render states should do the trick:
Code:
m_Device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); m_Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO); m_Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
This unfortunately also means the hidden geometry must closely match the 2D image, otherwise the depth buffer will mask the 3D character (like on this screenshot: http://www.dead-code.org/blog/wp-content/shadow2.png).
JN
The red part is how it would be setted within D3D which is identical qua functionality to the code snippet HeelX posted. I've read about information that zEnable, zWriteEnable,alphaTest and alphaBlendEnable won't make any difference. Here's the information from msdn regarding render states:
msdn link
To make this error dissapear, you'll have to 'cheat' towards realtime rendering That is the only option AFAIK to resolve this problem until now. Maybe shadow mapping or shadow volumes via shaders won't be affected by invisible scene geometry but on the other hand, OB wants to avoid the shader way but I'll give it a shot though 
Cheers
Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: How do you display shadows on invisible surfac
[Re: xXxGuitar511]
#135987
07/17/07 19:52
07/17/07 19:52
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
Well like I said, good luck  Btw, I've been testing with the depth buffer and the results I'm getting are good but not perfect. I'll post something when I get some decent result ^^ Cheers Frazzle
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
Re: How do you display shadows on invisible surfac
[Re: frazzle]
#135988
07/17/07 21:35
07/17/07 21:35
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
Post deleted by Frazzle
Edit: wrong result, the code wasn't a solutions for the clipping issue. It just sloved the problem I noticed that when the model came close to the object with the material HeelX posted attached to it, the model became invisible but when setting the passable flag off this works as well because that way you can't penetrate the object and can't get invisible ^^
Cheers
Frazzle
Last edited by frazzle; 07/17/07 21:53.
Antec® Case Intel® X58 Chipset Intel® i7 975 Quad Core 8 GB RAM DDR3 SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB NVIDIA® GeForce GTX 295 Memory 1795GB
|
|
|
|