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
// | |
// ARSession+GeoTracking.swift | |
// ARExperienceKit | |
// | |
// Created by Arthur Schiller on 22.04.20. | |
// | |
import ARKit | |
import CoreLocation |
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
// Be sure to to set the WrapS and WrapT properties of your texture to .repeat | |
float4 worldPos = scn_frame.inverseViewTransform * float4(_surface.position, 1.0); | |
float4 worldNormal = scn_frame.inverseViewTransform * float4(_surface.normal, 0.0); | |
float3 blending = abs(worldNormal).xyz; | |
blending = normalize(max(blending, 0.00001)); // Force weights to sum to 1.0 | |
float b = (blending.x + blending.y + blending.z); | |
blending /= float3(b, b, b); | |
float scale = 2.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
// | |
// RaymarchPostProcessing.metal | |
// RealityKit Ray Marching | |
// | |
// Created by Arthur Schiller on 02.10.22. | |
// | |
#include <metal_stdlib> | |
using namespace metal; |
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
import { load } from '@loaders.gl/core'; | |
import { LoaderContext } from '@loaders.gl/core'; | |
import { Tiles3DLoader } from '@loaders.gl/3d-tiles'; | |
import { Tileset3D } from '@loaders.gl/tiles'; | |
import { WebMercatorViewport } from '@deck.gl/core'; | |
const apiKey = '<insertKey>'; | |
async function fetchRootTileset() { | |
const baseURL = 'https://tile.googleapis.com' |
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
import SwiftUI | |
import RealityKit | |
struct AnimationDemoView: View { | |
@Environment(\.realityKitScene) var scene: RealityKit.Scene? | |
init() { | |
// register System and Component – Important! | |
AnimationSystem.registerSystem() | |
AnimationComponent.registerComponent() |
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
// | |
// RealityRendererView.swift | |
// RealityRendererTest | |
// | |
// Created by Arthur Schiller on 11.01.24. | |
// | |
import SwiftUI | |
import Metal | |
import MetalKit |
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 DEBUG | |
import Combine | |
private var loadInjectionOnce: () = { | |
guard objc_getClass("InjectionClient") == nil else { | |
return | |
} | |
#if targetEnvironment(simulator) | |
// Running on Simulator |
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
import SwiftUI | |
import RealityKit | |
struct ImmersiveView: View { | |
var body: some View { | |
RealityView { content in | |
// .postPass was the only one that had any visible effect for me | |
let sortGroup = ModelSortGroup(depthPass: .postPass) | |
// this represents some UI and should always be drawn in front of everything else |
OlderNewer