2 registered members (AndrewAMD, Ayumi),
1,405
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Free Day/Night Sky System
#209859
06/06/08 09:35
06/06/08 09:35
|
Joined: Jul 2006
Posts: 503 Australia
adoado
OP
User
|
OP
User
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.pdfIt was for our upcoming project , 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 . 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 LINK (A7): http://www.megaupload.com/?d=A3B9OE8MLINK (A6): http://www.megaupload.com/?d=DVX5X2UVEnjoy Frazzle and Adoado
Last edited by adoado; 06/08/08 11:20.
|
|
|
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
Expert
|
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
|
|
|
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
Senior Expert
|
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
//-----------------------------------------------------------------------------
// 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.dequoted: 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
Expert
|
Expert
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
|
Thanks for the cheers guys, I hope it can be used in a helpful matter @ ello: Nice attachment, this solves the problem for the sun indeed but like you mentioned, it has got a cell shaded look atm Anyway, smart solution 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
Expert
|
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
Expert
|
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 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
Expert
|
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
adoado
OP
User
|
OP
User
Joined: Jul 2006
Posts: 503
Australia
|
Hello all, Thanks all for your kind comments, glad it was useful @Ello: Awesome! Thanks, any improvement or modification it always welcome @Blink: I will give it a shot UPDATE: There is now an A6 compatible version Thanks, Adoado
Last edited by adoado; 06/08/08 11:21.
|
|
|
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
Expert
|
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."
|
|
|
|