Tuesday, December 2, 2014

Sunday, November 30, 2014

GA326 Blog: Miner Inconvenience

Miner Inconvenience was a two player co-op game I made with Zach and Mike.
I was responsible for programming the game and making the UI.
This video shows the cutscenes and basic mechanics for our game:

(I didn't have a 2nd player to help me record at the time)

Saturday, November 29, 2014

GA320 Blog: Couch UVs

I wanted to see if I could tile just one portion of a texture (bottom fringe) and also have mirrored UVs all on one asset. Turns out it's possible. There's one graphical error where the fringe tiles, I think it's because of the value that the fmod returns. Hopefully it's not too big of an issue with the final textures.
Here's the final asset and textures:


Wednesday, November 26, 2014

GA320 Blog: Peeling wallpaper

Decals weren't cutting it so I made some peeling wallpaper with polygons. The hanging strip can be offset to get more variation from a single texture.

Wednesday, November 19, 2014

Tuesday, November 18, 2014

GA320 Blog: Spline Mesh

This will give our group more flexibility than a standard modular couch. Saves on poly count too.

GA320 Blog: Group material

Made this so we wouldn't have to spend time in class pointing out who did what.
There's probably several faster ways to do it, like having everyone put something in their own materials or renaming all of their files to work with some code*, but this was all I could make without editing other people's stuff.

*Tried this. Unreal keeps a reference to the old name, and for some reason uses that when playing, so the code only works with meshes placed after the name was changed. As far as I can tell there's no way to delete the history of names.

Monday, November 10, 2014

GA335 Blog: Roughs

Some more rough than others.

Saturday, November 8, 2014

Monday, November 3, 2014

Lantern Shader Update

Some seniors were trying to do the same Lantern Shader that I did Sophomore year, and it didn't work the same in UE4 as it did in UDK. Transforming the camera vector from World to Tangent fixes this.

Sunday, November 2, 2014

Flipping Normal map for symmetrical objects

I saw a normal map here, that was only for half of a symmetrical object, which lead me to make this.
The UVs (I just made a plane for this) are mirrored across the U axis, as seen in the bottom of the image.
Or just multiply the normal map by -1,1,1. Not sure why I felt the need to use Appends.

Note: The red channel is being flipped because the mesh is vertically symmetrical.

Monday, October 27, 2014

Sunday, October 26, 2014

UE4: SubUV rotator

Mike had 9 gears on a texture and needed them all to rotate at the same rate. This is what I came up with to solve that problem.

The "Tiling" parameter can be a 2 vector, with different numbers in each channel. It will rotate correctly as long as the numbers line up with the subdivisions in the texture.

Saturday, October 18, 2014

GA326 Blog: Toy final product

This footage is from the version I turned in for class. The mana regen rate is increased so that the person playing wouldn't lose as easily, but I actually balanced the game so that it would be a close finish.

I didn't have time to refine the exploration I was doing with the audio visualization plugin so this game just spews a steady stream of 'fire' at the tank and random damage in all of the other lanes. If he dies, the stream moves down the rows until everyone is dead.

Friday, October 3, 2014

Halftone revisit

I actually made this just to see if I could use fmod to make a tiling TexCoord, but using this is also a much more elegant solution than what I used in the previous post. It's probably a lot cheaper too.
(actually you can just use Frac instead, sort of forgot about that expression)
This has other uses too, for instance, if you packed textures into channels and need one clamped and one tiled, you can use this to tile a clamped texture.

Wednesday, October 1, 2014

UE4: Textureless halftone

I scaled the dots up for this demonstration, but my plan is to bake AO into the verts of my models, and use this to give my constructs more stylized shading.


Saturday, September 27, 2014

Conical Gradient in UE4

I wanted a conical gradient to use for a clock wipe animation on spell cooldowns, but no matter what I tried, the compression from using textures produced unsatisfactory results. I eventually found what was needed in the VectorToRadialValue node, which I combined with what I previously learned about rotation in UDK and used it to make the gradient.
Turns out, all that rotation stuff wasn't necessary, here's the cheaper way:
Recently Epic updated their VectorToRadialValue node with a new method. This has nothing to do with me but I figured I'd update this post for the sake of completion.

Thursday, September 25, 2014

UE4 - Textureless materials

I decided to make bricks and window blinds using the GenerateOffsetBands node in UE4. The problem with this is that at certain viewing distances you will get a Moire pattern. To fix this I used a CameraDepthFade node to blend between the full pattern, and a solid color. This automatically mimics anisotropic texture filtering too. (the default texture in UE4 uses this to fade smaller squares in when you're up close)

Monday, September 22, 2014

ProcBuilding in UE4

I'm attempting to make a procedural blueprint for my modular kit.
Feature list so far:
1. Make up-to 4 walls with arbitrary dimensions
2. Optional roof
3. Adjustable material colors
4. Percentage based random seed for AC units in windows (needs serious work)
5. Fire escape with adjustable position, automatically adjusts to building height (could use improvement)

Here's the final code and two shots I made with this tool.



Here's a detail shot of the materials. No textures were used, not even for the AC unit (which is just a cube).
It's hard to tell but there's also a stylized reflection on the windows.

Friday, September 19, 2014

GA335 Blog: Design Lab

I'm not going to include all 100 silhouettes and 50 doodles, but here's the ones that ended up with drawings.



Wednesday, September 3, 2014

Building Desaturation from scratch.

Mike wanted to make a blend mode like the "Color" mode in Photoshop and asked me for help. But, considering the fact that the people at Epic haven't already made one, it might be a long shot. I learned about Relative Luminance while researching this, so now I know how the desaturate node works.

This was the only resource I could find on the subject and, at a glance, seems doable in Unreal. Hopefully I'll have enough free time to try it out.

Tuesday, August 26, 2014

GA326 Blog: Adding features to the sidescroller

I wanted a motion detector ripped off of inspired by Abe's Odyssey so I put this blueprint together. I also recycled the animation code to make elevator platforms. The variables let you place it anywhere in the level and edit the animation. I think it's a lot faster than trying to use Matinee, especially for such simple animations.


Sunday, April 27, 2014

Thursday, April 17, 2014

GA222 Blog: Character textures, first pass

Had our first crit on the character textures recently. I'm really happy with how well he fits with the car.

Wednesday, April 16, 2014

GA228 Blog: Race Track

Here's a couple of runs through my track to show all of its features. It lacks a lot of visual polish but hopefully people think it's fun to play. My car's reflection doesn't match the level because it currently has the Best of Ringling shader on it.

Thursday, April 3, 2014

GA240 Blog: Speedometer HUD

Now that it's an assignment, I've made a HUD for my speedometer.
Examples in this video are a full circle, a corner with the rotation constrained to one quadrant, a particle and a static mesh (one faces camera, one turns with the car), and finally I got decals/spotlight projection working!

Here's the material and kismet for the corner element. The Sine and Cosine have their frequencies set to the max speed of the car x4. This is to constrain the rotation of the needle to one quadrant without any extra math in kismet.

The projected versions both have problems, as can be seen in this screenshot. Decals have clipping issues depending on how angled the surface is. Spotlights project perfectly but don't show up well, especially in lit areas. Clipping due to a material change, this was fixed when I went back to a quadruple blended vertex paint. Decals work fine.




Wiesmann GT MF5 speedometer research
I think I'll use that digital display for the boost indicator.

Wednesday, April 2, 2014

Wavy Grass in UDK

Mike had the idea of doing grass inspired by Viva Piñata. It's a little hard to tell from screenshots of the game but if you zoom in, the grass is actually made of shells like the fur in SOTC. http://youtu.be/taIuZAGOFTo (see video description for a more in-depth look at fur)
Since the Vertex Color was already filling each shell in a gradient from top to bottom, I had the idea to use the same colors to drive an offset and make it look like it's waving around.


Please note that everything was made with placeholder assets. I haven't gotten to refining the art in my level yet. I think this will look really nice once I swap out my leaves texture for a proper grass alpha.
Because all 3 Vertex Color channels are storing the same values, this doesn't really matter, but I meant to append R and G, not sure how B ended up getting plugged in there.

Tuesday, April 1, 2014

GA240 Blog: Particles

For all of my particles I tried to use the Vertex Color node in ways other than intended. For the smoke, R and G are used to offset the animations (sort of redundant using both) B is being used to drive the color (would have had more control using two channels here instead). For some reason Initial Color and Color Over Life seem to try to overwrite each other, so even though I'm using A normally, I wasn't able to animate Alpha Over Life like I planned. (fixed, smoke fades out nicely at the top now)
For the bright, round specks in the smoke I'm using R and G for color, B to give them varying shapes, and A for brightness. (these were all pretty much pointless because color could have just gone higher than 1 to control brightness and the specs are so small that the varying shapes are undetectable).  It should also be noted that the material for the specks uses zero textures.
For the lava splash, there's no need for transparency so I'm using the Alpha as a way to animate the splash with IF.
I had a few more ideas of alternative uses for the Vertex Color node but didn't have a reason to use them for these particles.
Here's video of my mushroom particles.

I started work on the lava splash but didn't finish.
I worked on the post-processing, made a scene depth mask and created a color shift, just haven't tweaked it to look nice yet. The distortion was just a Dolly Zoom, I don't know why I thought it was post-processing.

Monday, March 31, 2014

Building a Rotator from scratch

Please note that I didn't figure out how to make this at all. I had no idea how to make a rotator. I had to look at the Custom Rotator material function to figure out how to do this.
I just noticed that the TexCoord and pivot point are in the wrong places. (they should be swapped) This obviously wouldn't make a difference if it's rotating around the center but it won't offset back to the right place for any other pivot point.

Sunday, March 30, 2014

Racing game: Missing features

I've had these for a long time now but never bothered to screenshot them. I was going to wait until I had a proper UI for them but I may not have time to put that together anymore.
Maybe I never noticed it before but we now have a HUD assignment in programming class, one requirement is a speedometer.
The speedometer is straightforward. I didn't try to make the output accurate to real world scale but instead based it roughly on the top speed of a Wiesmann GT MF5.

At first I had the Wrong Way code set up with a Next Checkpoint variable that was driven by a list of checkpoints I had put in order. This worked perfectly but required manual labor for anyone wanting to use the code. I attempted to make it procedural by swapping the A>B and A<B and measuring from the last checkpoint you touch, but because of the way Touch and Gate work, the WRONG WAY message always appears briefly when switching to the next checkpoint. I did figure out several ways to fix the problem but it really should just work like this.
This still isn't good enough because it doesn't take into account which way you're supposed to go, only whether or not you're moving away from the last checkpoint you touched. Since all checkpoints already need to be facing the direction the player is supposed to go, I figured I could compare their Yaws and any time opposite values within a certain threshold were returned, it would allow WRONG WAY to be drawn. I briefly tested getting the Rotation and the Rotation Vector but neither seemed to be outputting the local object rotation and since switching back to the Next Checkpoint method would solve the problem anyway, I didn't bother experimenting further.

Friday, March 28, 2014

Electrical Arc progress

Dylan and I worked on the Beam more in class yesterday. Now, not only does the beam target random locations in the air but a thicker beam contacts random locations on the ground. To make this work with prefabs (and also because his level has an organically shaped ground) we had to use a Trace for finding contact points then reset the target location back under the level (Z offset is now a fixed, negative number rather than a random float like before).
The Nodes for the other beam have been removed to make it screenshot nicer.
Oops, pretend that Toggle is hooked up to the emitter.
(I edited out walking away because it didn't toggle off. That explains why.)

Monday, March 24, 2014

Building a Panner from scratch

I recently learned about plugging textures into the UVs of other textures to distort them and that got me thinking about how the panner and rotator nodes work. The panner was simple enough, it's just constantly adding a value that's offset by the ramps in either channel of the TexCoord node. The 2 vector constant acts as the Speed X and Y for the panner. The only trick is that Time outputs a scalar value and needs to be appended to itself to be multiplied with the 2 vector constant.
At first this may seem useless beyond understanding the node (like many of my previous breakdowns) but it actually has applications. I helped Dylan improve his electricity particle by using this panner with a noise texture for the speed instead of a 2 vector constant.
I'm still working on the rotator node and luckily there's a material  function called Custom Rotator that I think will help me figure it out. I just don't have time right now. (Plugging Time into the rotation angle gets a constant rotation, I just need to figure out how the math inside the function works.)

Friday, March 21, 2014

More Progress on Electrical Arc

These are some very rough, quick proof of concepts Dylan and I made after class today. While looking through the vector parameters for the emitter we discovered a Random Vector variable, as seen in this screenshot, and used it to produce the first result.
Unfortunately it's not possible to make the beam particle update in local space, so these random variables will not work in prefabs because they reference points in world space.

With no point of reference it may be hard to tell but the triggered beam is switching location with a random offset. Dylan wanted to animate the beams in Matinee and I suggested using the following Kismet code to change the location procedurally. This code could be combined with the previous one that targets the player to set up a nice effect, but it seems like a heavy solution for the desired effect. Perhaps there is a way to do most of the work in the emitter but we couldn't figure it out today.

Saturday, March 15, 2014

Building Fresnel from scratch

I wanted to see how the Fresnel node works so I attempted to build it in the material editor.
According to a comment in the .uc file for the function it's, "pow(1 - max(Normal dot Camera,0),Exponent)" with a default exponent of 3.
So it turns out that Fresnel is 1- the dot product of a camera vector and a normal (top).
Well that was easy… So in reality my goal was to build a dot product in the material editor.
Luckily there's a way to get the dot product without a bunch of fancy trigonometry: X1*X2 + Y1*Y2 + Z1*Z2

Switch params were just for testing the results.

Thursday, March 6, 2014

Deriving the B channel on a normal map

I found this function in the VectorOps that I'd never noticed before. It's really cool. My plan for normal maps this semester was to just use the R and G channels and append 1 into that. (top row) With this function (middle row) I can still pack my textures but I will also be able to get an accurate B channel. Obviously appending 1 would be cheaper but it'll be interesting to see if there's a noticeable difference in appearance that's worth the cost. Bottom row shows how the function works. (1-(xx+yy))


Tuesday, March 4, 2014

GA222 Blog: Character Turnaround

I wanted my character to be curvy like the car so I made him fat. The car is pretty expensive and since the rich are often portrayed as fat, that seemed to fit nicely. The car is white with black and red accents so I made his color scheme compliment that.
I didn't really plan on making a German character but others seemed invested in the idea of him being German so I came up with this lame, cross-language pun for his name.

Sunday, March 2, 2014

UDK and Photoshop filters

I thought it'd be interesting to try replicating two photoshop filters in UDK (before I found out they were already in the material functions) but the exercise was still fun and taught me the math behind these two filters. I think understanding how they work is useful so I wanted to lay it out here.

Screen:
This one was simple enough and my solution looked exactly like the material function in UDK.
The math for Screen is:
1-(1-a)(1-b)


Overlay:
I never got the result I wanted for this one and now that I've seen the UDK solution I know it's because I was trying to do it without splitting the channels. The reason is that If only takes float values (UDK even tells you this but I didn't connect the dots) so you have to break the images into their separate channels and append them back together after running each one through an If.
The math for Overlay is:
2ab,                     if a < .5
1-2(1-a)(1-b),    otherwise
(Sorry the notation doesn't look pretty. I couldn't get MathJax working the way I wanted)

I'm not sure why they're running the base through a subtract and a clamp (set to 50). I couldn't test it with these textures though because the result is the same as 2ab. I'll try to figure that out some other time.

Thursday, February 27, 2014

Something from last semester.

Learning the material editor last semester was a lot of fun. I applied most of the things I learned to this lantern shader.
















One of the most interesting things I learned about last semester was gradient mapping, which I used here. It allowed me to store the diffuse in one channel of a texture and use a second, very small texture to color it. With only one channel dedicated to the diffuse I could pack everything else I needed in the same texture: flicker clouds, a hot spot, and the internal wires / paper folds.
People used this asset all over their levels, often hanging in a line on ropes. Because of this I had to offset the flicker using Object World Position so that they didn't all dim and glow at the same time.
The most complicated part of this asset was getting the hot center. After experimenting with less elegant solutions I came across a technique used by several people, but one which none of them could explain to me; that is, masking a Camera Vector that has had 0.5 multiplied and added to it. After reading the entire Material Compendium I figured out that this is to bias the output of the camera vector (which goes from -1 to 1) to positive numbers. This can also be done with a Constant Bias Scale (which I left floating in there as a reminder) but it's more expensive. The mask simply allows the X and Y channels of the Camera Vector to be used as texture coordinates.

If I had to change one thing I might make the Divide by 8 into a Multiply by 0.125 because computers can multiply faster than they can divide. The difference may or may not be negligible but I'm sure if you talked to a real programmer they'd tell you to use Multiply, especially since you won't get any rounding errors representing 0.125 as binary, though that's getting awfully anal over the part of my shader nobody even used.

This semester we're going into custom lighting, which is an extremely powerful tool. I especially like having a lot of control over my specular highlight.

Tuesday, February 25, 2014

GA240 Blog: Exploding Barrel video

Wasted all of my time trying to get blend shapes to work. Even though they work in the AnimTree Editor, when you try to keyframe the Morph Targets in Matinee, it doesn't work.

Saturday, February 22, 2014

Simple solution to Electrical Arc

Because I was determined to set the BeamEndPoint of the particle to the player location, I missed the obvious solution of reversing the end points. Since the source is the emitter, I simply set the emitter location to whatever instigates a Touch on the trigger. I tried using an Attach to Actor node but that didn't work on players or vehicles so instead I had to use Set Location.

This solution requires no external programming to make work. Thanks to Marty, I now know about changing the target type to Actor and so this is much easier to use than before where the end point vector coordinates had to be manually set for each copy.

Set Actor Location doesn't seem to like taking vector variables in for rotation so I have typed 90 pitch in that node to get the arc to face up. The activate delay on Turn On is to prevent the beam from being briefly visible when it's triggered from a new location.
Just found out you can plug an object directly into the Location input for Set Actor Location. This eliminates the need for a Get Location. 

Friday, February 21, 2014

Proof of concept: Electrical Arc

I wanted to make an effect that made electricity arc to the player when they passed within a certain radius of the source. This example was thrown together very quickly using the default Link Gun particle system. Delay on finding player position is set to .05 seconds. I could have made it smoother but I didn't want too many executions per second.

To get this to work I had to put a new action into Kismet because Set Particle Param doesn't take vectors. I have to iron out some kinks because it gives me some errors when compiling scripts as well as a kismet warning as you can see in the video.

GA240 Blog: Exploding Barrel

I'd like the head to be a physics object that is propelled upwards and then bounces around with spores gushing out of the bottom. It might be nice to have some sort of regrowing animation, just a simple blend shape should work. Burn phase is shaking and emitting light / spores from the head.


Friday, February 7, 2014

GA222 Blog: High Poly Car

Finished the resubmit work; it's 49,965 triangles. Didn't get it as smooth as I wanted but overall, I'm happy with the result. The lights have bulbs (you can see them on X-ray shading).

Thursday, February 6, 2014

Monday, January 27, 2014