Skip to content

Instantly share code, notes, and snippets.

View Henry-Suen's full-sized avatar

Henry Suen Henry-Suen

  • Chengdu
  • 18:28 (UTC +08:00)
View GitHub Profile
@sergiobd
sergiobd / Skybox6-ArbitraryRotation
Created November 10, 2018 17:57
Unity skybox 6-sided with arbitrary rotation axis
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Edited from Unity built-in, copied rotation function from here: http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/
Shader "Skybox/6 Sided - Arbitrary Rotation" {
Properties {
_Tint ("Tint Color", Color) = (.5, .5, .5, .5)
[Gamma] _Exposure ("Exposure", Range(0, 8)) = 1.0
_Rotation ("Rotation", Range(0, 360)) = 0
_RotationAxis("Rotation axis", Vector) = (0, 1, 0)
[NoScaleOffset] _FrontTex ("Front [+Z] (HDR)", 2D) = "grey" {}
[NoScaleOffset] _BackTex ("Back [-Z] (HDR)", 2D) = "grey" {}