Monday, May 20, 2013

Attaching Multiple Bump Maps to an Object

I thought that one could not attach more than one bump map to a texture; however, I discovered a simple tutorial that demonstrates how simple this is.  I can't believe it...

Anyway, open the two images under the Hypershader under the texture preset File, or just use a couple of presets.  Connect each one (using the middle mouse button) to a Bump Map 2D preset and give it a default relationship.  Then, create a texture, and create a bump map relationship between the first file and the texture.  All of the steps so far should be as if one were normally creating a bump mapped texture.

The next step takes a little more explaining.  Connect the second bump map to the first and go under 'Other' to create an outNormal->normalCamera relationship.  If neither of these two shows up, go under the Left and Right Displays and check 'Show Hidden Objects.'  Once of this is done, render out the object, and it should have a bump that has the appearance of both images.

This is what it would look like with a Bulge and Mountain preset as the bump maps.

Tuesday, May 14, 2013

Baking Textures and Light Maps

A lot of this I learned from watching the other group construct their game, but here's what I've gathered on baking textures and lights.

In order to bake textures, make the Hypershade pullout is open.  Then, select the object and one texture that affects the object (I haven't gotten it to work with more than one; something to do, then.).  With the two still selected, go to the Hypershade pullout, look under the tab "Edit," and select "Convert to File Texture" (click on the box to the right to adjust settings).  After placing the .psd file (Photoshop) in the given folder, this will create a new texture (the old one remains) with a object mapping of the original, albeit some graphic loss.  This new texture is assigned to your baked object.

Baking lights appears to work the same way, except that the light needs to be selected along with the texture and object, and the settings need to change to add the light effects.

Even in the Viewport renderer, the light pattern shown here only appears when this image is rendered or the light affecting the objects is baked into place.

Monday, March 25, 2013

Group tutorial: Normal mapping to bump mapping in Unity

So it turns out that bump maps made in Maya cannot be directly translated to Unity.  In order to achieve the effect, one must save the bump map as an image file (usually done with Photoshop).  Once in Unity, the image must be selected and made into a normal map (Inspector->Import Settings-> Generate Normal Map).  The pattern that affects how the normal map is used is under Material Inspector-> Shader.  Since we now have the bump map saved for our cactus, this will be done immediately.

Tuesday, March 19, 2013

Group tutorial: UV mapping

Technically, this isn't a tutorial, but just something I've learned while trying to texture the cacti for our game, Boulderdash.  It works out better if one adjusts the points into a rectangular figure and adjust as per the geometry.  Unfortunately, Unity cannot make UV maps in program, so working in Maya and then rendering (it doesn't show how the texture will work on the UV mapping editor) [Turns out setting the renderer to Viewport 2.0 fixes this.  Never mind.] is the only way I can do this.

Thursday, February 21, 2013

Personal tutorial: Maya fluids

This isn't exactly particles, but involves principles that could help with controlling particle meshes.

Based on experimentation, I have to agree with the author's conclusions: the fluid effects are best simply as liquids, and not in the air.  The picture kind of explains why; the ripples ruin the surface as the fluid moves through air.

Similar to particles, it is incredible how many settings can adjust the fluid's nature, including movement, density, buoyancy, etcetera.  Wonder how many things it's been used for?

Wednesday, February 20, 2013

Group tutorial: Particles in Unity


I would recommend this tutorial (which I will try to use), but it's in German.  If you have good eyesight or can understand German, great.  If not, then activate subtitles to translate and hope whatever is displayed is half legible.

At any rate, the particle effect allows for a change in the size of particles, the energy per particle, the direction of the particle movement, and when the particles flow.  The settings are similar to the ones in Maya, but the coding appears to be more user friendly.  Not that this is a good thing; I'm used to more basic coding, per se.  Do not ask me to code in basic, I've seen it, it's a nightmare.

Tutorial: Low poly character modeling

While this tutorial was useful for modeling experience, it's taught me that trying to model when under stress or exhaustion, the job will look terrible, as shown below.

The intended view.  Note that she's wearing a shirt underneath the first one.

Side 

Front

Back

Cutting faces, deleting edges and vertices, merging vertices, combining, and extruding all in this, I've had enough for now.  I need sleep, good grief.

Tuesday, February 19, 2013

Personal tutorial: Realistic dripping water

This is derived from this incredibly useful page on particles.


I haven't been able to attach deformers to the individual particles, but at the very least, I can get them to stick to the plane emitting them.  Interestingly, this was actually achieved not through particle creation settings, but through rigid body stats.  The higher the stickiness and friction, the longer the particles stuck.

The particles start at a certain size, and increase in size as time passes (Radius Scale Input: Age, under Radius Scale, under Particle Size).  The time in which the particles stay attached can be changed with the Input Max setting under Radius Scale.

The result is something hopefully pretty that at least imitates water.  I would use a squash deformer to make it look more like water when it drops, but this only affects the mesh, which for some reason glitches toward the end of the animation.  I've checked on that, and it may be that the Max Triangle Resolution (number of triangles that can be on a scene at a time) is too low.  I tried adjusting that on a graphically powerful computer and not, and it worked on neither computer.  Well, at least you can see the pre mesh result.


Friday, February 15, 2013

Group tutorial: Coding with Javascript

Here's the site for reference to what I'm talking about.  link

I'm familiar with coding in Java, importing classes and checking syntax, but Javascript appears to be riddled with more advanced knowledge and methods that would appear to be illegal.  For example, in Java, this is an average section of code:

public class Banana()  //Must declare the class first.  Also, the filename and class name must match.
{
     String ohai="ohai";
//Syntax is key; remember the semicolon at the end.
     System.out.println(ohai);
//Here it outputs a String, named ohai, and set to "ohai".  (I would follow grammar rules on that period, but that would mean something entirely different in programming terms.)
}  //Remember these things.  They must go outside a method.  By the way, the double slash marks mean that the text following them is not active code, unless it is a method calling a file location.

In Javascript, we get this lovely mayhem:

function Update()
{
     transform.Translate(0,0,Time.deltaTime);
     transform.Translate(0,Time.deltaTime,0,Space.world);
// Having the two methods as shown is legal in Java; I just didn't show that in the first example.   However, methods like "Time.deltaTime" would be illegal, as they lack parentheses at the end.  Also, there is no simple (commonly denoted by all lowercase) class in Java named "function."  While one can create a more complex class with all lowercase letters, but this is not recommended to avoid confusion.
}

Also, sometimes you get code that reads "something :: random."  This is not taught in high school programming courses (I am not declaring a class), and thus my personal experience is minimal.

So if I'm helping with programming our game, I'll need to acclimate myself to the insanity of simplicity, and lack of easy modification options.  Joyous. :(

Wednesday, February 13, 2013

Personal tutorial: Dissolving an Object into Particles

I've always thought this was cool, so I'm learning how.  Tutorial: link

There are still some adjustments than need to be made to the particle rate so that they particles only flow exactly at the edges, but apart from that, it seems to have worked out well.  The texture emission attributes, with an ability to have the particles to inherit the color, and to have particle flow position and rate affected by the texture given, allow for realistic dissolution.

Here's a sample of what this looks like.

Monday, January 28, 2013

Personal tutorial: Gathering Particles in a Container

So this tutorial (less of a tutorial, more of an answer) I did was to cause sand to flow out of an hourglass and stack.  While it seems rather simple, some things must be taken into account.

A. The type of particles used.  Particles, not nParticles, do not have the force of gravity applied to them.  So one must select them and apply a gravity field.  Also, with regular particles, one simply needs to select them and the object to collide with, and select 'Make Collide' under Particles.  With nParticles, however, the object must become a passive collider, which is an option under nMesh.  Then the nParticles automatically collide with the collider.    (Warning:  As far as I can tell, an object cannot be a passive collider and a passive body, so if what you're doing requires such properties, then you'll have to find a workaround.)

B. Filling a container, even by scaling the particles up, will be quite tedious and require upwards of 15,000 frames (I hope is an overestimate), which, at 24 frames per second, will last about 10 1/2 minutes, possibly longer, depending on how many particles are emitted, their lifespan, and how much Maya loves you.  (Given my estimate, you can tell Maya hates me, as I did 2,000 frames at 200 particles per second, and almost NOTHING happened from frame 100 on.  Or maybe that's what it takes.  *sigh*)

At any rate, the particles add up fast, so you'll need some computer power for this.  So here's the playblast, and I did some rotations to prove that it works fails.  If the video can load, that is...




Edit: For some reason, the regular particles fly right out of the container when it's rotated.  Don't know why.  Something to find out.  I suspect it's that the hourglass is not entirely seamless.  I'll keep the fail playblast up to show at least the general principle, and what can go wrong.  If you want more information, read this.

So this should work with nParticles, right?  Yes!  Now to investigate the reason...
Right is particles, left is nParticles.