Skip to content

Instantly share code, notes, and snippets.

View phi-lira's full-sized avatar

Felipe Lira phi-lira

View GitHub Profile
@phi-lira
phi-lira / manifest_example_mac_fullpath
Last active April 6, 2020 12:12
Example of manifest pointing lightweight and core SRP packages to a local folder.
{
"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 / UniversalPipelineTemplateShader.shader
Last active April 4, 2024 13:42
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
// 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.json
Last active October 28, 2021 05:10
Lightweight Pipeline package manager manifest
{
"registry": "https://staging-packages.unity.com",
"dependencies": {
"com.unity.render-pipelines.lightweight" : "2.0.0-preview"
}
}
// 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;
}
# =============== #
# Unity generated #
# =============== #
[Tt]emp/
[Oo]bj/
[Bb]uild
[Ll]ibrary/
sysinfo.txt
ShaderForge.dll
Assets/ShaderForge/
@phi-lira
phi-lira / AndroidManifest.xml
Last active January 20, 2016 13:25
Mali Graphics Debugger Activity. It extends UnityNativePlayerActivity and loads MGD library in order to connect MGD to Unity
<?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>
@phi-lira
phi-lira / CustomMaterialEditor.cs
Created January 20, 2016 11:14
CustomMaterialEditor - Unity
//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 / OverdrawDebugReplacement.cs
Last active December 21, 2021 15:31
Overdraw Debugger Unity
using UnityEngine;
using System.Collections;
public class OverdrawDebugReplacement : MonoBehaviour
{
public Shader _OverdrawShader;
private Camera _Camera;
private bool _SceneFogSettings = false;