Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@benloong
benloong / UIDissolve.shader
Last active June 5, 2025 20:23 — forked from nukeop/dissolve.shader
Dissolve shader for Unity
Shader "UI/Dissolve"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0

#Quixel Megascans Scripting Reference ###Updated: Aug 19th, 2016

The Megascans Bridge allows the user to send assets from the Bridge to external applications. The Bridge currently supports the following tools:

  • 3DS Max
  • Marmoset Toolbag 2
  • Unity 3d
  • Unreal Engine 4
using UnityEditor;
using UnityEngine;
/// <summary>
/// Made by Rodrigo Diaz
/// http://www.rodrigos.work
/// This code is licensed under MIT license
///
/// Make sure to add this class under a folder named "Editor" in the Unity Project
///
@cecilemuller
cecilemuller / index.html
Last active January 4, 2023 16:04
Record three.js to WebM video using CCapture.js
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Record WebGL to WebM (Chrome only)</title>
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css" charset="utf-8">
</head>
<body>
<div class="buttons">
@pixelmager
pixelmager / screenshot.cs
Last active October 19, 2022 15:03
Unity HDR screenshot
if ( DoHDRscreenshot )
{
DoHDRscreenshot = false;
int w = source.width;
int h = source.height;
RenderTexture rt_hdr = RenderTexture.GetTemporary( w, h, 0, RenderTextureFormat.ARGBHalf );
Finalpass( source, rt_hdr, bloom_rt, distortion_rt, distparms ); //note: final posteffects pass
@nuitsjp
nuitsjp / BitmapExtensions.cs
Created October 17, 2016 07:58
Convert System.Drawing.Bitmap to System.Windows.Media.ImageSource
[DllImport("gdi32.dll", EntryPoint = "DeleteObject")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DeleteObject([In] IntPtr hObject);
public static ImageSource ToImageSource(this Bitmap bmp)
{
var handle = bmp.GetHbitmap();
try
{
return Imaging.CreateBitmapSourceFromHBitmap(handle, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
using System;
struct Vector3
{
public float X, Y, Z;
public static bool operator true(Vector3 v)
{
return v.X != 0 && v.Y != 0 && v.Z != 0;
}