Skip to content

Instantly share code, notes, and snippets.

Avatar

Felipe Lira phi-lira

View GitHub Profile
@phi-lira
phi-lira / OverdrawDebugReplacement.cs
Last active Dec 21, 2021
Overdraw Debugger Unity
View OverdrawDebugReplacement.cs
using UnityEngine;
using System.Collections;
public class OverdrawDebugReplacement : MonoBehaviour
{
public Shader _OverdrawShader;
private Camera _Camera;
private bool _SceneFogSettings = false;
@phi-lira
phi-lira / CustomMaterialEditor.cs
Created Jan 20, 2016
CustomMaterialEditor - Unity
View CustomMaterialEditor.cs
//Copyright(c) 2015 Phil Lira - phil.rlira [at] gmail [dot] com
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all
@phi-lira
phi-lira / AndroidManifest.xml
Last active Jan 20, 2016
Mali Graphics Debugger Activity. It extends UnityNativePlayerActivity and loads MGD library in order to connect MGD to Unity
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.arm.mgdactivity" android:versionName="1.0.0" android:versionCode="1">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:debuggable="false">
<activity android:name="com.arm.mgdactivity.MGDNativeActivity" android:label="@string/app_name" android:screenOrientation="landscape" android:configChanges="screenSize|orientation|keyboardHidden|keyboard">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
View Unity Default .gitignore file
# =============== #
# Unity generated #
# =============== #
[Tt]emp/
[Oo]bj/
[Bb]uild
[Ll]ibrary/
sysinfo.txt
ShaderForge.dll
Assets/ShaderForge/
View sRGBEquation.cpp
// As seen on https://gamedevdaily.io/the-srgb-learning-curve-773b7f68cf7a
float D3DX_FLOAT_to_SRGB(float val)
{
if( val < 0.0031308f )
val *= 12.92f;
else
val = 1.055f * pow(val,1.0f/2.4f) — 0.055f;
return val;
}
@phi-lira
phi-lira / manifest.json
Last active Oct 28, 2021
Lightweight Pipeline package manager manifest
View manifest.json
{
"registry": "https://staging-packages.unity.com",
"dependencies": {
"com.unity.render-pipelines.lightweight" : "2.0.0-preview"
}
}
@phi-lira
phi-lira / UniversalPipelineTemplateShader.shader
Last active Nov 28, 2022
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
View UniversalPipelineTemplateShader.shader
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this teamplate as a base.
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader.
// This shader works with URP 7.1.x and above
Shader "Universal Render Pipeline/Custom/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
@phi-lira
phi-lira / manifest_example_mac_fullpath
Last active Apr 6, 2020
Example of manifest pointing lightweight and core SRP packages to a local folder.
View manifest_example_mac_fullpath
{
"dependencies": {
"com.unity.render-pipelines.core": "file:/users/felipe/Development/Graphics/com.unity.render-pipelines.core",
"com.unity.shadergraph": "file:/users/felipe/Development/Graphics/com.unity.shadergraph",
"com.unity.render-pipelines.universal": "file:/users/felipe/Development/Graphics/com.unity.render-pipelines.universal",
}
}
@phi-lira
phi-lira / PerfTracker.cs
Created Mar 16, 2018
Performance Tracker scripts.
View PerfTracker.cs
// Script made by aleks01010101
// Slightly modified
// Displays avg and median ms + frames sampled during clipLenght
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PerfTracker : MonoBehaviour {
public float clipLength = 20.0f;
@phi-lira
phi-lira / PhysicallyBasedExample.shader
Last active May 19, 2020
Physically Based Example shader that works with Lightweight Render Pipeline (LWRP) 4.X.X-preview
View PhysicallyBasedExample.shader
Use https://gist.github.com/phi-lira/225cd7c5e8545be602dca4eb5ed111ba instead.