Tuesday, February 17, 2009

(0) Comments

Breaking Subsurface Scattering into Render Layers in Maya

welcome to infomix.blogspot.com

Greetings everyone. So I've had a amount of humans access me actuality at academy about a adjustment I've been application to breach my Miss_fast_skin_maya subsurface shader into cede layers so I accept abreast complete ascendancy of it in compositing, so I admitting I'd address up a tutorial actuality to share.

Please note: This tutorial is added about the action of breaking the subsurface into cede layers and compositing them in post, rather than how to use the miss_fast_skin_maya subsurface shader. There are several rather accomplished subsurface tutorials out there on the internet, a brace of them getting actuality on CGTalk, admitting one in accurate I've begin to be actual able-bodied accounting and absolutely bombastic is Jared Martin's tutorial here. However, amuse agenda that even admitting Jared's tutorial is based on the miss_fast_simple_maya subsurface shader, you'll acquisition the fast simple and fast derma shaders are about identical, except the derma shader brings the Epidermal, Subdermal, and Aback besprinkle attributes in to alter the fast simple's foreground and aback SSS blush attributes. Also, the fast derma shader has added specular ascendancy than the latter. But the aforementioned methods acclimated in this tutorial will plan with the fast simple subsurface shader as well.

Also note, Maya 7.0.1 was acclimated in this tutorial, however, the accepted methods administer to all 3d applications area cede layers and band overrides are achievable. This tutorial is bold you already accept your subsurface shader set up and working, though, if you accept any questions or complications, feel chargeless to ask and I'm abiding one of the abounding ablaze minds actuality at CG Talk can point you in the appropriate direction. Or I can advice you, either way.

By the end of this tutorial, I will accept absolved you through, not alone how to breach down your subsurface shader attributes into their own cede layers, but aswell how to cede out an occlusion pass, and a adumbration canyon for compositing in post. You could yield this even added on your own as a fun little agreement to cede out your ablaze passes, ZDepth, Motion vectors, etc, but I won't be delving into that here. (Perhaps for addition tutorial topic? � forward me a PM if it's of interest)

Without added delay, time to begin! Aboriginal things first, analysis your subsurface shader with a adorableness pass, just to accomplish abiding all is in order. I ambition I could say I had a appealing archetypal for you guys appropriately UVed with a color/spec/bump map, but acceptable ol' MaleHead actuality via the Modo archetype archetypal includes will accept to do. Obviously there are some issues here, but, for the purposes of this tutorial, this will work.

And, just in case you're a little behind, you can snag my shader attributes actuality as a starting point, they're not far from defaults, though, remember, depending on your lighting scenario, arena scale/units, and added factors, you will charge to adapt these values.

As you can see, currently none of these attributes listed are mapped, however, it is actual important to agenda that every one of these with the 'map' figure can in actuality by mapped. As you'll appear to find, getting able to map these attributes alone is actual accessible for authoritative things; for example. For your aback scatter, you'll apprehension that assertive locations of the ear would acknowledge added aback besprinkle than added denser parts, depending on your model, this can be done by tweaking your backscatter radius, weight, and abyss until you get it just right, or, you can map said ethics and accept added authentic ascendancy as to area you wish the backscatter ethics to appearance up; additionally with all the added attributes. Though, already again, for this tutorial we're mainly absorbed on how to breach this shader up into cede layers.

So now that our adorableness canyon is arrested off and accessible to go, it's time to alpha authoritative the cede layers. But first, let's yield a attending aback up at the shader chat and appraise what it is absolutely we wish to accomplish. In our composite, there are several altered means to body up our layers on top of anniversary added to simulate the sub-surface aftereffect in post, however, anniversary adjustment will crave us to abstract anniversary one of our altered band 'colors': Diffuse, Epidermal Besprinkle Color, Subdermal Besprinkle Color, Aback Besprinkle Color, and Primary/Secondary Specular Colors. To do this, we charge to actualize a cede band for anniversary one of these attributes. In case you are new to the abstraction of cede layers, you can admission the cede band chat by bang on the Show/Hide approach box/Layer editor abreast the top appropriate of the interface.

