Gamestudio Links
Zorro Links
Newest Posts
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
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 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 2 1 2
Free Day/Night Sky System #209859
06/06/08 09:35
06/06/08 09:35
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline OP

User
adoado  Offline OP

User
A

Joined: Jul 2006
Posts: 503
Australia
Hello all,

A while ago, myself and Frazzle attempted to make a 3dgs example of the idea posed in the paper: http://es.geocities.com/kenchoweb/skydomes_en.pdf

It was for our upcoming project wink , but we decided to change methods and we no longer needed it, so we decided to release it in case anyone else could use it wink.

It's basically a method to colour a dome to look like a sky (obviously ^^) using a gradient map, and a simple shader. It looks good, and has the same look as Atmospheric scattering (without the Sun visible).

The basic idea is you have an image, and in that image is (horizontally) the phases of the sky, from night, to sunrise, to day, to sunset, to night time again. And vertically is the altitude.



And here is what it looks like:



The beauty in it is that it is very small, one 64x64 image, and a few maths operations wink wink

LINK (A7): http://www.megaupload.com/?d=A3B9OE8M
LINK (A6): http://www.megaupload.com/?d=DVX5X2UV

Enjoy wink
Frazzle and Adoado




Last edited by adoado; 06/08/08 11:20.

Visit our development blog: http://yellloh.com
Re: Free Day/Night Sky System [Re: adoado] #209866
06/06/08 10:30
06/06/08 10:30
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Very nice! Thanks for this great contribution!
I have no use for it right now but this can come in handy surely someday!

Thanks again smile

Re: Free Day/Night Sky System [Re: Xarthor] #209870
06/06/08 10:59
06/06/08 10:59
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Nice! (changing time with mouse wheel is fun smile )


3333333333
Re: Free Day/Night Sky System [Re: Quad] #209939
06/06/08 20:02
06/06/08 20:02
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
thanks for this usefull contribution. i hope you dont mind, i added some kind of sun (looks toony atm)
it uses the sunposition and the suncolor inside the shader to generate it.

i connected the unconnected vertices of the model for getting correct normals.

download mdl


Code:

//-----------------------------------------------------------------------------
//           Name: Sky Shader
//         Author: Adrian (adoado)
//  	      For: Free Release. Based on the paper: http://es.geocities.com/kenchoweb/skydomes_en.pdf
//-----------------------------------------------------------------------------

float4x4 matWorldViewProj;
float4 vecSunDir;
float4 vecSunColor;

texture entSkin1;

float4 vecSkill1;

sampler SampSky = sampler_state
{
	texture = <entSkin1>;
	MinFilter = Linear;
	MagFilter = Linear;
	MipFilter = Linear;
};

struct VS_Input
{
    float3 position	: POSITION;
    float4 texcoord : TEXCOORD0;
    float4 normal : NORMAL;
};

struct VS_Output
{
    float4 position: POSITION;
    float4 texcoord: TEXCOORD0;
    float4 normal : TEXCOORD1;
};

struct PS_Output
{
	float4 color : COLOR;
};

VS_Output VertexShader_Pass0(VS_Input In)
{
    VS_Output Out;
    
	Out.position = mul(float4(In.position, 1),matWorldViewProj); 
	Out.texcoord = (In.texcoord);
	Out.normal = normalize(In.normal);
	return Out;
}     

PS_Output PixelShader_Pass0(VS_Output In)
{
   PS_Output Out;
	
	float OneMinute = 0.0444444444; //How many pixels correlate to one standard minute of time: 64/1440 (1440 = 24*60)
	float Location = 0.015625 * (OneMinute*vecSkill1.x); //Convert range [1][128] to range [0][1]: 0.015625 = 1/64
	
	float4 TexColor = tex2D(SampSky, float2(Location, In.texcoord.y)); //0.764
	
	Out.color = TexColor;
	Out.color *= vecSunColor;
	float light = 0.5 + 0.5 * dot(In.normal, vecSunDir);
	Out.color *= light;
	float4 sun = vecSunColor * 10*pow(light,20); //glowammount
	sun += vecSunColor * (dot(In.normal, vecSunDir)>0.7); //diameter of disk
	Out.color += sun;

	return Out;
}

//-----------------------------------------------------------------------------
// Technique (1 pass, PS/VS 2 compliant)
//-----------------------------------------------------------------------------

technique Technique0
{
    pass Pass0
    {
		VertexShader = compile vs_2_0 VertexShader_Pass0();
		PixelShader  = compile ps_2_0 PixelShader_Pass0();
    }
}



www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: Free Day/Night Sky System [Re: ello] #209946
06/06/08 20:56
06/06/08 20:56
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Thanks for the cheers guys, I hope it can be used in a helpful matter smile smile

@ ello:
Nice attachment, this solves the problem for the sun indeed but like you mentioned, it has got a cell shaded look atm wink wink
Anyway, smart solution smile smile

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Free Day/Night Sky System [Re: frazzle] #210064
06/07/08 16:42
06/07/08 16:42
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline

Expert
Blink  Offline

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
is this for A7? i tried opening it with A6, and got a damaged line error. looks great btw.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: Free Day/Night Sky System [Re: Blink] #210076
06/07/08 18:13
06/07/08 18:13
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
It's best to use it with A7 since it uses a floatv conversion and a mtl pointer to handle the material wink wink

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: Free Day/Night Sky System [Re: frazzle] #210115
06/08/08 03:16
06/08/08 03:16
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline

Expert
Blink  Offline

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
i dont have A7, any chance of converting to C-script?


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Re: Free Day/Night Sky System [Re: Blink] #210141
06/08/08 11:13
06/08/08 11:13
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline OP

User
adoado  Offline OP

User
A

Joined: Jul 2006
Posts: 503
Australia
Hello all,

Thanks all for your kind comments, glad it was useful wink wink

@Ello:
Awesome! Thanks, any improvement or modification it always welcome wink

@Blink:
I will give it a shot wink

UPDATE: There is now an A6 compatible version wink

Thanks,
Adoado

Last edited by adoado; 06/08/08 11:21.

Visit our development blog: http://yellloh.com
Re: Free Day/Night Sky System [Re: adoado] #210184
06/08/08 19:26
06/08/08 19:26
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline

Expert
Blink  Offline

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
thank you, it's awesome! this can be a great tool for rpg worlds.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

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