This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
[RequireComponent(typeof(Camera))] | |
public class CameraManouver : MonoBehaviour | |
{ | |
Transform _transform; // cache transform component of the camera | |
[Header("Keyboard Translation")] | |
public float horizontalFactor = 10f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Rendering; | |
using UnityEngine.Experimental.Rendering; | |
using Conditional = System.Diagnostics.ConditionalAttribute; | |
[CreateAssetMenu(menuName = "Rendering/LuminatePipeline")] | |
public class LuminateRP : RenderPipelineAsset | |
{ | |
protected override IRenderPipeline InternalCreatePipeline() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
/// <summary> | |
/// Cg shading language functions written in C# | |
/// </summary> | |
public static class CgFunctions : MonoBehaviour | |
{ | |
// Start is called before the first frame update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Planet // enum class | |
{ | |
public static readonly Planet MERCURY = new Planet(1, "Mercury"); | |
public static readonly Planet VENUS = new Planet(2, "Venus"); | |
public static readonly Planet EARTH = new Planet(3, "Earth"); | |
public static readonly Planet MARS = new Planet(4, "Mars"); | |
public static readonly Planet JUPITER = new Planet(5, "Jupiter"); | |
public static readonly Planet SATURN = new Planet(6, "Saturn"); | |
public static readonly Planet URANNUS = new Planet(7, "Uranus"); | |
public static readonly Planet NEPTUNE = new Planet(8, "Naptune"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef CUSTOM_LIGHTING_INCLUDED | |
#define CUSTOM_LIGHTING_INCLUDED | |
/* IN(5): SpecColor(4), Smoothness(1), WPos(3), WNormal(3), WView(3) */ | |
/* OUT(2): Diffuse(3), Specular(3) NdotL(1) for toon ramp: point fltr +clamp mode */ | |
void CalculateLights_half(half4 SpecColor, half Smoothness, half3 WPos, half3 WNormal, half3 WView, | |
out half3 Diffuse, out half3 Specular, out half NdotL) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* As a first example of using OpenGL in C, | |
* https://math.hws.edu/graphicsbook/source/glut/first-triangle.c | |
*/ | |
#include <GLUT/glut.h> // freeglut.h might be a better alternative, if available..... | |
#include <stdio.h> | |
#include <stdlib.h> | |
void display(void) { // Display function will draw the image. |