flat-shaded look?

Posted By: Freddy_dup1

flat-shaded look? - 06/03/07 13:46

Hello,

when I try to make my models look more flat-shaded nothing happens.
I tried to use a material.

When I change the "Specular" in MED`s D3D-Lightning the preview changes, but
when I try to do the same in the engine (by using a material) nothing happens.

Why?
How can I make things more flat-shaded?
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/03/07 14:17

I just noticed that there is no model - shading at all in my game.
Is there a way to turn it on?
I want it to look like it does in MED.
Posted By: ACKNEX007

Re: flat-shaded look? - 06/03/07 14:33

i am not sure about this..

maybe you can try this ..
make sure you set the ambient light colors , etc settings in File->Map Properties /Sun.

also to avoid the light affect on your models..
use : my.unlit = on;
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/03/07 14:41

Thanks,
but it still looks like there is no shader.
I tried to change Ambient and Sun, but only the color
and brightness change.
If I turn my.unlit=ON the models get black.
Posted By: xXxGuitar511

Re: flat-shaded look? - 06/03/07 15:02

for a flat-shaded look you have to unweld all the vertices at edges. Shaders use the normals of the vertices when calculating light, so normals will be interpolated between faces.

You might have to redo the model unles you have some good modelling software. Just make sure the edges you want flat-shaded are seperated.
Posted By: ACKNEX007

Re: flat-shaded look? - 06/03/07 15:06

you can use any special shaders than re - modeling ? !
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/03/07 15:08

Thanks.

@xXxGuitar511 :
I think that would work, but it sounds like an unprofessional
way to do it.
I thought that "materials" were included into
3DGS to change shadows.

It works in MED so there must be a way to do it in the
engine, too.
Posted By: xXxGuitar511

Re: flat-shaded look? - 06/03/07 15:28

- Materials are used in 3DGS
- Shadows have nothing to do with materials
- You mentioned shaders, are you using one?
- Unprofessional, no, thats just the only way to do it with 3DGS
Posted By: ACKNEX007

Re: flat-shaded look? - 06/03/07 15:43

try to post the screen shot of both results.. so it will be easy to help.
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/03/07 17:28

@xXxGuitar511
Shadows have nothing to do with materials?????
Manual:
"The material definition controls the lighting properties
of entities and surfaces, as well as special rendering
effects like pixel and vertex shaders."

If you right-click on the preview in MED and then click
on "GLX Properties" and than on "Advanced..." you can
change the material (and shadows on the model).
I want to do the same in the game.

@ACKNEX007
Sorry I haven`t got any web-space.
You can only see the edges of the models.
The rest is in one color and brightness. (No shadows)
I use a skin with only one color and brightness.
So only the shadows should be visible-
but there are no shadows.
Posted By: Scorpion

Re: flat-shaded look? - 06/03/07 19:58

shader don't have to do anything with shadows...
shader just calculate how the pixels of a model look like.
the only shadows a shader can do is to calculate the difference of 2 directions per dot-product and make the pixel brighter or darker...(its that shading that the models have ion the engine by default)

I am not 100% sure how the shadows are generated, but not with a shader
Posted By: ACKNEX007

Re: flat-shaded look? - 06/03/07 20:01

i think its not much hard if you are not talking about toon shader...

do you need to just use the light & shadows with materials ?


i think you can use free image hosting like :
http://imageshack.us/
http://www.tinypic.com
,etc


below i attached demo of a picture that i created with 3DGS.
that is using a simple material with ambient light settings ,etc
ScreenShot : http://i9.tinypic.com/4utrtdw.jpg

Thank You
Posted By: fogman

Re: flat-shaded look? - 06/03/07 23:46

Try something like this:

material flat_mat
{
ambient_red = 100; // play with these values
ambient_green = 100;
ambient_blue = 100;
diffuse_red = 200;
diffuse_green = 200;
diffuse_blue = 200;
specular_red = 200;
specular_green = 200;
specular_blue = 200;
power = 50;

effect = "
technique flatshadow
{
pass p0
{
fillmode = solid;
shademode = flat;
}
}
technique fallback
{
pass p0
{
}
}";
}

action flat_me
{
my.material = flat_mat
}

To fiddle around with materials you can download "MatsEd" at my signature. Itīs a Gamestudio material editor.
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/05/07 18:01

Some screen-shots...

This is how it should look like: (MED)




And this is how it looks like: (in game)


Posted By: nipx

Re: flat-shaded look? - 06/05/07 18:09

Do you use any materials/shaders?


nipx
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/05/07 19:17

No. I don`t use any shader.
I tried it with materials and without them. It`s the same.
It looks always like the picture.
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/05/07 19:21

