mattboch’s sprite display tutorial

mattboch’s sprite display tutorial

I need to apply the settings to everything still, but that’s a preview

[7:18]
and FRAPs will look worse than IRL so yeah, you can come check it out if you want! (edited)

mattboch
[7:32 PM]
ok so here’s what I did:

[7:33]
1. Project Settings -> Player -> Other Settings -> Color Space -> Set to: “Linear”

[7:34]
2. For all your sprites:
https://cl.ly/1O0m0n1z293C

[7:35]
(mip maps: on, mip map filtering: kaiser, filter mode: bilinear, compression: none) (edited)

[7:36]
3. Project Settings -> Quality -> AntiAliasing-> 8x Multisampling

mattboch
[7:41 PM]
4. Additionally, you can try the other types of anti aliasing (these weren’t actually on when we were just looking at it) but you may not have to. I would recommend using the post proc stack over the bit bucket cinematic effects repo but here’s both:
post proc stack: https://www.assetstore.unity3d.com/en/#!/content/83912
cinematic effects: https://bitbucket.org/Unity-Technologies/cinematic-image-effects
Bitbucket
Unity-Technologies / cinematic-image-effects
Unity Cinematic Image Effects
(edited)

[7:44]
As an aside, this kind of attention to detail eventually leads you down roads like this: http://blog.us.playstation.com/2014/05/14/n-on-ps4-graphics/
PlayStation.Blog
N++ on PS4: Graphics ++
Hello again! We’re back with another blog post; this time we thought we’d talk about one of the new things we’re most happy with in N++: the graphics. One of the main inspirations for the look of N++ was print-based graphic design: bold, smooth blocks of color with crisp, sharp edges. (109kB)

[7:45]

”’The shapes we want to draw are defined geometrically, and a pixel’s color is determined by how much of each piece of geometry overlaps it.
This is a huge number of calculations, since it has to be done once for every pixel for every layer (most things in N++ are made of 4-8 layers); this also means generating a lot of geometry — each frame of N++ is made of up to 1,703,936 triangles!
The result is immaculately smooth anti-aliasing, which runs at a flawless 60fps/1080p.
As far as we can tell, it’s equivalent to 256x MSAA!! (or more — Shawn insists that it’s equivalent to 4,294,967,296x MSAA, and I guess he should know since he programmed it, but Shawn is often prone to hyperbole, and so although we actually do agree that theoretically it may be 2^32x MSAA, for the sake of avoiding any possible false advertising, we’ll go with the lower bound. Either way, the point is: it looks amazing.)

Advertisements

[Unity Reminder] Tips

OnMouseDown ()
When Parent Object has rigidbody on it, the OnMouseDown () function cannot be detected on the Child Object.

Quaternion.operator *
1) public static Quaternion operator *(Quaternion lhs, Quaternion rhs);
– Combines rotations lhs and rhs.
2) public static Vector3 operator *(Quaternion g_rotation, Vector3 g_point);
– Rotates the point g_point with g_rotation.

Skybox
Texture “Wrap Mode” should be “Clamp”

[Unity C#] Raycast & LayerMask

float myVisionDistance = 50;
Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
RaycastHit hit;
int t_layerMask = (int) Mathf.Pow (2, 8); //for the layer you want to do the raycast
if (Physics.Raycast (ray, out hit, myVisionDistance, t_layerMask))
if (hit.collider.tag == "Food") {
    myTargetPosition = hit.transform.position;
}

Calculate layerMask:
If you want to do the raycast on layer 1,4&8,

    layerMask = (int) (
        Mathf.Pow (2, 1) + 
        Mathf.Pow (2, 4) + 
        Mathf.Pow (2, 8)
    )

[Unity Reminder] Collider

void OnCollisionEnter (Collision collision)
void OnCollisionStay (Collision collision)
void OnCollisionExit (Collision collision)

void OnTriggerEnter(Collider other)
void OnTriggerStay(Collider other)
void OnTriggerExit(Collider other)

void OnCollisionEnter2D (Collision2D coll)
void OnCollisionStay2D (Collision2D coll)
void OnCollisionExit2D (Collision2D coll)

void OnTriggerEnter2D (Collider2D other)
void OnTriggerStay2D (Collider2D other)
void OnTriggerExit2D (Collider2D other)

[Unity C#] Create Grids in Unity Editor

[Unity C#] Create Grids in Unity Editor
//Created by Tim & Hang
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[ExecuteInEditMode]
public class CS_GridSetup : MonoBehaviour {

    [SerializeField] bool createGrids = false;

    [SerializeField] GameObject myGridPrefab;

    [SerializeField] int myColumns = 16;
    [SerializeField] int myRows = 9;

    [SerializeField] Vector2 myBottomLeft = new Vector2 (-8, -4);
    [SerializeField] Vector2 myTopRight = new Vector2 (8, 4);
    [SerializeField] float myPositionZ = 10;

    private List<GameObject> myGrids = new List<GameObject> ();


    // Update is called when something changes in the scene
    void Update () {
        if (createGrids == true) {
            createGrids = false;

            //Clear the existing grids

            foreach (GameObject t_grid in myGrids) {
                GameObject.DestroyImmediate (t_grid);
            }
            myGrids.Clear ();

            //create grids

            for (int i = 0; i < myRows; i++) {
                for (int j = 0; j < myColumns; j++) {
                    Vector3 t_position = new Vector3 (
                                             (myTopRight.x - myBottomLeft.x) / (myColumns - 1) * j + myBottomLeft.x, 
                                             (myTopRight.y - myBottomLeft.y) / (myRows - 1) * i + myBottomLeft.y,
                                             myPositionZ); //Calculate the position
                    GameObject t_grid = Instantiate (myGridPrefab, t_position, Quaternion.identity); //Create the grid
                    myGrids.Add (t_grid); //Add it to the list
                    t_grid.transform.SetParent (this.transform); //Set the parent to this gameObject
                    t_grid.name = myGridPrefab.name + "(" + i + ")(" + j + ")"; //Name it
                }
            }
        }
    }
}