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
#pragma once | |
typedef unsigned long long u64; | |
typedef unsigned int u32; | |
typedef unsigned short u16; | |
typedef unsigned char u8; | |
typedef signed char i8; | |
typedef float f32; | |
#define MAX_PATH 260 |
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
/*---------------------------------------------------------------------------------------------------------------------- | |
Custom cross-product: mad + mul | |
----------------------------------------------------------------------------------------------------------------------*/ | |
half3 crs(half3 v0, half3 v1) | |
{ | |
//return cross(v0, v1); | |
half3 v0_0 = v0.yzx; | |
half3 v0_1 = v1.zxy; | |
half3 v1_0 = v0.zxy; | |
half3 v1_1 = v1.yzx; |
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
/*---------------------------------------------------------------------------------------------------------------------- | |
input : srcStream => four 3-component vectors : x0y0z0 x1y1z1 x2y2z2 x3y3z3 | |
output : dstStream => three 4-component vectors : x0x1x2x3 y0y1y2y3 z0z1z2z3 | |
----------------------------------------------------------------------------------------------------------------------*/ | |
void AoS2SoA(float * __restrict dstStream, float const * __restrict srcStream) | |
{ | |
__m128 x1_y1_z1_x2 = _mm_load_ps(srcStream + 0); | |
__m128 y2_z2_x3_y3 = _mm_load_ps(srcStream + 4); | |
__m128 z3_x4_y4_z4 = _mm_load_ps(srcStream + 8); |
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
.data | |
cval_one DD 03f800000r ; 1 | |
DD 03f800000r ; 1 | |
DD 03f800000r ; 1 | |
DD 03f800000r ; 1 | |
DD 03f800000r ; 1 | |
DD 03f800000r ; 1 | |
DD 03f800000r ; 1 | |
DD 03f800000r ; 1 |
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
static public Texture2D CreateMipColorsTexture() | |
{ | |
var MipColorsTexture = new Texture2D(32, 32, TextureFormat.ARGB32, true); | |
MipColorsTexture.hideFlags = HideFlags.HideAndDontSave; | |
Color[] colorArray = new Color[6] | |
{ | |
new Color(0.0f, 0.0f, 1.0f, 0.8f), | |
new Color(0.0f, 0.5f, 1.0f, 0.4f), | |
new Color(1.0f, 1.0f, 1.0f, 0.0f), |
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
static void transpose_4x4_ver0(__m128 & v0, __m128 & v1, __m128 v2, __m128 v3) | |
{ | |
__m128 a0 = _mm_unpacklo_ps(v0, v1); /* a0 = { x0, x1, y0, y1 } */ | |
__m128 a1 = _mm_unpackhi_ps(v0, v1); /* a1 = { z0, z1, z0, z1 } */ | |
__m128 a2 = _mm_unpacklo_ps(v2, v3); /* a2 = { x2, x3, y2, y3 } */ | |
__m128 a3 = _mm_unpackhi_ps(v2, v3); /* a3 = { z2, z3, z2, z3 } */ | |
v0 = _mm_unpacklo_ps(a0, a2); /* v0 = { x0, x1, x2, x3 } */ | |
v1 = _mm_unpackhi_ps(a0, a2); /* v1 = { y0, y1, y2, y3 } */ |
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
Build | |
{ | |
Units = function () | |
local prog = Program | |
{ | |
Name = "project_name", | |
Sources = { "main.c" }, | |
-- Place in MSVC solution folder. |
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 UnityEditor; | |
using System.IO; | |
public class BakeCubemap : ScriptableWizard | |
{ | |
public Transform CapturePosition; | |
public int Antialiasing = 4; | |
public int CubemapResolution = 128; |
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
#ifndef WIN32_LEAN_AND_MEAN | |
# define WIN32_LEAN_AND_MEAN | |
#endif | |
#pragma warning (push) | |
/* 4820: '<struct-name>' : 'n' bytes padding added after data member '<member-name>'*/ | |
# pragma warning (disable : 4820) | |
# include <windows.h> | |
# include <stdio.h> |
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
#pragma warning (push) | |
/* 4820: '<struct-name>' : 'n' bytes padding added after data member '<member-name>'*/ | |
# pragma warning (disable : 4820) | |
# pragma warning (disable : 4255 4668) | |
# include <windows.h> | |
# include <stdio.h> | |
#pragma warning (pop) | |
typedef unsigned u32; |
OlderNewer