-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from maxxfrazer/bold-material
Bold Materials, iOS 15 required.
- Loading branch information
Showing
6 changed files
with
119 additions
and
36 deletions.
There are no files selected for viewing
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 file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Deploy DocC | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ["main"] | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: macos-13 | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
- name: Build DocC | ||
run: | | ||
xcodebuild docbuild -scheme RealityToolkit -derivedDataPath /tmp/docbuild -destination 'generic/platform=iOS'; | ||
$(xcrun --find docc) process-archive \ | ||
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/RealityToolkit.doccarchive \ | ||
--hosting-base-path RealityToolkit \ | ||
--output-path docs; | ||
echo "<script>window.location.href += \"/documentation/realitytoolkit\"</script>" > docs/index.html | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
# Upload docs directory | ||
path: 'docs' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
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
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 file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// BoldMaterial.swift | ||
// | ||
// | ||
// Created by Max Cobb on 06/05/2023. | ||
// | ||
|
||
import RealityKit | ||
#if canImport(AppKit) | ||
import AppKit.NSColor | ||
#elseif canImport(UIKit.UIColor) | ||
import UIKit.UIColor | ||
#endif | ||
|
||
typealias BoldMaterial = PhysicallyBasedMaterial | ||
|
||
extension BoldMaterial { | ||
/// An initialiser for making a ``BoldMaterial``. BoldMaterial is essentially just a PhysicallyBasedMaterial, | ||
/// but with some properties that make non-responsive to lighting, and the colours pop more vividly than an UnlitMaterial. | ||
/// - Parameters: | ||
/// - color: Color to set for the Bold material. | ||
public init(color: Material.Color) { | ||
self.init(color: color, texture: nil) | ||
} | ||
|
||
/// An initialiser for making a ``BoldMaterial``. BoldMaterial is essentially just a PhysicallyBasedMaterial, | ||
/// but with some properties that make non-responsive to lighting, and the colours pop more vividly than an UnlitMaterial. | ||
/// - Parameters: | ||
/// - texture: Texture to set for the Bold material. | ||
public init(texture: MaterialParameters.Texture) { | ||
self.init(color: nil, texture: texture) | ||
} | ||
internal init(color: Material.Color?, texture: MaterialParameters.Texture?) { | ||
self.init() | ||
self.baseColor = .init(tint: .black) | ||
self.sheen = .init(tint: .black) | ||
if let color = color { | ||
self.emissiveColor = .init(color: color, texture: texture) | ||
} else { | ||
self.emissiveColor = .init(texture: texture) | ||
} | ||
self.emissiveIntensity = 2 | ||
} | ||
} |
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
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
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