@ACKNEX007 :
That picture of yours looks really great!
That`s the same effect as the one I would like to have.
Posted By: fogman

Re: flat-shaded look? - 06/05/07 20:24

It looks like it doesnīt have a skin at all.
What happens if you load it into MatsEd?
Posted By: ACKNEX007

Re: flat-shaded look? - 06/05/07 22:43

Freddy : if you need i can give you the source of that file..

also did u tried to create a empty file in WED and place this model only..
and do a test-Run ?

also..


i think the PROBLEM IS :

in the new version of Game Studio the Material Setting can be changed in MED..

try to change the ambient to (0,0,0,) and Specular To Whiter (255,255,255) , and Diffuse to any colors like (255,0,0)

then save and re-try..

Thank You..
Posted By: ACKNEX007

Re: flat-shaded look? - 06/05/07 22:46

also.. try to texture the model in MED , Maybe try with a Solid Color Picture..
..

if the error continues.. i think its probably a problem in model..
if yes : i can help you to fix the model..

Thanks.
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/06/07 13:59

I tried most of the things:

When I change the material in MED only the brightness
changes in WED but not the shadows. (strange!)

When I use a skin with more than one colour nothing is
different exept the skin. (no shadows)

I made an empty template-code-game and it`s still the same.

But the strangest thing is when I load the model in
"MatsEd Material Editor" it looks great!!
Exactly as it should.

What is wrong with my Version of 3DGS????

Thank you for all your effords!
Posted By: ACKNEX007

Re: flat-shaded look? - 06/06/07 14:06

which version of 3DGS you are using ? is it support new MDL formats ?
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/06/07 15:44

Yes, it`s the most recent commercial Version.
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/06/07 15:58

I found a way to make it work!
It works only if I place a light-entity next to it.
But it doesn`t work with static or dynamic lights that
were placed in WED.
Only code-made dynamic lights create the shadows.
Is that a bug?????
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/06/07 21:14

Does that mean that I can`t have that shadows on a
view-entity? I can`t create a light on the view.
Posted By: xXxGuitar511

Re: flat-shaded look? - 06/06/07 21:48

don't call it shadows, call it lighting

And no, you can't have lighting on view-entities...


@Freddy: Dynamic lights can only be done by using code. The dynamic flag on WED lights does not yet work! It's still a WIP. As for static lights, there has to be a block surface under the model that is lit. Static lighting is done by simply "looking downward and seeing how bright it is"...
Posted By: Michael_Schwarz

Re: flat-shaded look? - 06/07/07 00:39

@Freddy:
Thy applying a texture to your model. The problem you have, is cause because your model does not have any texture at all. Go ahead, make a simple gray/white txture and your problem is solved.
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/07/07 06:39

Itīs difficult to make a ego-shooter when you can`t
get lighting on view-entities. I don`t like it when the gun
and hand get into walls. But there are ways to get around it.
@Michael_Schwarz: The model got a gray texture (256X256).
I also tried different skins. It got no effect on the lightning.
Posted By: Michael_Schwarz

Re: flat-shaded look? - 06/07/07 09:59

Well, you need to create a skin-map aswell AND you need at least one light source in your level, the sun for example.
Posted By: Xarthor

Re: flat-shaded look? - 06/07/07 12:23

@Freddy:
Use level entities and the following flags:
- passable, so the weapon does not block the player's movement
- znear, so the weapon does not get into walls or anything similar
Posted By: xXxGuitar511

Re: flat-shaded look? - 06/07/07 14:41

exactly what I was going to say. As well as for the offsets, you cam simply do something like this:

Code:

ACTION Gun
{
...
proc_late();
while(1)
{
...
temp.x = 50;
temp.y = 0;
temp.z = -20;
vec_rotate(temp, camera.pan);
vec_set(my.x, temp);
vec_set(my.pan, camera.pan);
...
wait(1);
}
}


Posted By: ACKNEX007

Re: flat-shaded look? - 06/07/07 14:45

"
Use level entities and the following flags:
- passable, so the weapon does not block the player's movement
- znear, so the weapon does not get into walls or anything similar
"
Hi Xarthor ,
Freddy need help with Shading (lighting) ?
will passable objects solve that problem ? ;-)

Thanks
Posted By: xXxGuitar511

Re: flat-shaded look? - 06/07/07 15:43

Passable flag will not affect shading. It's simply for collision.

znear draws the entity above geometry and other entities (as if it were a view entity). This can only be set through script.

The code above will simply position the entity relative to the view (as a view entity does automatically. You'll have to adjust the temp offset though
Posted By: ACKNEX007

Re: flat-shaded look? - 06/07/07 16:22

oh..ok

so lets try to do that.
Posted By: Freddy_dup1

Re: flat-shaded look? - 06/07/07 16:36

Thank you!
I used the code to place the gun and an invisible entity-light next to
it. This is how it looks:

I made the gun very small and close
to the camera to avoid getting into a wall.
Than I tried znear. That`s even better.
Thanks!
Posted By: ACKNEX007

Re: flat-shaded look? - 06/07/07 17:01

nice..

happy to hear..that your problem is solved. !

Thanks
Posted By: xXxGuitar511

Re: flat-shaded look? - 06/07/07 18:02

Ha, no problem. Well actually, there is. I forgot to add a line that gives the gun the same angle as the camera

I fixed it in my above post (highlighted in red). Sorry about that...
© 2024 lite-C Forums