|
Re: What are you working on?
[Re: Rei_Ayanami]
#386125
10/29/11 00:01
10/29/11 00:01
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Just had an idea for "advanced" dynamic lights, see the comparison below: The first screenshot shows a regular dynamic point light, the second image shows the light with "edge detection", that is a regular object shader. It's a very simple 2D effect and it has many limitations, but there's no additional rendering involved, works on PS 2.0 and is very fast (runs at 2200-2300fps).
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: What are you working on?
[Re: Superku]
#386126
10/29/11 04:19
10/29/11 04:19
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
Well, Superku. That's just a bit too lovely and perfect. Questions! 1> Does it rely on a sort-of hallway/room layout? (that is, will it give every scene stunning and perfect dynamic shadows, or does it specifically take advantage of 2D layouts to give that lovely effect?) 2> Will this perfect shadow with perfect penumbra be cast on other objects, such as props and characters? 3> Will you give us a running techdemo, or at least a video? 4> Will you tell us how you did it and/or make it accessible in some form to the community, even if for a price?
It's really just gorgeous. Well done!
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: What are you working on?
[Re: JibbSmart]
#386133
10/29/11 10:51
10/29/11 10:51
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
Superku, awesome, one of the things that irritated me most in the past looks like now it's solved.
3333333333
|
|
|
Re: What are you working on?
[Re: Rei_Ayanami]
#386139
10/29/11 11:43
10/29/11 11:43
|
Joined: Apr 2008
Posts: 2,488
ratchet
OP
Expert
|
OP
Expert
Joined: Apr 2008
Posts: 2,488
|
Little Update : Low poly and quick color picking ! (2.5D shooter) Alien early wip :
Last edited by ratchet; 10/29/11 13:02.
|
|
|
Re: What are you working on?
[Re: ratchet]
#386149
10/29/11 14:45
10/29/11 14:45
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Thank you guys! As I've said, esp. right now it has many limitations. 1) Exactly, the (2D) layout matters and thus it's only suitable for corridors and hallways with some pillars here and there. Props and characters should use stencil shadows, though. 2) Yes, it "casts" on everything, it's an object shader (see below) that you can apply on every model. 3) Here you go: http://www.youtube.com/watch?v=4b3BvHuDetk4) Currently, I take an invisible model, place it at the corner and let it calculate a (2D) normal vector that is perpendicular to the direction vector light->corner. (I make sure that the normal vector does not point inside the level geometry.) Then in my regular point light object shader, I add the following lines:
edgelightdir = vecLightPos[i].xz-dyn_corner_flt[0].xy;
fj = length(edgelightdir);
edgeposdir = InWorldPos.xz-dyn_corner_flt[0].xy;
projrange = dot(edgelightdir,edgeposdir)/(fj*fj); //yes, the case fj == 0 is ignored right now
if(projrange < 0)
{
off = distance(dyn_corner_flt[0].xy,InWorldPos.xz)/5;
fj = dot(dyn_normal_flt[0].xy,dyn_corner_flt[0].xy)-dot(dyn_normal_flt[0].xy,InWorldPos.xz)+2;
Shadow += vecLightColor[i]*fac * (1-pow(saturate(fj/(5+off)),1.5));
}
else Shadow += vecLightColor[i]*fac;
All I do is that I check on which side of the line light->corner the current pixel (InWorldPos.xz) is (in respect to the normal vector calculated by our corner model) and depending on the result of that calculation I blend the shadow/ light.
Last edited by Superku; 10/29/11 14:47.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: What are you working on?
[Re: Superku]
#386150
10/29/11 15:13
10/29/11 15:13
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
That's brilliant. Thanks for the info, Superku! It looks perfect in action, and makes me want to make a corridor shooter just to use it. Given how many corridor games exist it has a lot of use even with its limitations.
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
|