Simblesse Oblige Forum Index Simblesse Oblige
Forums for serious Simmers to share knowledge about The Sims 1
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TUTORIAL: Generating and Working with Z Buffers from Anim8or
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Simblesse Oblige Forum Index -> Object Creation and Recolor Shop
View previous topic :: View next topic  
Author Message
ts1depot
Member
Member


Joined: 16 Nov 2006
Posts: 83

PostPosted: Wed Oct 03, 2007 12:47 pm    Post subject: TUTORIAL: Generating and Working with Z Buffers from Anim8or Reply with quote

Hi, everyone.

I made a post about how to get the numbers in Anim8or, but felt it needed pictures and more elaboration, so here is my tutorial.

WHAT NOT TO EXPECT
I feel like I need to clear any misconceptions about what to expect from this tutorial before I start. Do not expect that from what I show you, you will be spitting out perfect Z Buffers from Anim8or that don't need tweaking later on in a graphics program. You will seldom get the Z Buffers the right lightness or darkness the first time and will most likely have to go back and forth a little bit to make them perfect.

So what should you expect? What you should expect is to create a "workable" Z Buffer sprite that can be easily tweaked in a graphics program if it comes out too dark or too light.

So let's get started.
Back to top
View user's profile Send private message Visit poster's website
ts1depot
Member
Member


Joined: 16 Nov 2006
Posts: 83

PostPosted: Wed Oct 03, 2007 12:51 pm    Post subject: STEP ONE: THE FORMULA Reply with quote

STEP ONE: THE FORMULA
How do you create Z Buffers in Anim8or? You click on the Depth Channel button and input numbers for the Z Far and Z Near fields. But what numbers do you put in each field? Remember algebra?

Z Near: X
Z Far: X + X + 50

In other words, in the Z Near field, you can put *any* number you want. But when you put in a number for the Z Far, it has to be THAT number you picked + plus itself + 50. So if you chose, say, 90 to put in the Z Near, you would put 230 as the Z Far. Why? Because 90 + 90 + 50 = 230.

What number do you put in the Z Near to begin with? Any number that creates a dark enough Z Buffer to play around with. I usually put a number between 90 and 100, but you can put any number, just as long as it doesn't make the Z Buffers too light. Don't worry about erring on the side of darkness because you can always lighten it later in a graphic program.



lockers_zbuffersback.jpg
 Description:
 Filesize:  44.61 KB
 Viewed:  10643 Time(s)

lockers_zbuffersback.jpg



_________________
The Sims Depot, still Simming after all these years


Last edited by ts1depot on Thu Oct 04, 2007 3:35 am; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website
ts1depot
Member
Member


Joined: 16 Nov 2006
Posts: 83

PostPosted: Wed Oct 03, 2007 12:55 pm    Post subject: STEP TWO: TWO SETS OF Z BUFFERS Reply with quote

STEP TWO: TWO SETS OF Z BUFFERS
Create your images for your a and p sprites, then two sets of buffers, one for the front and one for the back of the object. Always make the Z Buffers for the back a little darker than the one for the front, by two or three steps.

For example, for this set of school lockers, I made the front Z Buffer 97/ 244 and the back 100/ 250.



picture001.jpg
 Description:
 Filesize:  76.1 KB
 Viewed:  10678 Time(s)

picture001.jpg



lockers_zbuffercreation.jpg
 Description:
 Filesize:  44.55 KB
 Viewed:  10678 Time(s)

lockers_zbuffercreation.jpg



lockers_zbuffersfinal.jpg
 Description:
 Filesize:  29.89 KB
 Viewed:  10678 Time(s)

lockers_zbuffersfinal.jpg



_________________
The Sims Depot, still Simming after all these years


Last edited by ts1depot on Wed Oct 03, 2007 1:28 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
ts1depot
Member
Member


Joined: 16 Nov 2006
Posts: 83

PostPosted: Wed Oct 03, 2007 12:59 pm    Post subject: STEP THREE: CREATE SPRITES, IMPORT INTO T-MOG Reply with quote

