|
2 registered members (Quad, TipmyPip),
6,316
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: [SUB] Planet Shader Contribution
[Re: Joey]
#211598
06/17/08 13:21
06/17/08 13:21
|
Joined: Jul 2004
Posts: 1,710
MMike
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,710
|
could you post the shot of the sphere without the shader applied? what you mean without shader? its a simple sphere, if you shade it with white texture, you will see the edges glowing (fake glow).. I designed it to work with a position, that you assign though the function skills, positions in world of 1 light, since we are talking about planet, it is the near sun of that planet that will cast light. the other values are for changing the colour of the sun light.
Last edited by MMike; 06/17/08 13:23.
|
|
|
Re: [SUB] Planet Shader Contribution
[Re: Joey]
#211657
06/17/08 17:38
06/17/08 17:38
|
Joined: Jul 2004
Posts: 1,710
MMike
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,710
|
the glow color is made by a float4 color, you can change it. What i did was multiply a default white fallout with a float color, in the fx file this is at: float Component_falloff_1_amount = 2.4; float4 Color_gamma_1_gamma = float4(0.277049, 0.277049, 0.277049, 1.000000); float4 Math_color_multiply_2_right = float4(0.405410, 0.783880, 0.9000000, 0.000000); float Color_brightness_1_amount=2;
of course you can assign some entity skills to this float4 so you can tweak it as you wish.
At the moment, you can: - Change Sun position (1 light support) - Change Sun color (some sort of tint/ ambient / difusse )
Last edited by MMike; 06/17/08 17:40.
|
|
|
Re: [SUB] Planet Shader Contribution
[Re: Joey]
#211677
06/17/08 18:57
06/17/08 18:57
|
Joined: Nov 2005
Posts: 1,007
jigalypuff
Serious User
|
Serious User
Joined: Nov 2005
Posts: 1,007
|
ok changed flostv to just float and no more errors
function SHADER_planet_skills
{
while(1)
{
if(sun_objecta!=null)
{
mtl.Skill1=float(sun_objecta.x); ///sun object position in space, sun_objecta is an entity in space with a action.
mtl.Skill2=float(sun_objecta.y);
mtl.Skill3=float(sun_objecta.z);
mtl.Skill5=float(100/100);//Sun color red percentage /100
mtl.Skill6=float(100/100);//sun color green percentage /100
mtl.Skill7=float(100/100);//sun color blue percentage /100
}
wait(1);
}
}
but on a sphere with a normal texture i get no effect, on a sphere with a plain white texture i get no effect. i made an action and assigned it to both models but it does not appear to work, were have i gone wrong this time lol? btw thanks for this it looks really cool.
Why does everyone like dolphins?
Never trust a species which smiles all the time!
|
|
|
Re: [SUB] Planet Shader Contribution
[Re: jigalypuff]
#211692
06/17/08 19:46
06/17/08 19:46
|
Joined: Jul 2004
Posts: 1,710
MMike
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,710
|
a sphere model, and a white texture it won't work? can you specify the error? you see a black sphere or just the white itself? hum about normal map, well, why you want a normal map? if the object (plant) is round? I can do one with normalmap for specular normal if you want. ok changed flostv to just float and no more errors Well for lite-c right? i guess c-script needs floatv to convert the variable skill to a float 32 point float, im not sure though
Last edited by MMike; 06/17/08 19:48.
|
|
|
Re: [SUB] Planet Shader Contribution
[Re: MMike]
#211701
06/17/08 20:19
06/17/08 20:19
|
Joined: Nov 2005
Posts: 1,007
jigalypuff
Serious User
|
Serious User
Joined: Nov 2005
Posts: 1,007
|
sorry by normal texture i meant not a white texture. here`s a screenie of what ive gotten.  as you can see the planet with a normal texture is not affected by the shader nor is the one with just a white texture map.
Why does everyone like dolphins?
Never trust a species which smiles all the time!
|
|
|
Re: [SUB] Planet Shader Contribution
[Re: jigalypuff]
#211703
06/17/08 20:50
06/17/08 20:50
|
Joined: Jul 2004
Posts: 1,710
MMike
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,710
|
well, the right one: When i say white texture, i mean a small quad that is white, and will be all white, weird you get that effect, since it works ok with me :s i will check it. the left:, well, what happen if you remove the normal texture will it render correcly? and post a screen? this is a white textured(left) mapped (right)
Last edited by MMike; 06/17/08 21:00.
|
|
|
Re: [SUB] Planet Shader Contribution
[Re: MMike]
#211708
06/17/08 21:12
06/17/08 21:12
|
Joined: Nov 2005
Posts: 1,007
jigalypuff
Serious User
|
Serious User
Joined: Nov 2005
Posts: 1,007
|
did you define the sun position in world? (i mean the material skill1, 2, 3 ? erm, no lol. were do i fiddle with that? is it this part?
mtl.Skill1=float(sun_objecta.x); ///sun object position in space, sun_objecta is an entity in space with a action.
mtl.Skill2=float(sun_objecta.y);
mtl.Skill3=float(sun_objecta.z);
Why does everyone like dolphins?
Never trust a species which smiles all the time!
|
|
|
|