Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
3 registered members (NnamueN, Akow, 1 invisible), 1,421 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Atmospheric Scattering + Sun Shader [Re: Slin] #434444
12/18/13 17:13
12/18/13 17:13
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Thanks for your suggestions.

Originally Posted By: Slin
Also about sky rendering in general: To make the sky appear behind everything you usually render the sky before everything else without depth writing and only applying the cameras rotation and projection matrix and if needed the skies rotation matrix. As a result it will appear behind everything else, won´t be clipped and won´t clip anything and just replace the clear color as it should.


Do you a tutorial or example how to do this?

Re: Atmospheric Scattering + Sun Shader [Re: oliver2s] #434447
12/18/13 17:57
12/18/13 17:57
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
After looking at the manual, it looks like gamestudio renders the sky after all solid entities, which does have the advantage of less/no overdraw for the sky.
So in your case you may just want to disable writing to the depth buffer for the sky and render it with a kinda small radius.

Code:
technique tMain
{
	pass 
	{
		ZEnable = true;
		ZWriteEnable = false;
		VertexShader = compile vs_3_0 VS(); 
		PixelShader = compile ps_3_0 PS();
	}
}


and just use a radius of 1 or whatever you want. It should work just fine, unless I am messing things up...

And no, I have no idea if there are any tutorials about this.

Edit: That´s only if you want the sky to behave the same as a gamestudio sky cube. But then you also have to move it with the camera (what you already do), or make the shader ignore the translations.

Last edited by Slin; 12/18/13 18:07.
Re: Atmospheric Scattering + Sun Shader [Re: Slin] #434486
12/19/13 11:50
12/19/13 11:50
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Originally Posted By: Slin

Code:
technique tMain
{
	pass 
	{
		ZEnable = true;
		ZWriteEnable = false;
		VertexShader = compile vs_3_0 VS(); 
		PixelShader = compile ps_3_0 PS();
	}
}



This doesn't work. Sky sphere is still rendered as before.

Re: Atmospheric Scattering + Sun Shader [Re: oliver2s] #434514
12/19/13 22:24
12/19/13 22:24
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
I found a way to render the sky sphere behind everthing else. Set screen_color and sky_color to (0,0,0).

Then give the sky sphere FLAG1 and create another view which only renders the sky behind the level:

Code:
vec_set(sky_color,nullvector);
vec_set(screen_color,nullvector);
	
VIEW* camera_sky=view_create(-999999);
camera_sky.size_x=camera.size_x;
camera_sky.size_y=camera.size_y;
set(camera_sky,NOENT|SHOW|UNTOUCHABLE|NOPARTICLE|NOWORLD|NOFOG|NOSKY);
camera_sky.genius=ent_sky_sphere;

set(camera,NOFLAG1);
	
while(1)
{
	vec_set(camera_sky.x,camera.x);
	vec_set(camera_sky.pan,camera.pan);
		
	wait(1);	
}


Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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