STEP THREE: CREATE SPRITES, IMPORT INTO T-MOG
Output your images from Anim8or, then create your a, p, z sprites (I assume you know how to do this in a graphics program). Import the object back into T-Mog. Make sure to adjust the DX/ DY coords if the object is sitting way off the tile.



lockers_stacked.jpg
 Description:
Here I am in the process of making my a, z, and p sprites for T-Mog.
 Filesize:  41.35 KB
 Viewed:  10677 Time(s)

lockers_stacked.jpg



dxdy1.jpg
 Description:
When I import the object into T-Mog, the object is off tile, so I make sure to fix the DX/ DY coords before doing anything.
 Filesize:  33.9 KB
 Viewed:  10677 Time(s)

dxdy1.jpg



_________________
The Sims Depot, still Simming after all these years


Last edited by ts1depot on Wed Oct 03, 2007 1:48 pm; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website
ts1depot
Member
Member


Joined: 16 Nov 2006
Posts: 83

PostPosted: Wed Oct 03, 2007 1:01 pm    Post subject: STEP FOUR: TEST IN THE SIMS Reply with quote

STEP FOUR: TEST IN THE SIMS
Now test your object in The Sims by placing it in both corners of a room. You want to do this to see whether it clips or bleeds. Why? If it clips in the farthest corner, this means the Z Buffer may be too light and you will have to go into a graphics program and darken it a little bit. If it bleeds in the nearest corner, this means that the Z Buffer may be too dark and needs to be lightened.



lockers_bleedthrough.jpg
 Description:
In my initial test, the lockers do not clip in the farthest corner. However, you can see they bleed through the wall nearest to the viewer.
 Filesize:  108.82 KB
 Viewed:  10676 Time(s)

lockers_bleedthrough.jpg



_________________
The Sims Depot, still Simming after all these years


Last edited by ts1depot on Wed Oct 03, 2007 1:29 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
ts1depot
Member
Member


Joined: 16 Nov 2006
Posts: 83

PostPosted: Wed Oct 03, 2007 1:06 pm    Post subject: STEP FIVE: DX/ DY COORDINATES ISSUE? Reply with quote

STEP FIVE: DX/ DY COORDINATES ISSUE?
Notice I say MAY. This is because at this stage in the game, clipping and bleeding may not necessarily be a Z Buffer issue but a DX/ DY coordinates issue. Sometimes your Z Buffer may be perfect BUT what's causing the clipping or bleeding is that you have poorly placed your object on the tile.

One way to determine whether it's a Z Buffer or DX/DY coordinates issue is to note how badly the object clips or bleeds. If it's bleeding or clipping a LOT, then yes, you will have to alter the Z Buffers in a graphics program.

But if the bleeding and clipping is ever so slight, like a hair's breadth, then it is most likely a DX/ DY coordinates issue. This will require moving the object on the tile away from whichever wall (back, left or right) where there is the clipping or bleeding.

Another way to determine whether clipping or bleeding problems are Z Buffer or DX/ DY coordinates related is to rotate the camera views from both sides. If an object has no clipping or bleeding from one camera view but is doing that when you switch the camera views, then you know it's not a Z buffer problem and that you have to adjust the DX/ DY coords from the camera view with the issues to match the coords of the camera where the object has none.



zbuffer_little.jpg
 Description:
Here is another object. See how faintly it bleeds? This means that you do not have to modify the Z Buffers. All you have to do is adjust the DX/DY coords in T-Mog.
 Filesize:  37.14 KB
 Viewed:  10675 Time(s)

zbuffer_little.jpg



zbuffer_clean.jpg
 Description:
Here is the same exact object. The bleed is much stronger than in the previous picture. This most definitely requires an adjustment to the Z Buffers.
 Filesize:  35.94 KB
 Viewed:  10675 Time(s)

zbuffer_clean.jpg



_________________
The Sims Depot, still Simming after all these years


Last edited by ts1depot on Wed Oct 03, 2007 1:30 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
ts1depot
Member
Member


Joined: 16 Nov 2006
Posts: 83

PostPosted: Wed Oct 03, 2007 1:10 pm    Post subject: STEP SIX: LIGHTEN OR DARKEN Z BUFFERS IF NEEDED Reply with quote

