Gradient Shading
- Strakowski
- Private First Class
- Posts: 79
- Joined: Wed Jun 24, 2009 4:40 pm
- Location: hiding somewhere in Overdoze
Gradient Shading
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.
- Spazzy McGee
- Sergeant Major
- Posts: 1405
- Joined: Mon Mar 21, 2005 4:59 pm
- Location: Planet MoFo, Sheffield Division; United Kingdom
Re: Gradient Shading
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
http://my.bzflag.org/w/Arc
"Life is what happens to you while you're busy making other plans." - John Lennon
- Strakowski
- Private First Class
- Posts: 79
- Joined: Wed Jun 24, 2009 4:40 pm
- Location: hiding somewhere in Overdoze
Re: Gradient Shading
the arcs are fine (though the tops are not shaded), it's just the meshboxes.
Re: Gradient Shading
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.
JeffM
- Strakowski
- Private First Class
- Posts: 79
- Joined: Wed Jun 24, 2009 4:40 pm
- Location: hiding somewhere in Overdoze
Re: Gradient Shading
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.
Re: Gradient Shading
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.