Gradient Shading

General talk about the map making process.
Post Reply
User avatar
Strakowski
Private First Class
Private First Class
Posts: 79
Joined: Wed Jun 24, 2009 4:40 pm
Location: hiding somewhere in Overdoze

Gradient Shading

Post by Strakowski »

Is there anyway to perform gradient light shading (as is on meshes) on meshboxes? I just did a second version of an all mesh map almost exclusively in meshboxes and arcs, but, because there is no gradient shading on any of the faces, it doesn't look half as nice as the all mesh version. The difference is 235 KB to 35KB (mesh to box versions) and it's much easier to edit and work with the latter, but I just love this shading too much to let it go. I feel like this is probably a topic that has been brought up before, but I can't find any info on the wiki or the forum search.
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1405
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Re: Gradient Shading

Post by Spazzy McGee »

Arcs should automatically use shading, unless you have 'flatshading' in any of your materials or objects... Perhaps check you haven't accidentally included that.

http://my.bzflag.org/w/Arc
"Life is what happens to you while you're busy making other plans." - John Lennon
User avatar
Strakowski
Private First Class
Private First Class
Posts: 79
Joined: Wed Jun 24, 2009 4:40 pm
Location: hiding somewhere in Overdoze

Re: Gradient Shading

Post by Strakowski »

the arcs are fine (though the tops are not shaded), it's just the meshboxes.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Gradient Shading

Post by JeffM »

mesh boxes define surface normals so they will use the standard lighting based on your material properties, you do not have to do anything special to them. Settings like emission, specular, or as mentioned flat shade can cause the lighting to appear different.
ImageJeffM
User avatar
Strakowski
Private First Class
Private First Class
Posts: 79
Joined: Wed Jun 24, 2009 4:40 pm
Location: hiding somewhere in Overdoze

Re: Gradient Shading

Post by Strakowski »

Wait.. this is strange. I opened my map for a test and then resaved it using /saveworld to see what the meshboxes were being converted into. It automatically adds a flatshading tag to all of them. My "meshbox"s are translated into flatshaded arcs with 4 divisions when I run bzfs. I suppose this is to make them look like the old bzflag "box" which is drawn flatshaded. I guess I'll just use 4-div arcs in place of meshboxes and then I won't have to worry about this. Odd to think that meshboxes really just become arcs though.
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Gradient Shading

Post by blast »

Meshboxes are arcs. That's how they are treated internally. It's just a faster way that defining it as such in the map file. There is also "meshed boxes", which is the normal 'box' object with some 'mesh' parameter (like matref, shift, etc) added to it. One way to convert a 'box' to a "meshed box" is by adding "shift 0 0 0" to the box. These are treated different compared to the normal box and the meshbox objects.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
Post Reply