This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import numpy as np | |
from numpy.random import randn | |
from scipy.linalg.blas import drot, drotg | |
# references for updates: | |
# - Golub and van Loan (4th ed.) Section 6.5.4 | |
# - http://mathoverflow.net/questions/30162/is-there-a-way-to-simplify-block-cholesky-decomposition-if-you-already-have-deco | |
# | |
# references for downdates: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ip 202.120.38.35 | |
mask 255.255.255.0 | |
gateway 202.120.38.254 | |
DNS 202.120.1.101 | |
202.120.1.100 | |
MAC 000874:149325 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RenderTexture RunShader() | |
{ | |
int kernelHandle = shader.FindKernel("CSMain"); | |
RenderTexture tex = new RenderTexture(256, 256, 24); | |
tex.enableRandomWrite = true; | |
tex.Create(); | |
shader.SetTexture(kernelHandle, "Result", tex); | |
shader.Dispatch(kernelHandle, 32, 32, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
DX11 Bokeh splatting | |
basic algorithm: | |
* find bright spots | |
* verify high frequency (otherwise dont care) | |
* if possitive, replace with black pixel and add to append buffer | |
* blend bokeh texture sprites via append buffer on top of blurred buffer | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float interpolate(float val, float y0, float x0, float y1, float x1) { | |
return (val - x0)*(y1 - y0) / (x1 - x0) + y0; | |
} | |
float blue(float grayscale) { | |
if (grayscale < -0.33) return 1.0; | |
else if (grayscale < 0.33) return interpolate(grayscale, 1.0, -0.33, 0.0, 0.33); | |
else return 0.0; | |
} | |
float green(float grayscale) { | |
if (grayscale < -1.0) return 0.0; // unexpected grayscale value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class FPSDisplay : MonoBehaviour | |
{ | |
float deltaTime = 0.0f; | |
void Update() | |
{ | |
deltaTime += (Time.deltaTime - deltaTime) * 0.1f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//output.height = lerp(lerp(a, b, localUV.x), lerp(c, d, localUV.x), localUV.y); | |
//output.height = _HeightMap.SampleLevel(MyPointRepeatSampler, uvSphere, 0).x; | |
//output.height = tex2Dlod(_HeightMap2, float4(uvSphere, 0, 0)).x; | |
float a = _HeightMap.Load(int3(coord.x, coord.y, 0)).x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "SpaceFramework/PlanetShaderInstance" | |
{ | |
Properties | |
{ | |
_MainTex("Color Texture", 2D) = "white" {} | |
} | |
CGINCLUDE | |
#include "SFCommon.cginc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//float3 T = normalize(i.uBase - dot(i.uBase, N)*N); | |
//float3 B = cross(N, T); | |
//float3x3 TBN = float3x3(T, B, N); | |
//float3 normal = mul(rawN, TBN); | |
//return fixed4((normalize(finalNormal * float3(1,1,1))), 1); |