And again you can accept to either appearance both the approach and band editors, or just the band editor by beat on one of these two buttons.

Once at the Band Editor dialogue, be abiding to change your band controls from 'Display' layers, which ascendancy the concrete affectation layers of your scene, to Cede layers, which, as you estimated it, controls the cede layers.

Next, bang on the figure apparent in the afterward angel to 'Create a new abandoned layer'. Because of some bugs that abide with Maya 7.0.1 with the added button 'Create a new band and accredit called objects', we'll just actualize an abandoned band for now and manually add in the elements we wish in there.

You'll apprehension that two layers are added to the dialogue, a cede band alleged masterLayer, and a new layer, apparently called layer1. What your masterLayer is, as you may accept guessed, is the abject blunt 'beauty pass' cede band that you are examination by default. Layer1 is the new abandoned band that we accept just created. If you bang on layer1, you'll see that there is annihilation to display, why, because it's empty! We charge to add in the altar we wish in that cede layer, but first, what to alarm it? A acceptable addiction to get into, is to aboriginal actualize what I usually alarm my masterCopy layer. This is a absolute alike of my accepted masterLayer, just in case annihilation happens to fubar in my masterLayer, I accept a backup! To rename this layer, you can double-click on the name layer1 to accompany up the adapt band dialogue. Change the name actuality from layer1 to masterCopy and bang save. Once that's taken affliction of, to add altar to this cede layer, aback it is a absolute alike of our masterLayer, accomplish abiding your masterLayer is selected, Go to Adapt > Baddest All. Go aback over to your cede band dialogue, authority down appropriate bang on masterCopy and baddest 'Add Called Objects'. All called altar in the arena will be added to this cede layer.

With that out of the way, the fun begins! Go advanced and actualize 7 added abandoned cede layers, allotment anniversary one of them respectively: diffuseLayer, epidermalLayer, subdermalLayer, backscatterLayer, specularLayer, shadowLayer and assuredly occlusionLayer. Another acceptable convenance to get into if alive with cede layers is to name all of your layers according to appliance and aswell to stick to a allotment convention. You don't accept to use my allotment convention, but acquisition something that works for you that tells you what that band contains but aswell follows acceptable allotment assemblage guidelines. Let's activate with our diffuseLayer. Baddest your geometry, in my case, the arch I'm alive with, the two atramentous spheres for the eyeballs and my lights. This appearance will aswell appearance you the accepted accession of my lights for this scene.

Hold down appropriate bang on the diffuseLayer and bang 'Add Selected Objects'. Now you should accept a archetype of your alternative in the diffuseLayer. Highlight the diffuseLayer in the cede layers chat to appearance that cede layer, afore you move on to the next step.

If it's not already open, accessible up your hypershade and accompany up your attributes for your subsurface shader. What we wish to do for this band is to abstract our broadcast blush and about adumbrate aggregate else. To do this, we will actualize a band override on the epidermal besprinkle weight, subdermal besprinkle weight, aback besprinkle weight, and the all-embracing weight of our specularity. To actualize a band override on a parameter, authority down appropriate bang on the aspect title, and bang on 'Create Band Override'. Doing this will accomplish the argument of the aspect adventurous and orange to announce that changes to this constant will alone affect this cede band and annihilation else.

Now, set the epidermal besprinkle weight to 0. This will aught out the furnishings of the epidermal besprinkle in the cede and achievement annihilation instead, this is absolutely what we want. We will abide down the account and do the aforementioned for subdermal besprinkle weight, aback besprinkle weight, and again specularity. Don't anguish if you apprehension a slight adjournment afterwards alteration the attributes here, remember, anniversary time you change the values, brainy ray re-renders the baby affectation icon, this is what is causing the delay.

