|
Fake Light Shafts (Downlaod available)
#272876
06/20/09 08:18
06/20/09 08:18
|
Joined: Aug 2008
Posts: 133 Sweden, Stockholm
Enduriel
OP
Member
|
OP
Member
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
|
EDIT 2:Well here it is, excuse my understanding of post processing and HLSL, it's my first time So if there are bugs, it's probably over the top of my head on how to fix them. Anyhow I hope it's usefull Download shader: http://files.filefront.com/LightShaftrar/;13920138;/fileinfo.html EDIT: The lightshaft shader is done, though it very messy atm, I need to clean it up abit and find a better solution for making the VIEW that is being rendered black contain the same position and angles as the real scene, cause right now I do a while loop with ViewBlack.x = camera.x etc which is not nice, but hey, i'm a novice in HLSL and this was the solution I found for myself I'll release it soon, just need to extract it out of my project and make it standalone with a small level, and probably some solution for that camera position / angle problem first! Link: http://www.youtube.com/watch?v=-vZjq-K3nS0NEW HD: http://www.youtube.com/watch?v=LBdlulbYNgIOriginal postHello people, I'm using Nils "Slin" Daumanns radialblur shader and his God Ray IDEA to make Fake Light Shafts. I just extended it alittle bit with lite-c for making it stick to the sun_pos and fade out/in on screen corners. http://www.youtube.com/watch?v=bWkfFrvWCJgMy problem is rendering the entire scene black except the SKY. If I can get that to work, from there on I can handle the rest, but I have no clue on how to render everything except the SKY black into a texture. So being stuck at Step 1 kinda sucks =/ If I could get some help on that, I could handle the rest, as what's left to do from there on would be passing it as mtlSkin1 to the GodRay PP shader and then radialblur it and additive/screen blend it with the rest of the scene. I also plan on releasing it as a small contribution from my side
Last edited by Enduriel; 06/22/09 01:56.
|
|
|
Re: Fake Light Shafts ( almost done, just a problem )
[Re: Enduriel]
#272883
06/20/09 09:08
06/20/09 09:08
|
Joined: Jun 2008
Posts: 151 Ukraine
XD1v0
Member
|
Member
Joined: Jun 2008
Posts: 151
Ukraine
|
but I have no clue on how to render everything except the SKY black into a texture Very easy do this, just do far negative fog, like this
technique black
{
pass p0
{
AlphaBlendEnable=True;
Zenable = True;
ZwriteEnable = True;
BlendOp=Add;
Lighting=False;
FogEnable = True;
FogColor = float4(0.0f, 0.0f, 0.0f, 1.0f);
FogStart = 60000;
FogEnd = 50000;
ShadeMode = Flat;
ColorArg1[0] = Diffuse;
ColorOp[0] = SelectArg1;
}
}
set this material to view
A7 Commercial Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
|
|
|
Re: Fake Light Shafts ( almost done, just a problem )
[Re: XD1v0]
#272938
06/20/09 15:47
06/20/09 15:47
|
Joined: Mar 2006
Posts: 2,252
Hummel
Expert
|
Expert
Joined: Mar 2006
Posts: 2,252
|
Since it´s just a negative fog, not everything except the sky will became black...try to add a viewdependent material or something like this... At least Crysis already generated the shafts this way, but Slin did a great job too
Last edited by Hummel; 06/20/09 16:26.
|
|
|
Re: Fake Light Shafts ( almost done, just a problem )
[Re: Hummel]
#272949
06/20/09 17:02
06/20/09 17:02
|
Joined: Aug 2008
Posts: 133 Sweden, Stockholm
Enduriel
OP
Member
|
OP
Member
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
|
XD1v0: Hey, thanks for your help but that only makes the entire scene black except the panels and texts. Though I tried that with a normal lite-c fog with NOFOG flag enabled on the sky and it worked, but as you know I need it through a shader, and the one you contributed didn't work for me Hummel: I wish I had the knowledge to do that I'm a novice in HLSL and this is the first time I tackle it =], though if I could get the above code to work, then I would be fine as the rest is easy =] EDIT: I think I need a second view with lite-c fog for this to work, atleat with my knowledge, would be lovely though if someone could point out what I was doing wrong with XD1v0s code
Last edited by Enduriel; 06/20/09 17:18.
|
|
|
Re: Fake Light Shafts ( almost done, just a problem )
[Re: XD1v0]
#272985
06/20/09 20:17
06/20/09 20:17
|
Joined: Aug 2008
Posts: 133 Sweden, Stockholm
Enduriel
OP
Member
|
OP
Member
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
|
Lovely! It works Just a quick question though, it works only with bitmap skies, is there a way to make it work with model based skies aswell? Not needed but I just wonder EDIT: Nvm got it to work with models aswell
Last edited by Enduriel; 06/20/09 20:34.
|
|
|
Re: Fake Light Shafts ( almost done, just a problem )
[Re: Enduriel]
#273004
06/20/09 22:37
06/20/09 22:37
|
Joined: Aug 2008
Posts: 133 Sweden, Stockholm
Enduriel
OP
Member
|
OP
Member
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
|
The lightshaft shader is done, though it very messy atm, I need to clean it up abit and find a better solution for making the VIEW that is being rendered black contain the same position and angles as the real scene, cause right now I do a while loop with ViewBlack.x = camera.x etc which is not nice, but hey, i'm a novice in HLSL and this was the solution I found for myself I'll release it soon, just need to extract it out of my project and make it standalone with a small level, and probably some solution for that camera position / angle problem first! Witness the rays of GOD: http://www.youtube.com/watch?v=-vZjq-K3nS0NEW HD: http://www.youtube.com/watch?v=LBdlulbYNgI
Last edited by Enduriel; 06/21/09 01:51.
|
|
|
Re: Fake Light Shafts ( almost done, just a problem )
[Re: Enduriel]
#273010
06/20/09 22:50
06/20/09 22:50
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
this is what i was talking about on the youtube comment of the previous video looks nice
3333333333
|
|
|
Re: Fake Light Shafts ( almost done, just a problem )
[Re: Quad]
#273169
06/21/09 19:29
06/21/09 19:29
|
Joined: Jul 2004
Posts: 1,710
MMike
Serious User
|
Serious User
Joined: Jul 2004
Posts: 1,710
|
Oh nice, this was something i was looking for , God Shaders. Though i think the rays are too much radial blured... maybe there could be attenuated usng a distance, calculation, depth view.
Because the rays are due to air dust, or other occlusion particles, and the ray will accumulate more and more opacity the more distant it gets, thus, dimming the light.
Last edited by MMike; 06/21/09 19:30.
|
|
|
|