Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// ProceduralTextureDemo01.swift
// Foundation-Models-Playgrounds
//
// Created by OpenAI Assistant on 7/21/26.
//

import FoundationModels
import Playgrounds
import RealityKit
import SwiftUI

@Generable(description: "Simple procedural material description for RealityKit.")
struct ProceduralTexture: Codable {
var baseColor: String
var roughness: Float
var metallic: Float
var normalIntensity: Float
var pattern: String?
}

@Generable(description: "Procedural material parameters derived from text adjectives.")
struct TextureRecipe {
var adjectives: [String]
var texture: ProceduralTexture
@Guide(description: "Tips for further tweaking in Reality Composer Pro.")
var authorNotes: String
}

#Playground {
let description = "shiny metallic gold with subtle scratches"
let instruction = """
Turn the adjective phrase into a procedural material recipe suitable for RealityKit's `SimpleMaterial`.
Fill `ProceduralTexture` fields; choose pattern names that standard shaders can emulate.
"""
let session = LanguageModelSession(instructions: instruction)
let recipe = try await session.respond(
to: Prompt(description),
generating: TextureRecipe.self
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// ProceduralTextureDemo02.swift
// Foundation-Models-Playgrounds
//
// Created by OpenAI Assistant on 7/21/26.
//

import FoundationModels
import Playgrounds
import RealityKit
import SwiftUI

@Generable(description: "Simple procedural material description for RealityKit.")
struct ProceduralTexture: Codable {
var baseColor: String
var roughness: Float
var metallic: Float
var normalIntensity: Float
var pattern: String?
}

@Generable(description: "Procedural material parameters derived from text adjectives.")
struct TextureRecipe {
var adjectives: [String]
var texture: ProceduralTexture
@Guide(description: "Tips for further tweaking in Reality Composer Pro.")
var authorNotes: String
}

#Playground {
let description = "rough emerald stone with speckles"
let instruction = """
Turn the adjective phrase into a procedural material recipe suitable for RealityKit's `SimpleMaterial`.
Fill `ProceduralTexture` fields; choose pattern names that standard shaders can emulate.
"""
let session = LanguageModelSession(instructions: instruction)
let recipe = try await session.respond(
to: Prompt(description),
generating: TextureRecipe.self
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// ProceduralTextureDemo03.swift
// Foundation-Models-Playgrounds
//
// Created by OpenAI Assistant on 7/21/26.
//

import FoundationModels
import Playgrounds
import RealityKit
import SwiftUI

@Generable(description: "Simple procedural material description for RealityKit.")
struct ProceduralTexture: Codable {
var baseColor: String
var roughness: Float
var metallic: Float
var normalIntensity: Float
var pattern: String?
}

@Generable(description: "Procedural material parameters derived from text adjectives.")
struct TextureRecipe {
var adjectives: [String]
var texture: ProceduralTexture
@Guide(description: "Tips for further tweaking in Reality Composer Pro.")
var authorNotes: String
}

#Playground {
let description = "soft sky blue fabric with diagonal weave"
let instruction = """
Turn the adjective phrase into a procedural material recipe suitable for RealityKit's `SimpleMaterial`.
Fill `ProceduralTexture` fields; choose pattern names that standard shaders can emulate.
"""
let session = LanguageModelSession(instructions: instruction)
let recipe = try await session.respond(
to: Prompt(description),
generating: TextureRecipe.self
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// ProceduralTextureDemo04.swift
// Foundation-Models-Playgrounds
//
// Created by OpenAI Assistant on 7/21/26.
//

import FoundationModels
import Playgrounds
import RealityKit
import SwiftUI

@Generable(description: "Simple procedural material description for RealityKit.")
struct ProceduralTexture: Codable {
var baseColor: String
var roughness: Float
var metallic: Float
var normalIntensity: Float
var pattern: String?
}

@Generable(description: "Procedural material parameters derived from text adjectives.")
struct TextureRecipe {
var adjectives: [String]
var texture: ProceduralTexture
@Guide(description: "Tips for further tweaking in Reality Composer Pro.")
var authorNotes: String
}

#Playground {
let description = "weathered bronze with patina streaks"
let instruction = """
Turn the adjective phrase into a procedural material recipe suitable for RealityKit's `SimpleMaterial`.
Fill `ProceduralTexture` fields; choose pattern names that standard shaders can emulate.
"""
let session = LanguageModelSession(instructions: instruction)
let recipe = try await session.respond(
to: Prompt(description),
generating: TextureRecipe.self
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// ProceduralTextureDemo05.swift
// Foundation-Models-Playgrounds
//
// Created by OpenAI Assistant on 7/21/26.
//

import FoundationModels
import Playgrounds
import RealityKit
import SwiftUI

@Generable(description: "Simple procedural material description for RealityKit.")
struct ProceduralTexture: Codable {
var baseColor: String
var roughness: Float
var metallic: Float
var normalIntensity: Float
var pattern: String?
}

@Generable(description: "Procedural material parameters derived from text adjectives.")
struct TextureRecipe {
var adjectives: [String]
var texture: ProceduralTexture
@Guide(description: "Tips for further tweaking in Reality Composer Pro.")
var authorNotes: String
}

#Playground {
let description = "frosty ice crystal with ridges"
let instruction = """
Turn the adjective phrase into a procedural material recipe suitable for RealityKit's `SimpleMaterial`.
Fill `ProceduralTexture` fields; choose pattern names that standard shaders can emulate.
"""
let session = LanguageModelSession(instructions: instruction)
let recipe = try await session.respond(
to: Prompt(description),
generating: TextureRecipe.self
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// ProceduralTextureDemo06.swift
// Foundation-Models-Playgrounds
//
// Created by OpenAI Assistant on 7/21/26.
//

import FoundationModels
import Playgrounds
import RealityKit
import SwiftUI

@Generable(description: "Simple procedural material description for RealityKit.")
struct ProceduralTexture: Codable {
var baseColor: String
var roughness: Float
var metallic: Float
var normalIntensity: Float
var pattern: String?
}

@Generable(description: "Procedural material parameters derived from text adjectives.")
struct TextureRecipe {
var adjectives: [String]
var texture: ProceduralTexture
@Guide(description: "Tips for further tweaking in Reality Composer Pro.")
var authorNotes: String
}

#Playground {
let description = "glossy black marble with white veins"
let instruction = """
Turn the adjective phrase into a procedural material recipe suitable for RealityKit's `SimpleMaterial`.
Fill `ProceduralTexture` fields; choose pattern names that standard shaders can emulate.
"""
let session = LanguageModelSession(instructions: instruction)
let recipe = try await session.respond(
to: Prompt(description),
generating: TextureRecipe.self
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// ProceduralTextureDemo07.swift
// Foundation-Models-Playgrounds
//
// Created by OpenAI Assistant on 7/21/26.
//

import FoundationModels
import Playgrounds
import RealityKit
import SwiftUI

@Generable(description: "Simple procedural material description for RealityKit.")
struct ProceduralTexture: Codable {
var baseColor: String
var roughness: Float
var metallic: Float
var normalIntensity: Float
var pattern: String?
}

@Generable(description: "Procedural material parameters derived from text adjectives.")
struct TextureRecipe {
var adjectives: [String]
var texture: ProceduralTexture
@Guide(description: "Tips for further tweaking in Reality Composer Pro.")
var authorNotes: String
}

#Playground {
let description = "velvet crimson with fine texture"
let instruction = """
Turn the adjective phrase into a procedural material recipe suitable for RealityKit's `SimpleMaterial`.
Fill `ProceduralTexture` fields; choose pattern names that standard shaders can emulate.
"""
let session = LanguageModelSession(instructions: instruction)
let recipe = try await session.respond(
to: Prompt(description),
generating: TextureRecipe.self
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// ProceduralTextureDemo08.swift
// Foundation-Models-Playgrounds
//
// Created by OpenAI Assistant on 7/21/26.
//

import FoundationModels
import Playgrounds
import RealityKit
import SwiftUI

@Generable(description: "Simple procedural material description for RealityKit.")
struct ProceduralTexture: Codable {
var baseColor: String
var roughness: Float
var metallic: Float
var normalIntensity: Float
var pattern: String?
}

@Generable(description: "Procedural material parameters derived from text adjectives.")
struct TextureRecipe {
var adjectives: [String]
var texture: ProceduralTexture
@Guide(description: "Tips for further tweaking in Reality Composer Pro.")
var authorNotes: String
}

#Playground {
let description = "matte olive drab with camo blotches"
let instruction = """
Turn the adjective phrase into a procedural material recipe suitable for RealityKit's `SimpleMaterial`.
Fill `ProceduralTexture` fields; choose pattern names that standard shaders can emulate.
"""
let session = LanguageModelSession(instructions: instruction)
let recipe = try await session.respond(
to: Prompt(description),
generating: TextureRecipe.self
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// ProceduralTextureDemo09.swift
// Foundation-Models-Playgrounds
//
// Created by OpenAI Assistant on 7/21/26.
//

import FoundationModels
import Playgrounds
import RealityKit
import SwiftUI

@Generable(description: "Simple procedural material description for RealityKit.")
struct ProceduralTexture: Codable {
var baseColor: String
var roughness: Float
var metallic: Float
var normalIntensity: Float
var pattern: String?
}

@Generable(description: "Procedural material parameters derived from text adjectives.")
struct TextureRecipe {
var adjectives: [String]
var texture: ProceduralTexture
@Guide(description: "Tips for further tweaking in Reality Composer Pro.")
var authorNotes: String
}

#Playground {
let description = "sparkling silver glitter surface"
let instruction = """
Turn the adjective phrase into a procedural material recipe suitable for RealityKit's `SimpleMaterial`.
Fill `ProceduralTexture` fields; choose pattern names that standard shaders can emulate.
"""
let session = LanguageModelSession(instructions: instruction)
let recipe = try await session.respond(
to: Prompt(description),
generating: TextureRecipe.self
)
}
Loading