Gamestudio Links
Zorro Links
Newest Posts
FXCM demo test failed
by qin. 01/13/26 13:53
Camera always moves upwards?
by NeoDumont. 01/12/26 09:39
Alpaca Plugin v1.5.2 Release
by kzhao. 01/11/26 13:42
Alpaca Plugin v1.4.0
by kzhao. 01/11/26 13:38
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (Quad), 6,361 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
promfast, joe_kane, Namitha_NN, Syndrela, agasior
19190 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 7 1 2 3 4 5 6 7
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 Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
Originally Posted By: Joey
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: MMike] #211637
06/17/08 16:04
06/17/08 16:04
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
so the color on the sphere is made by the shader, right?

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 Offline OP
Serious User
MMike  Offline 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: MMike] #211676
06/17/08 18:47
06/17/08 18:47
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
my problem is that i can't really see what this complex shader is doing. it won't be a standard phong lighting shader. i can't see any glow, neither.

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 Offline
Serious User
jigalypuff  Offline
Serious User

Joined: Nov 2005
Posts: 1,007
ok changed flostv to just float and no more errors
Code:
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 Offline OP
Serious User
MMike  Offline 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.

Quote:
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 Offline
Serious User
jigalypuff  Offline
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 Offline OP
Serious User
MMike  Offline 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] #211704
06/17/08 20:51
06/17/08 20:51
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
did you define the sun position in world? (i mean the material skill1, 2, 3 ?

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 Offline
Serious User
jigalypuff  Offline
Serious User

Joined: Nov 2005
Posts: 1,007
Originally Posted By: MMike
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?
Code:
 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!
Page 2 of 7 1 2 3 4 5 6 7

Moderated by  Blink, Hummel, Superku 

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