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
Here I will list my components, software setup and some steps that I did. |
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
// | |
// TextureResource+extension.swift | |
// | |
// Created by Volodymyr Boichentsov on 24/03/2023. | |
// | |
import Foundation | |
import Metal | |
import MetalKit | |
import RealityKit |
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
in vec2 v_texcoord; // texture coords | |
in vec3 v_normal; // normal | |
in vec3 v_binormal; // binormal (for TBN basis calc) | |
in vec3 v_pos; // pixel view space position | |
out vec4 color; | |
layout(std140) uniform Transforms | |
{ | |
mat4x4 world_matrix; // object's world position |
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
// | |
// AppDelegate.m | |
// MetalComputeOSX | |
// | |
#import "AppDelegate.h" | |
@import Metal; | |
#define IMAGE_SIZE 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
// colorData[0] - accum (Ar, Ag, Ab, Aa) | |
// colorData[2] - modulate (Br, Bg, Bb, D^2) | |
// colorData[3] - refraction (deltax, deltay) | |
void writePixel (vec3 premultipliedReflectionAndEmission, float coverage, vec3 transmissionCoefficient) { | |
/* | |
, | |
float collimation, | |
float etaRatio, | |
vec3 csPosition, | |
vec3 csNormal) { |
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
void main() | |
{ | |
ivec2 C = ivec2(gl_FragCoord.xy); | |
vec4 backgroundModulationAndDiffusion = texelFetch(modulationSampler, C, 0); | |
vec3 backgroundModulation = backgroundModulationAndDiffusion.rgb; | |
vec4 background = texelFetch(backgroundSampler, C, 0); |
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
#!/bin/sh | |
# locate file next to `buildg3d` | |
local_path=`pwd` | |
g3d="${local_path}/../" | |
export G3D10DATA=$g3d/G3D10/data-files:$g3d/data10/common:$g3d/data10/game:$g3d/data10/research:$g3d/G3D10/data-files | |
export PATH=$PATH:$g3d/G3D10/bin |
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 __inline__ GLKMatrix4 GLKMatrix4Invert(GLKMatrix4 matrix, bool *isInvertable) { | |
float b00 = matrix.m[0] * matrix.m[5] - matrix.m[1] * matrix.m[4]; | |
float b01 = matrix.m[0] * matrix.m[6] - matrix.m[2] * matrix.m[4]; | |
float b02 = matrix.m[0] * matrix.m[7] - matrix.m[3] * matrix.m[4]; | |
float b03 = matrix.m[1] * matrix.m[6] - matrix.m[2] * matrix.m[5]; | |
float b04 = matrix.m[1] * matrix.m[7] - matrix.m[3] * matrix.m[5]; | |
float b05 = matrix.m[2] * matrix.m[7] - matrix.m[3] * matrix.m[6]; | |
float b06 = matrix.m[8] * matrix.m[13] - matrix.m[9] * matrix.m[12]; | |
float b07 = matrix.m[8] * matrix.m[14] - matrix.m[10] * matrix.m[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
(function() { | |
var ua = /iPhone|iP[oa]d/.test(navigator.userAgent) ? 'iOS' : /Android/.test(navigator.userAgent) ? 'Android' : 'PC'; | |
document.addEventListener('DOMContentLoaded', function(event) { | |
if(ua === 'PC') { | |
return; | |
} | |
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
# Builds a Libpng framework for the iPhone and the iPhone Simulator. | |
# Creates a set of universal libraries that can be used on an iPhone and in the | |
# iPhone simulator. Then creates a pseudo-framework to make using libpng in Xcode | |
# less painful. | |
# | |
# To configure the script, define: | |
# IPHONE_SDKVERSION: iPhone SDK version (e.g. 8.1) | |
# | |
# Then go get the source tar.bz of the libpng you want to build, shove it in the | |
# same directory as this script, and run "./libpng.sh". |
NewerOlder