Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, Ayumi, NewbieZorro), 14,141 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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