STEP SIX: LIGHTEN OR DARKEN Z BUFFERS IF NEEDED
If you find yourself having to edit the Z Buffers because of clipping or bleeding, do not panic. You will not have to struggle with the lasso tool. (Read later, though, for an exception to this rule!) All you'll have to do is just lighten or darken the Z sprite. So open up your graphics program and lighten/ darken your Z sprite. However, lighten/ darken it just a tad, teeny, tiny bit!! Amazingly, even just an ever so slight lightening or darkening of a Z sprite will be effective.

FINAL STEP: RETEST IN SIMS
Reimport the changed Z Buffers and reopen the Sims to see how it all looks. If there is still a tiny bit of bleeding or clipping, then what you have to fix is the DX/ DY coordinates.

However, if the object now bleeds (when it was clipping before) or clips (when it had bled before), you went a little aboard adjusting the Z Buffers. You will have to go back into a graphics program to fix the bad Z Sprite by reversing whatever darkening or lightening you had done.



lockers_zbufferlightening.jpg
 Description:
Here is me lightening the Z Buffers of the school lockers in my graphics program. I have lightened it slightly, in 8 steps. When fixing Z Buffers you do not have to go crazy. Even lighening or darkening in tiny baby steps will work to fix the problem.
 Filesize:  60.69 KB
 Viewed:  10674 Time(s)

lockers_zbufferlightening.jpg



finished.jpg
 Description:
I reimport the lockers after lightening them in T-Mog. There is no clipping or bleeding so I guess I'm done!
 Filesize:  112.59 KB
 Viewed:  10658 Time(s)

finished.jpg



_________________
The Sims Depot, still Simming after all these years


Last edited by ts1depot on Wed Oct 03, 2007 1:50 pm; edited 4 times in total
Back to top
View user's profile Send private message Visit poster's website
ts1depot
Member
Member


Joined: 16 Nov 2006
Posts: 83

PostPosted: Wed Oct 03, 2007 1:17 pm    Post subject: EXPLANATION OF Z BUFFER FORMULA Reply with quote

So that's it in a nutshell, how to get and work with Z Buffers from Anim8or. Now to elaborate on some points and give a caveat:

EXPLANATION OF Z BUFFER FORMULA
Okay, so now you're wondering, why that formula? Why the x/ x+x+50? Easy. In the earlier days of experimenting with Z Buffers in Anim8or, I noticed that when I used to punch in any numbers I used to have this maddening problem where objects would bleed and clip at the same time, and in irregular shapes that made them difficult to fix in a graphics program. With an object like this one (see below), you would have to go in with the lasso tool and lighten and darken these bits.

I knew that this wasn't supposed to happen-- that in theory, if a Z Sprite needed to be fixed, the fix should've been uniform. In other words, it should've been a matter of either darkening or lightening the entire Z Sprite, not having parts of the Z sprite be irregularly dark or light. So I tried to figure out the formula between the two numbers that would make the type of Z Buffers where if they came out too dark or light, all that needed to be done was to fix the entire sprite. That was the formula I came up with.



yellow_lockers.jpg
 Description:
What happens when you don't use the formula. The object bleeds and clips in irregular chunks, requiring you to lasso tool these bits and pieces in a graphics program. :-(
 Filesize:  86.77 KB
 Viewed:  10671 Time(s)

yellow_lockers.jpg



zbuffer_clean.jpg
 Description:
What happens when you use the formula. If the object bleeds (or clips), it will do so in a very clean way so that even if you have to use the lasso tool, you will have an easier time selecting it in a graphics program.
 Filesize:  35.94 KB
 Viewed:  10671 Time(s)

zbuffer_clean.jpg



_________________
The Sims Depot, still Simming after all these years
Back to top
View user's profile Send private message Visit poster's website
ts1depot
Member
Member


Joined: 16 Nov 2006
Posts: 83

PostPosted: Wed Oct 03, 2007 1:24 pm    Post subject: THE EXCEPTION TO THE RULE Reply with quote