With all these ethics set to 0, your thumbnail should now attending about like a collapsed lambert with your broadcast color, excellent! We accept abandoned the broadcast color. However, there's one added footfall we charge to yield for compositing purposes. In your scene, baddest whatever lights you accept that are casting shadows, and accompany up their attributes. For the broadcast layer, and all layers following, we wish to about-face off the adumbration casting, except for on our shadowLayer of course, but we'll burrow into that later. To about-face off the adumbration casting, we will use a band override on the ray trace adumbration banderole (assuming you are application ray traced shadows, if you're application abyss map, the aforementioned applies but to the 'Use Abyss Map Shadows' flag), un-flag the analysis box.

Repeat this footfall for every ablaze you accept casting a adumbration and assuredly our diffuseLayer is complete. I went advanced and rendered my frame. You can accept to cede anniversary anatomy and save it off afterwards you accomplishment anniversary cede layer, or, at the end you can just accumulation cede all of the frames at once, which I'll explain how to do after in the tutorial.

Note: You'll apprehension that even admitting adumbration casting has been angry off, there is still some shadowing on our broadcast layer. More avant-garde users, if you apperceive how to actualize a cede band for ambient blush and ablaze passes to ascendancy the broadcast shading, that is advised, contrarily this will plan for the purposes of this demonstration. Remember aback in brand academy if kids acclimated to say 'Hey, your covering is showing, your covering is showing, ha-ha-ha!'� well� in a few abnormal that's ALL that'll be showing. *ba-dum crash* Alright, well, abundant with the abhorrent attempts at evocative humor, aback to work! Appropriate now your epidermal band is empty; absolutely like you did with your broadcast layer, baddest your lights, and geometry and appropriate bang on your epidermalLayer and 'add called objects'. Just like you had with your broadcast layer, you're traveling to go into your hypershade, and accompany up your subsurface shader properties. For this cede layer, what we wish to do is abstract our epidermal besprinkle color, and adumbrate all the added layers. How do we do that you ask? Band overrides! Except this time, you're traveling to wish to actualize a band override on Broadcast Weight, Subdermal Besprinkle Weight, Aback Besprinkle Weight, and Specularity Weight, abrogation the Epidermal Weight in tact.

Almost done, but remember, for this band too, you aswell wish to about-face off caliginosity on all of your lights by application a band override on the 'Use XXXX Shadows' analysis box.

It doesn't attending like abundant now, but it will appear in handy! On to Subdermal. Exactly as you accept previously, add in your geometry and lights to the subdermalLayer. On this layer, you're traveling to wish band overrides in the aforementioned address for: Diffuse Weight, Epidermal Weight, Back Scatter Weight, and Specularity Weight. As illustrated below.

And already again, about-face off caliginosity on all of your lights by application a band override on the 'Use XXXX Shadows' analysis box.

The after-effects from our subdermal isolation. We're accepting abutting now! On to our backscatterLayer. Once again, archetype your geometry and lights into the backscatterLayer like you accept with the antecedent layers. And as you accept with the accomplished few layers, you're traveling to use band overrides to set the afterward weights to 0: Diffuse Weight, Epidermal Weight, Subdermal Weight, and Specularity weight, as illustrated below.

And as always, about-face the caliginosity off on your lights. Via the band override method.

And the after-effects of backscatter. Note, that back the backscatter is abundant added attenuate in our subsurface settings, it is abundant beneath arresting than the added cede layers, if you attending closely, you'll see this is not a atramentous frame. Moving appropriate along, for your specularLayer, things get a bit added interesting. First, go advanced and acceptation your geometry and lights like you accept for all your added cede layers. Open up your subsurface shader properties, and this time, you're traveling to actualize band overrides application the aforementioned action as afore for the afterward properties: Diffuse Weight, Epidermal weight, Subdermal Weight, and Back Scatter Weight.

Now, area this can get a little trickier, is the actuality that you're ambidextrous with two altered specular controls; a Primary and Accessory specular. Now, for our added avant-garde users, if you wanted, you could set the Primary specular blush to a authentic red, and the accessory specular blush to either Green/Blue, and then, abstract the red and green/blue channels to cull both speculars from the one render, then, you would blush actual the now breach speculars and band them on with the blow of the stuff. For the purposes of this tutorial, however, I'm traveling to leave them at their authentic color, and leave them as calm on one render. However, application the aforementioned methods I've been traveling over in the tutorial, if you capital to ascendancy both of the speculars separately, you could accomplish a additional specularLayer and use your band overrides on the afterward ethics per band to ascendancy whether or not they appearance up.

But as I said, for the purposes of this demonstration, I'm traveling to leave them abandoned and just cede them both in one pass. Remember to about-face off your shadows!

Only two layers left! Occlusion and Shadow. These two are a little different, so now would be a acceptable time to lift your arch up and clean the distill off . This time, just baddest your geometry, no lights, and add them to your occlusionLayer (you should be a pro at this by now). To reiterate, there should be no lights in your occlusionLayer. Now, those of you who would accede yourself a added avant-garde user, I would admonish not application the maya absence presets, and instead manually bead a mib_ambient_occlusion brainy ray arrangement into a apparent shader out blush and again selectively abacus that shader to the altar you wish to account occlusion on. But for the purposes of this tutorial, I am traveling to use the absence maya preset for ambient occlusion. So, what you're traveling to do it go to your cede layers dialogue, and baddest your occlusionLayer layer. Hold down appropriate bang on your occlusionLayer, hover over presets, and baddest 'Occlusion' from the account beneath presets. If done correctly, your band will get a little dejected brawl figure like this.

What this will do is automatically actualize a band override shader for use on every article in this band and will administer the brainy ray ambient occlusion shader. Note, this will clean out any added shaders you accept on this layer, because it is a affected absolute override for the absolute layer. To get rid of the absolute override for occlusion, authority down appropriate bang on your occlusionLayer and baddest 'Remove Absolute Override'. This will not annul the apparent shader it created for the ambient occlusion, that will still be in your Materials tab in your hypershade, however, it will acquiesce you to add added shaders into the band if you so desire. Clicking on the little dejected brawl will accompany up the backdrop of the surfaceShader it automatically created for you. To adapt your absolute ambient occlusion settings, bang on the affiliation hotlink at Out Color, and you there you accept it.

You'll wish to addition up your samples to a admirable amount to get rid of babble that will appear, depending on the calibration of your model, usually 512-1024 samples are abundant to get rid of a lot of apparent noise. I'm not traveling to get into the added attributes of occlusion in this tutorial, but your after-effects should attending something affectionate of like this.

The occlusion is a little harsh, but you get the concept. And finally, our tutorial is ambagious down with our adumbration layer! Crank up those application and lets accomplish this babyish pop. This one is a little trickier yet, and is one of abounding methods of isolating shadows, but, it works appealing well. First, add in to your shadowLayer your geometry and alone the lights that are in fact casting shadows. This time, leave your caliginosity angry ON, this is the accomplished purpose of this cede layer. Then what you're traveling to wish to do is to actualize a Maya lambert shader. Open the backdrop of this lambert and change the blush to authentic white, and the broadcast up to 1, like such.

Once you've created your lambert, annoyance this assimilate your geometry in the shadowLayer to alter the accepted shader. Now comes the air-conditioned part. Open up your ablaze that's casting the shadow, and you're traveling to actualize to two band overrides. One on acuteness and one on adumbration color, like such.

You're traveling to wish to set your acuteness to 0, and your adumbration blush to authentic red (1,0,0- RGB). What this will actualize is a book like this. (note, in my arena I accept two lights that are casting shadows).

What you're seeing actuality is about a 'mask' for the casting caliginosity on my object. To in fact use this in compositing, in a affairs like Shake you can artlessly accomplish a 'reorder' on this, abstract the red approach (rrrr), and use the aftereffect as a affectation for a blush actual at the end of the bulge tree. Use the blush actual to becloud the breadth in the mask. So now we accept all of our cede layers set up and accessible to go. If you accept been apprehension out anniversary anatomy footfall by footfall in the tutorial, you can just jump appropriate into compositing them together. If not, lets go advanced and accumulation cede all of our frames out. What you'll wish to do first, is accomplish abiding all of your cede layers you in fact wish to cede are flagged with the letter 'R' in the cede layers dialogue, like such.

Left beat on this little R will about-face the 'render' banderole on and off, basically, if the R is angry on, in a bitch, the band will cede with the scene. If the R is angry off, as you ability accept guessed, the band will not cede if you batch. So you see how in the angel aloft I accept the cede banderole angry 'off' for my masterCopy? That's because I don't wan to cede my adorableness canyon afresh with my layers, I just wish my layers. Remember to unflag masterLayer as well. Now that's done with. You're traveling to 'set' your activity to your adapted alive folder. If you don't apperceive how to set your project, go to File > Activity > Set, again accept the binder area you wish all of your achievement to be spit. Once your activity is set, go into your cede globals, change the 'Quality Presets' beneath the brainy ray tab to assembly quality.

Then go aback to the 'Common' tab and set your adapted filename prefix, change the dropdown for anatomy ext. depending whether or not you accept activated frames, change your angel architecture to whatever it is you admiration (usually tiffs, tga, and iff works accurately for this) and finally, set your rendered angel admeasurement and abutting the dialogue. (Note: if you're a added avant-garde user and wish to change about your settings a bit for optimization, that would be advised).

Now, about-face your card options in the top larboard from whatever they are down to Rendering

Click on the 'Render' card at the top, and finally, on Batch Render.

This action will yield some time, as it is now traveling to cede out anniversary one of your cede layers and discharge their achievement to your 'set' activity directory. So go grab a cup of coffee, do some jumping jacks, whatever you want, until this is done apprehension out. When the accumulation cede is complete it'll acquaint you down in the basal appropriate bend on your command output. -- Entering harder hat area -- From actuality the tutorial is traveling to get a little looser. Back there are so abounding altered means to achieve this composite, I'm traveling to explain my methods, but note, these are not the alone means this can be done. For my composite, I'm traveling to be application Shake, because it allows me a abundant accord added ascendancy on layering and blush acclimation my layers together. Though, a lot of of the aforementioned methods are achievable with Photoshop as well. Nearly aggregate with the barring of the occlusion and adumbration band is just buried on top of one addition as you'll see in the screenshot below. For the adumbration and occlusion layers, my adjustment for affiliation was altered from all my added blush layers. For the adumbration layer, as I explained earlier, the red was acting as a 'mask' for the shadow, I reordered the adumbration to abstract the red approach to act as my alpha for a blush actual on top of all the layers up to this point. This way, we can add in blush to our adumbration by tweaking the accretion on the blush actual node. Likewise with occlusion; however, for this archetype what I've done is astern the occlusion layer, so that the atramentous is white and white is black. Back white acts as the 'pass-through' for a mask, this will acquiesce us to use the acquaintance adumbration produced by occlusion as a affectation for a blush correction, so already again, we can use the accretion on the blush actual to add blush into the occlusion as against to artlessly adding a atramentous occlusion band on top of our object. The quickpaint on the occlusion was acclimated to fix some of the ethics on the occlusion back I didn't abuse my occlusion shader settings afore rendering. And to note, the s_FilmEffect is a macro via GenArts plugins for agitate acclimated to ascendancy some blush corrections at the end of the chain.

As you'll notice, I've alone all my rendered layers into the agitate workflow and placed them in adjustment that they should be layered. Diffuse on the bottom, backscatter on top of that, subdermal on top of that, epidermal on top of that, again we accept our specular our shadow, and assuredly our occlusion. For anniversary of the blush layers, you'll apprehension I've added a blush actual node, this about allows me to alone ascendancy the blush and amount of anniversary layer; this can be advantageous in several situations. Lets say I'm aggravating to accommodate my appearance to a painting I've made. I fix up the ethics in maya as abutting as I can, and things are searching right. I cede it out, try to blended it in there, but I apprehension that the blush of my specular is off just a hair, or my epidermal is too desaturated, or my adumbration is the amiss color, whatever the case may be. Instead of now accepting to abuse a value, re-render the frame, bout it up, apprehension it's still off, abuse some number, re-render a frame, etc. etc. I can artlessly abuse the blush ethics of the epidermal or specular in compositing in absolute time, after accepting to delay on renders. This in the end is the all-embracing advantage to apprehension all of these attributes in their own layer, above ascendancy to tweaks to color, value, and such after the affliction of accepting to always re-render my frames. Now, in assertive situations, you will still charge to re-render your frames. For example, if your ablaze position is wrong, or, all-embracing the abyss of your backscatter is too low, your adumbration samples are too sharp, etc, again there are a few tweaks you 'can' do in compositing to try and compensate, but it may crave you to end up re-rendering your layers anyways. So this brings us to the cessation of this actual continued 'little' tutorial I had advised on autograph up. If you've fabricated it this far, acknowledgment for afraid through it! Here is a appearance of what our blended looks like with the ethics just layered on top of one another.

And actuality are a few examples of the ability of application the cede layers to bound acclimatize the blush and ethics of these layers to change the all-embracing actualization and affection of the model.


Tuesday, February 17, 2009

(0) Comments

Rendering a Yellow Ferarri with 3dsmax

welcome to infomix.blogspot.com

As you can see above, this is the final image. It took me 15 mins to accomplish this attending with a Dual Xeon 3.0 and 2GB RAM. For bigger resolution, amuse go to my angel gallery.

Here is the arena blueprint in 3ds Max (I acclimated adaptation 9).

The capital abstraction for this angel was to accept bendable caliginosity and realism, so I acclimated breadth lights. I placed two breadth lights and a skylight which is annihilation fancy. Didn't blow the ambit of the skylight (skylight is bare for Final Gather).

Usually for reflections, HDR images are cool, about for this bearings HDR is useless. The ambiance was lit absolutely abundant to attempt with HDR lighting or reflections.

Scene calibration is one of the a lot of important things if you plan with both breadth lights and GI. In some situations, you accept to do some balloon & absurdity to bolt the mood. I fabricated some trials myself as well.

Below is the brainy ray car acrylic shader.

I larboard the walls accessible abaft the camera so that the ambiance blush can canyon to the arena and reflect off the car physique and added things in the scene. I put a acclivity access on a slot, called all-around ambiance mapping and accept this for Max’s environment. It's consistently bigger to use a acclivity access to actor the atmosphere. In this case, the ambiance blush is not apparent acutely on the scene, but it helps a lot for the plan progress.

Here is the a lot of able being - Exposure Control. It's already afresh accompanying to the arena calibration and units, there is no accepted lighting bureaucracy for anniversary scene. Exposure ascendancy helps you a lot if you accept aphotic images and it fixes the blow if you don't wish to play about with the lighting ambit too much.

I accept acclimated absence settings for GI and “Hi” preset for the final gathering. Basic blush alteration is activated in Photoshop for the final image. I achievement you've enjoyed this baby 'making-of'.


Tuesday, February 17, 2009

(0) Comments

Rendering tutorial

welcome to infomix.blogspot.com

Sorting faces and application Z buffers

There's affluence of being that can go amiss if you're aggravating to affectation faces and added 3D altar on a 2D display. I'll accord an overview of accepted problems, accord accessible solutions for these problems, and explain what I did in the case I apparent it in my apprehension engine.

Faces appearance up in the amiss order

Rendering 3D faces, such as the walls and roof locations of our house, can be alarming if you're accomplishing it for the aboriginal time and accord ambagious after-effects if you don't watch it carefully. There's a bit of plan complex in announcement faces correctly, and I'll accord a aboriginal important address you'll accept to apparatus to accomplish abiding the faces of your objects don't look like crap.

I'm not traveling to altercate how you can draw faces or polygons on your screen, as it is out of ambit for this tutorial. There's a huge bulk of abstract accessible on this subject. If you're autograph a pixel based renderer (in adverse to my engine that works absolutely with vectors) you ability wish to do (gouraud or phong) concealment or texturing of your faces, but I'm not traveling to altercate this.

A affair that can go amiss is apparent in the account to the right. Faces appearance up in the amiss adjustment (this is not a bug in my apprehension engine, I can calmly about-face it on and off from my capital program). Some faces should be in foreground of others, but they appearance up covered by the face that is declared to be in the back. Your computer is blind of this and just displays them in the adjustment you acquaint him to. So it's a acceptable abstraction to array your faces afore announcement them, such that your apprehension engine displays the faces in the aback afore assuming the ones in front.

The catechism is how to actuate which face is in foreground of another. The acknowledgment is simple (but not sound, as I will appearance later). For a face, you can calmly actuate the abyss of the face by searching at the depth, or Z ethics of the coordinates basic the face. A face is in foreground of addition one if all of its coordinates' Z ethics are abate than the added face's coordinates' depths. We can accomplish it easier by accretion the boilerplate abyss of all coordinates that accomplish up a face, and analyze these depths. We can array all faces with abbreviating boilerplate depth, and affectation the faces in that order. The account on the appropriate shows the aforementioned appearance of the abode as the one above, but with all of its faces in the appropriate order.

There's one endure affair I'd like to appearance on this matter. Some humans don't apperceive how to array correctly. I accept met acceptance who can't transform a allocation algorithm that after-effects in an accretion adjustment to a allocation algorithm with abbreviating order, so don't be afraid (it alone takes two abnormal to acquisition the "<" or ">" and accomplish it the added one). I told you to array them with a abbreviating abyss and not the added way around! The account on the appropriate shows you the after-effects of allocation aggregate the amiss way. It gives some affectionate of an chaotic appearance of the house. If you see this in your apprehension engine, don't appear accusatory with me because I'll just laugh.

How I apparent it in my engine, and why I can about-face it on and off so easily

I will accommodate an addition way of allocation faces that was accessible in the architecture of my engine. Since my renderer uses the FIG architecture as an achievement format, I was able to corruption a affection in the FIG architecture that accustomed me to put faces in foreground of others area needed. The FIG book architecture has a abyss band system, in which you can accredit all 2D altar to a assertive abyss alignment from 0 to 999. So, in adjustment to put faces in foreground of one another, I can resort to this as a simulation of allocation the faces myself. The FIG architecture doesn't accept any data on what happens if you accept added than one article in the aforementioned layer. It is not defined whether one article is fatigued on top of the added if they're both on one layer, so it wouldn't advice me allocation them anyways.

Before I alpha apprehension my 3D altar to 2D objects, I aboriginal concern all the altar what affectionate of a abyss ambit they will crave for announcement them after in 2D objects. Aloft rendering, I accord the altar a block of FIG's layers and let the altar themselves amount out in which layers they accord in adjustment to body a FIG book in which the added altar end up in the added layers. This allows me to calmly assemble acceptable 2D images of my 3D worlds. I am alone bound to 1000 abyss layers, but it fits my accepted needs.

This abyss absorber is frequently accepted as a Z buffer.

Since I accredit a block of the layers aloft rendering, I can do air-conditioned things with my apprehension engine (although these will alone be acclimated in this tutorial). For example, I can calmly about-face the minimum and best band they may use and appearance you what affectionate of angel you ability apprehend if you don't apperceive what allocation is all about and do it upside down (as apparent in the third angel in this tutorial part). I can aswell accredit alone one band to the accomplished apple and appearance you what goes amiss if you don't array (the aboriginal angel in this part).

There's some added absorbing things I can do with those chunks of layers, too. I can acquaint the renderer to put assertive altar in a ambit of layers that is on top of some added objects, although the article on top should be in the bottom. I accept acclimated this ambush to actualize the apple angle in the pictures. First, I draw the abode in the basal bisected of the accessible layers. After that, I use the top layers to affectation the X, Y and Z axes and the wireframe of the abode on top of it. Using wireframes and dotted and abject band styles, the axes and the wireframe assume to be allotment of the accomplished rendered images, but it's fraud. You may allege me of cheating, but I anticipate it's artlessly an accomplished affection of my renderer. Of advance you can do this with your engine too by advisedly allocation some altar amiss afore announcement them.

Some faces still appearance up wrong

I accept already acicular out that the use of boilerplate base is not sound, and may aftereffect in adulterated images. I will now go into that.

In the account on the appropriate you can see what goes amiss in my apprehension engine if I try to cede 2 accurately crafted faces. In the apple view, the dejected face can alone be apparent as a line. It should, however, be bright from the apple appearance that the dejected face is declared to sit afterpiece to the camera, or in foreground of the red face if we're announcement both faces. However, as the red face is bigger than the dejected face, and back it has some coordinates that are abundant afterpiece to the camera than the dejected face's coordinates, it's boilerplate abyss becomes abate than the boilerplate abyss of the coordinates in the dejected face. This after-effects in the red face getting rendered in foreground of the dejected face. And this can be a difficult botheration to solve. I accept currently no band-aid for this in my apprehension engine. There are a brace of means to break this botheration if you absolutely charge to get it out of the way.

One ambush would be to assassinate an algorithm for "hidden band removal" or "hidden polygon removal" on your polygons. But this is not simple to implement. The hidden band abatement algorithm seeks band segments of your polygons that are hidden afterwards faces that should appear in foreground of them, and again cuts the band segments (together with chunks of the polygon that are hidden) out of the polygons. As such, alone the arresting allotment (or parts, if one polygon cuts through addition one) of a polygon charcoal in the apprehension engine, and the faces appearance up correctly. It is appealing complicated to get a acceptable alive hidden band remover to plan in a 3d engine in adjustment for faces to appearance up correctly. There's affluence of accessible cases to plan out to accomplish abiding all band segments that are hidden are removed, and added tricks (like acid polygons up to amount out its basic triangles) are bare to ascertain whether a band articulation is hidden or not. Sticking to hidden band abatement is easier than investigating hidden polygon articulation removal, as acid out a polygon allotment from a polygon is a lot harder than acid out a band articulation from a line. I will not altercate this address added as it is out of ambit for this tutorial.

Faces don't cut anniversary other

A endure affair I charge to point out is faces that bisect anniversary other. They can actualize adulterated renderings as can be apparent in the angel on the right. The dejected and red face bisect anniversary added forth the X axis, but they do not appearance up intersected if rendered in the camera view.

Indeed, if we affectation the faces in our camera view, we ask the computer to cede a red and a dejected face. The computer has no abstraction they should intersect, and that they should appearance up in parts. Solving this botheration is aswell a adventure on its own. I'll accord some pointers on how you could apparatus a solution. I accept not implemented this in my apprehension engine. (Note that the apple appearance in the angel on the appropriate shows up accurately as I've been cheating by assuming two red faces in the apple appearance instead of alone one)

In adjustment to ascertain the intersections of faces, it's a acceptable abstraction to triangulate your polygons first. Triangulation is consistently accessible to ascertain intersections of faces. It can aswell be actual accessible if audition hidden curve and hidden polygon segments as acicular out in a hidden articulation abatement algorithm as above.

In the circle algorithm, you will accept to ascertain faces, or triangles that bisect anniversary other, which is absolutely achievable with a bit of math. According to the intesections you ability accept found, you can cut up the triangles into abate triangles afterward the intersections of the faces. Keep on accomplishing this until no added intersections were found, and the botheration is solved. Note that you can assassinate this algorithm afore apprehension it to the screen, as the intersections are absolute of the circling of your altar (intersections circle along) and you alone charge to acquisition the intersections already if announcement the altar from altered camera views. This is in adverse with the hidden band abatement algorithm, which requires you to recompute the hidden band segments if the altar are beheld from a altered angle, as the polygons will awning added hidden segments.


Tuesday, February 17, 2009

(0) Comments

Sketchup Basic Follow Me Tutorial

welcome to infomix.blogspot.com

Welcome to the Sketchup Basic Follow-Me Tutorial. Follow-Me is a able apparatus in Sketchup that allows you to annoyance geometry forth a line, or, if you're afterward a circle, to actualize lathe objects. In this tutorial we're alone traveling to be boring geometry forth a line, amuse see the Follow-Me Lathe Tutorial for data on creating lathe objects. When you're assuming a Follow-Me command, you'll accept basically two things to anguish about: the article you will be extruding, and the aisle that it will follow.

here are assorted means to ascertain a aisle that you wish to follow, but for this tutorial we will be application the basal adjustment of outlining. Create the banishment geometry perpendicular, or as abutting as erect as possible, to the path. Also, try to abode the geometry assimilate the aisle itself, or Sketchup will try to position it for you. Activate the Follow-Me tool, and again bang on the banishment face. Move the abrasion over the aisle that you wish to follow, and Sketchup will highlight those edges in red. Chase the path, and if you've accomplished the adapted result, bang to finalize.

This is a video tutorial in the Sketchup Tutorials series. If you do not see a video above, you may accept a javascript, flash, or ad acquaintance active, and will charge to conciliate it to appearance the video.