Skip to content

Instantly share code, notes, and snippets.

View asd158's full-sized avatar
💭
I may be slow to respond.

asd158

💭
I may be slow to respond.
View GitHub Profile
@asd158
asd158 / build-android-opencv.sh
Created April 11, 2018 06:46 — forked from tzutalin/build-android-opencv.sh
Build OpenCV for android
#!/usr/bin/env sh
NDK_ROOT="${1:-${NDK_ROOT}}"
if [ ! -d "${WD}/android-cmake" ]; then
echo 'Cloning android-cmake'
git clone https://github.com/taka-no-me/android-cmake.git
fi
### ABI setup
#ANDROID_ABI=${ANDROID_ABI:-"armeabi-v7a with NEON"}
@asd158
asd158 / custom_brdf.md
Created July 5, 2017 04:00 — forked from aras-p/custom_brdf.md
Custom BRDFs in deferred shading/lighting in Unity

So, https://twitter.com/sunjammer/status/569925239989256192 and https://twitter.com/sunjammer/status/569983534368206848

Now, depends on whether you want custom BRDF in deferred on 1) all your objects (easy) or 2) only some of your objects (harder).

1. change BRDF for everything

That's fairly easy. The actual object shaders more or less just fill the g-buffer (and in Unity 4.x deferred lighting, combine textures with the lighting buffer in the final pass). The actual BRDF is in the "light shader". Start by copying the built-in light shader (4.x deferred lighting: Internal-PrePassLighting.shader; 5.0 deferred shading: Internal-DeferredShading.shader) into your project. In 4.x, put it into Resources folder so it's included into the build; in 5.0 point Unity to use that shader under Project Settings -> Graphics.

Change the shader to do different BRDF.