THE EXCEPTION TO THE RULE
Now I mentioned earlier that with this method of working you won't have to worry much about using the dreaded lasso tool to selectively darken or lighten bits of an object. All you have to do, essentially, is lighten or darken the Z Buffer in its entirety.

There is an exception to this rule.

I find that when you make an object in Anim8or a little too wide or a surface too tall, lightening and darkening the sprite becomes too much of a balancing act, no matter how perfectly you fix the DX/ DY coords or change its values to the perfect shade of grey. So, like, if you have an object that bleeds and you lighten the sprite to a perfect shade that prevents the bleeding, it will suddenly start clipping. Same problem with clipping. If you fix a clipping issue by darkening the sprite, you will have bleeding.

It's with this type of object where you will have to use the lasso tool. But the good news is that you don't have to bother with irregular bits of selection. All you have to do is choose the side that is bleeding and lighten it.

This principle even applies to objects where it SEEMS like you have to select little bits and pieces to fix the sprite. For example, you see the curio cabinet below where little bits are bleeding, and you think, "Oh, no! I have to select all those tiny bits with the lasso tool!"

Nope. All you have to do is just lighten the entire side of the object. If you lighten it the right amount of steps, the object will be fixed.

Say goodbye to selecting little bits and pieces of your object forever! =-)



curio_breakaway.jpg
 Description:
Here is me testing a curio cabinet in the game. As you can see, it bleeds heavily, because the object is a little wider than can be fixed by simply fixing the entire z sprite.
 Filesize:  14.97 KB
 Viewed:  10669 Time(s)

curio_breakaway.jpg



curio_breakaway2.jpg
 Description:
It looks as if from the bleed, you will have to select this irregular shape in a graphics program to fix the Z Buffers.
 Filesize:  10.65 KB
 Viewed:  10669 Time(s)

curio_breakaway2.jpg



curio_lselect.jpg
 Description:
But you don't. All you have to do is select one side of the object.
 Filesize:  11.43 KB
 Viewed:  10669 Time(s)

curio_lselect.jpg



_________________
The Sims Depot, still Simming after all these years
Back to top
View user's profile Send private message Visit poster's website
mtaman
Moderator
Moderator


Joined: 16 Aug 2006
Posts: 2858
Location: Monon, Indiana

PostPosted: Thu Oct 04, 2007 4:03 am    Post subject: Reply with quote

Thanks for a very informative tutorial. welldone
Back to top
View user's profile Send private message
ruthml
Moderator
Moderator


Joined: 25 Aug 2006
Posts: 3283
Location: Texas

PostPosted: Thu Oct 04, 2007 7:13 am    Post subject: Reply with quote

Thank you, that's an excellent tutorial!! notworthy
_________________
"If wishes were horses, beggars would ride." Dreams, however, are a different matter - you should have a whole stable full of those.



Back to top
View user's profile Send private message Visit poster's website
jotapomba
Member
Member


Joined: 31 Aug 2006
Posts: 84

PostPosted: Thu Oct 04, 2007 10:08 am    Post subject: Reply with quote

Thank you so much hug
_________________
Back to top
View user's profile Send private message Visit poster's website
ts1depot
Member
Member


Joined: 16 Nov 2006
Posts: 83

PostPosted: Thu Oct 04, 2007 1:01 pm    Post subject: Reply with quote

Thanks all. biggrin If you have any questions, feel free to ask!
_________________
The Sims Depot, still Simming after all these years
Back to top
View user's profile Send private message Visit poster's website
Madoria
Member
Member


Joined: 31 Aug 2006
Posts: 1725
Location: Scandinavia

PostPosted: Tue Oct 09, 2007 11:20 pm    Post subject: Reply with quote

notworthy
notworthy
notworthy
Back to top
View user's profile Send private message Visit poster's website
ts1depot
Member
Member


Joined: 16 Nov 2006
Posts: 83

PostPosted: Fri Oct 12, 2007 8:10 pm    Post subject: Reply with quote

biggrin
_________________
The Sims Depot, still Simming after all these years
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Simblesse Oblige Forum Index -> Object Creation and Recolor Shop All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group