Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 5 1 2 3 4 5
Fake Light Shafts (Downlaod available) #272876
06/20/09 08:18
06/20/09 08:18
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
E
Enduriel Offline OP
Member
Enduriel  Offline OP
Member
E

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 smile

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 smile

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 smile

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-K3nS0

NEW HD: http://www.youtube.com/watch?v=LBdlulbYNgI








Original post

Hello 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=bWkfFrvWCJg

My 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 smile

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 Offline
Member
XD1v0  Offline
Member

Joined: Jun 2008
Posts: 151
Ukraine
Quote:
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
Code:
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 cool
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 Offline
Expert
Hummel  Offline
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 wink


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
E
Enduriel Offline OP
Member
Enduriel  Offline OP
Member
E

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 frown

Hummel: I wish I had the knowledge to do that smile 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 frown

Last edited by Enduriel; 06/20/09 17:18.
Re: Fake Light Shafts ( almost done, just a problem ) [Re: Enduriel] #272982
06/20/09 20:04
06/20/09 20:04
Joined: Jun 2008
Posts: 151
Ukraine
XD1v0 Offline
Member
XD1v0  Offline
Member

Joined: Jun 2008
Posts: 151
Ukraine
Quote:
could point out what I was doing wrong with XD1v0s code

Ops, sorry i give you wrong shader code, now its work fine


Code:
texture entSkin1;

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;
		Texture[0] = <entSkin1>;
		ColorArg1[0] = Texture;
		ColorOp[0] = SelectArg1;
	}
}





A7 Commercial cool
Celeron 1700, GeForce 5500 FX 256mb, 1 Gb Ram
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
E
Enduriel Offline OP
Member
Enduriel  Offline OP
Member
E

Joined: Aug 2008
Posts: 133
Sweden, Stockholm
Lovely! It works smile 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 smile

EDIT: Nvm got it to work with models aswell smile

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
E
Enduriel Offline OP
Member
Enduriel  Offline OP
Member
E

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 smile

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-K3nS0

NEW 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 Offline
Senior Expert
Quad  Offline
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 wink 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 Offline
Serious User
MMike  Offline
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.
Re: Fake Light Shafts ( almost done, just a problem ) [Re: MMike] #273191
06/21/09 21:12
06/21/09 21:12
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Looks really nice! Which shader model do you use?

Are you planning to contribute this? What is required to get it work (what do I have to do later when I'll try to add this to my scenes)?

Best regards,
Christian

Page 1 of 5 1 2 3 4 5

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1