This file contains 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
// original : https://stackoverflow.com/a/38974483 | |
public class SeekableAesStream : Stream | |
{ | |
private Stream baseStream; | |
private AesManaged aes; | |
private ICryptoTransform encryptor; | |
public bool autoDisposeBaseStream { get; set; } = true; | |
/// <param name="salt">//** WARNING **: MUST be unique for each stream otherwise there is NO security</param> |
This file contains 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 UnityEngine.Rendering; | |
using UnityEngine.Rendering.Universal; | |
public class CaptureRendererFeature : ScriptableRendererFeature | |
{ | |
public event System.Action<CaptureRendererFeature> OnCaptured; | |
[SerializeField] private RenderPassEvent _renderPassEvent = RenderPassEvent.AfterRenderingOpaques; |
This file contains 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
[StructLayout(LayoutKind.Sequential)] | |
public struct Pixel32 | |
{ | |
public byte r; | |
public byte g; | |
public byte b; | |
public byte a; | |
} | |
// ----------------------- |
This file contains 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 "NrealRoom/ViewMask" | |
{ | |
Properties | |
{ | |
_MainTex("Texture", 2D) = "white" {} | |
_Width("Width", Float) = 10.0 | |
} | |
SubShader | |
{ | |
Cull Off ZWrite Off ZTest Always |
This file contains 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
maxLuma = max(nw,ne,sw,se) | |
contrast = max(nw,ne,sw,se,m) - min(nw,ne,sw,se,m) | |
if(contrast >= max(minThreshold, maxLuma * threshold)) |
This file contains 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
$ apt-get build-dep gdb | |
$ apt-get source gdb | |
$ cd gdb-7.7.1 # 適宜、DLされたバージョンに置き換えてください | |
$ ./configure --enable-tui=yes | |
$ make | |
# grab a coffee | |
$ sudo make install |
This file contains 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
if (hmid < 0.0) | |
{ | |
tx = tmid; | |
hx = hmid; | |
} |
This file contains 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
/** | |
* Fractal Brownian Motion | |
* | |
* Reference: https://thebookofshaders.com/13/ | |
* | |
* See also: http://www.iquilezles.org/www/articles/morenoise/morenoise.htm | |
* : http://www.iquilezles.org/www/articles/warp/warp.htm | |
*/ | |
const vec3 mixColor1 = vec3(0.8, 0.35, 0.12); |
This file contains 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
\begin{eqnarray} | |
y {=} | |
\begin{cases} | |
0 & : (b + w_1 x_1 + w_2 x_2) \leq 0 \\\ | |
1 & : (b + w_1 x_1 + w_2 x_2) > 0 | |
\end{cases} | |
\end{eqnarray} |
This file contains 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
// なんちゃってAOを計算する | |
// | |
// +-----------------+--------------------+ | |
// | ro = Ray Origin | rd = Ray Direction | | |
// +-----------------+--------------------+ | |
vec4 genAmbientOcclusion(vec3 ro, vec3 rd) | |
{ | |
vec4 totao = vec4(0.0); | |
float sca = 1.0; |
NewerOlder