PulseCanvas / app / commits / 0c0f13ae
App source: current code (part 1 of 4) new
written by Branchwell · 0c0f13aedcaf984646237f478d4915d73e9d0aeb
6735 files changed
.gitignore added
| 1 | + .DS_Store | |
| 2 | + .build/ | |
| 3 | + build/ | |
| 4 | + work/ | |
| 5 | + .swiftpm/ | |
| 6 | + *.metallib | |
| 7 | + *.air | |
| 8 | + *.caf | |
| 9 | + *.mov | |
| 10 | + *.mp4 | |
| 11 | + | |
| 12 | + __pycache__/ | |
| 13 | + *.py[cod] | |
| 14 | + | |
| 15 | + # Keep separate managed agent checkouts out of app source commits. | |
| 16 | + .claude/worktrees/ | |
| 17 | + | |
| 18 | + # Archived screenshot renders and native capture inputs stay outside source commits. | |
| 19 | + assets/app-store/mobile-marketing-1.1.5/sources/ | |
| 20 | + assets/app-store/mobile-marketing-1.1.5/release/ | |
| 21 | + assets/app-store/mobile-marketing-1.1.5/*.jpg |
CONTRIBUTING.md added
| 1 | + # Contributing to PulseCanvas Studio | |
| 2 | + | |
| 3 | + Volunteer contributions are welcome. A small bug fix, accessibility improvement, test, or documentation update is a good first PR. | |
| 4 | + | |
| 5 | + 1. [Fork the public repository](https://github.com/projectatomai/pulsecanvas/fork), clone your fork, and create a branch for your change. Don’t push directly to the upstream `main` branch. | |
| 6 | + 2. Make one focused change and run the relevant checks below. Use sample data. Never include secrets, private records, signing credentials, or files you don’t have permission to share. | |
| 7 | + 3. [Open a pull request](https://github.com/projectatomai/pulsecanvas/pulls) from your fork’s branch to this repository’s `main`. Explain what changed, why, and how you tested it. Mention anything you couldn’t test and attach screenshots if they clarify a UI change. A maintainer reviews changes before merging. | |
| 8 | + | |
| 9 | + ## Local checks | |
| 10 | + | |
| 11 | + See the [README build instructions](README.md#build-it-on-your-mac). Use `./scripts/build-app.sh` for a local Mac build and run the relevant checks listed in the README, such as `./scripts/test-studio.sh` for Studio or `./scripts/test-social-export.sh` for exports. Use media you own or have permission to share. | |
| 12 | + | |
| 13 | + Prefer testing, design, or documentation help without a PR? See the [volunteer app-support roles](https://jobley.ai/volunteer/#app-support) or [Project ATOM’s open-source app directory](https://projectatom.ai/apps#open-source). |
LICENSE added
| 1 | + This is free and unencumbered software released into the public domain. | |
| 2 | + | |
| 3 | + Anyone is free to copy, modify, publish, use, compile, sell, or | |
| 4 | + distribute this software, either in source code form or as a compiled | |
| 5 | + binary, for any purpose, commercial or non-commercial, and by any | |
| 6 | + means. | |
| 7 | + | |
| 8 | + In jurisdictions that recognize copyright laws, the author or authors | |
| 9 | + of this software dedicate any and all copyright interest in the | |
| 10 | + software to the public domain. We make this dedication for the benefit | |
| 11 | + of the public at large and to the detriment of our heirs and | |
| 12 | + successors. We intend this dedication to be an overt act of | |
| 13 | + relinquishment in perpetuity of all present and future rights to this | |
| 14 | + software under copyright law. | |
| 15 | + | |
| 16 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
| 17 | + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
| 18 | + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |
| 19 | + IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | |
| 20 | + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | |
| 21 | + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | |
| 22 | + OTHER DEALINGS IN THE SOFTWARE. | |
| 23 | + | |
| 24 | + For more information, please refer to <https://unlicense.org> |
Package.resolved added
| 1 | + { | |
| 2 | + "originHash" : "9797290b8d410b635add6b46cbcc256dabaceddacd92673ee14458b87c619cbe", | |
| 3 | + "pins" : [ | |
| 4 | + { | |
| 5 | + "identity" : "zipfoundation", | |
| 6 | + "kind" : "remoteSourceControl", | |
| 7 | + "location" : "https://github.com/weichsel/ZIPFoundation.git", | |
| 8 | + "state" : { | |
| 9 | + "revision" : "22787ffb59de99e5dc1fbfe80b19c97a904ad48d", | |
| 10 | + "version" : "0.9.20" | |
| 11 | + } | |
| 12 | + } | |
| 13 | + ], | |
| 14 | + "version" : 3 | |
| 15 | + } |
Package.swift added
| 1 | + // swift-tools-version: 6.0 | |
| 2 | + import PackageDescription | |
| 3 | + let package = Package( | |
| 4 | + name: "PulseCanvas", | |
| 5 | + platforms: [.macOS(.v14)], | |
| 6 | + products: [.executable(name: "PulseCanvas", targets: ["PulseCanvas"])], | |
| 7 | + dependencies: [.package(url: "https://github.com/weichsel/ZIPFoundation.git", exact: "0.9.20")], | |
| 8 | + targets: [ | |
| 9 | + .executableTarget(name: "PulseCanvas", dependencies: ["ZIPFoundation"], resources: [.copy("Resources")], swiftSettings: [.swiftLanguageMode(.v5)]) | |
| 10 | + ] | |
| 11 | + ) |
PulseCanvas.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved added
| 1 | + { | |
| 2 | + "originHash" : "efc907b029c4f3ad57012b4c2bed078ed0844fbeba8afd5f280ecd2742198ab0", | |
| 3 | + "pins" : [ | |
| 4 | + { | |
| 5 | + "identity" : "zipfoundation", | |
| 6 | + "kind" : "remoteSourceControl", | |
| 7 | + "location" : "https://github.com/weichsel/ZIPFoundation.git", | |
| 8 | + "state" : { | |
| 9 | + "revision" : "22787ffb59de99e5dc1fbfe80b19c97a904ad48d", | |
| 10 | + "version" : "0.9.20" | |
| 11 | + } | |
| 12 | + } | |
| 13 | + ], | |
| 14 | + "version" : 3 | |
| 15 | + } |
PulseCanvas.xcodeproj/xcshareddata/xcschemes/PulseCanvas.xcscheme added
| 1 | + <?xml version="1.0" encoding="UTF-8"?> | |
| 2 | + <Scheme LastUpgradeVersion="2700" version="1.3"> | |
| 3 | + <BuildAction parallelizeBuildables="YES" buildImplicitDependencies="YES"><BuildActionEntries><BuildActionEntry buildForTesting="YES" buildForRunning="YES" buildForProfiling="YES" buildForArchiving="YES" buildForAnalyzing="YES"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="34A04005BCAF206EEC990BD9" BuildableName="PulseCanvas Studio.app" BlueprintName="PulseCanvas" ReferencedContainer="container:PulseCanvas.xcodeproj"/></BuildActionEntry></BuildActionEntries></BuildAction> | |
| 4 | + <TestAction buildConfiguration="Debug"/> | |
| 5 | + <LaunchAction buildConfiguration="Debug" selectedDebuggerIdentifier="Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier="Xcode.IDEFoundation.Launcher.LLDB" launchStyle="0" useCustomWorkingDirectory="NO" ignoresPersistentStateOnLaunch="NO" debugDocumentVersioning="YES" debugServiceExtension="internal" allowLocationSimulation="NO"><BuildableProductRunnable runnableDebuggingMode="0"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="34A04005BCAF206EEC990BD9" BuildableName="PulseCanvas Studio.app" BlueprintName="PulseCanvas" ReferencedContainer="container:PulseCanvas.xcodeproj"/></BuildableProductRunnable></LaunchAction> | |
| 6 | + <ProfileAction buildConfiguration="Release"><BuildableProductRunnable runnableDebuggingMode="0"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="34A04005BCAF206EEC990BD9" BuildableName="PulseCanvas Studio.app" BlueprintName="PulseCanvas" ReferencedContainer="container:PulseCanvas.xcodeproj"/></BuildableProductRunnable></ProfileAction> | |
| 7 | + <AnalyzeAction buildConfiguration="Debug"/> | |
| 8 | + <ArchiveAction buildConfiguration="Release" revealArchiveInOrganizer="YES"/> | |
| 9 | + </Scheme> |
PulseCanvasMobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved added
| 1 | + { | |
| 2 | + "originHash" : "efc907b029c4f3ad57012b4c2bed078ed0844fbeba8afd5f280ecd2742198ab0", | |
| 3 | + "pins" : [ | |
| 4 | + { | |
| 5 | + "identity" : "zipfoundation", | |
| 6 | + "kind" : "remoteSourceControl", | |
| 7 | + "location" : "https://github.com/weichsel/ZIPFoundation.git", | |
| 8 | + "state" : { | |
| 9 | + "revision" : "22787ffb59de99e5dc1fbfe80b19c97a904ad48d", | |
| 10 | + "version" : "0.9.20" | |
| 11 | + } | |
| 12 | + } | |
| 13 | + ], | |
| 14 | + "version" : 3 | |
| 15 | + } |
PulseCanvasMobile.xcodeproj/xcshareddata/xcschemes/PulseCanvasMobile.xcscheme added
| 1 | + <?xml version="1.0" encoding="UTF-8"?> | |
| 2 | + <Scheme LastUpgradeVersion="2700" version="1.3"> | |
| 3 | + <BuildAction parallelizeBuildables="YES" buildImplicitDependencies="YES"><BuildActionEntries><BuildActionEntry buildForTesting="YES" buildForRunning="YES" buildForProfiling="YES" buildForArchiving="YES" buildForAnalyzing="YES"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="34A04005BCAF206EEC990BD9" BuildableName="PulseCanvas Mobile.app" BlueprintName="PulseCanvasMobile" ReferencedContainer="container:PulseCanvasMobile.xcodeproj"/></BuildActionEntry></BuildActionEntries></BuildAction> | |
| 4 | + <TestAction buildConfiguration="Debug" selectedDebuggerIdentifier="Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier="Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv="YES"><Testables><TestableReference skipped="NO"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="9E53AA71467D2DE08E504D40" BuildableName="PulseCanvasMobileUITests.xctest" BlueprintName="PulseCanvasMobileUITests" ReferencedContainer="container:PulseCanvasMobile.xcodeproj"/></TestableReference></Testables></TestAction> | |
| 5 | + <LaunchAction buildConfiguration="Debug" selectedDebuggerIdentifier="Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier="Xcode.IDEFoundation.Launcher.LLDB" launchStyle="0" useCustomWorkingDirectory="NO" ignoresPersistentStateOnLaunch="NO" debugDocumentVersioning="YES" allowLocationSimulation="YES"><BuildableProductRunnable runnableDebuggingMode="0"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="34A04005BCAF206EEC990BD9" BuildableName="PulseCanvas Mobile.app" BlueprintName="PulseCanvasMobile" ReferencedContainer="container:PulseCanvasMobile.xcodeproj"/></BuildableProductRunnable></LaunchAction> | |
| 6 | + <ProfileAction buildConfiguration="Release"><BuildableProductRunnable runnableDebuggingMode="0"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="34A04005BCAF206EEC990BD9" BuildableName="PulseCanvas Mobile.app" BlueprintName="PulseCanvasMobile" ReferencedContainer="container:PulseCanvasMobile.xcodeproj"/></BuildableProductRunnable></ProfileAction> | |
| 7 | + <AnalyzeAction buildConfiguration="Debug"/> | |
| 8 | + <ArchiveAction buildConfiguration="Release" revealArchiveInOrganizer="YES"/> | |
| 9 | + </Scheme> |
PulseCanvasVision.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved added
| 1 | + { | |
| 2 | + "originHash" : "efc907b029c4f3ad57012b4c2bed078ed0844fbeba8afd5f280ecd2742198ab0", | |
| 3 | + "pins" : [ | |
| 4 | + { | |
| 5 | + "identity" : "zipfoundation", | |
| 6 | + "kind" : "remoteSourceControl", | |
| 7 | + "location" : "https://github.com/weichsel/ZIPFoundation.git", | |
| 8 | + "state" : { | |
| 9 | + "revision" : "22787ffb59de99e5dc1fbfe80b19c97a904ad48d", | |
| 10 | + "version" : "0.9.20" | |
| 11 | + } | |
| 12 | + } | |
| 13 | + ], | |
| 14 | + "version" : 3 | |
| 15 | + } |
PulseCanvasVision.xcodeproj/xcshareddata/xcschemes/PulseCanvasVision.xcscheme added
| 1 | + <?xml version="1.0" encoding="UTF-8"?> | |
| 2 | + <Scheme LastUpgradeVersion="2700" version="1.3"> | |
| 3 | + <BuildAction parallelizeBuildables="YES" buildImplicitDependencies="YES"><BuildActionEntries><BuildActionEntry buildForTesting="YES" buildForRunning="YES" buildForProfiling="YES" buildForArchiving="YES" buildForAnalyzing="YES"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="34A04005BCAF206EEC990BD9" BuildableName="PulseCanvas Vision.app" BlueprintName="PulseCanvasVision" ReferencedContainer="container:PulseCanvasVision.xcodeproj"/></BuildActionEntry></BuildActionEntries></BuildAction> | |
| 4 | + <TestAction buildConfiguration="Debug" selectedDebuggerIdentifier="Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier="Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv="YES"><Testables><TestableReference skipped="NO"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="9E53AA71467D2DE08E504D40" BuildableName="PulseCanvasVisionUITests.xctest" BlueprintName="PulseCanvasVisionUITests" ReferencedContainer="container:PulseCanvasVision.xcodeproj"/></TestableReference></Testables></TestAction> | |
| 5 | + <LaunchAction buildConfiguration="Debug" selectedDebuggerIdentifier="Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier="Xcode.IDEFoundation.Launcher.LLDB" launchStyle="0" useCustomWorkingDirectory="NO" ignoresPersistentStateOnLaunch="NO" debugDocumentVersioning="YES" allowLocationSimulation="YES"><BuildableProductRunnable runnableDebuggingMode="0"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="34A04005BCAF206EEC990BD9" BuildableName="PulseCanvas Vision.app" BlueprintName="PulseCanvasVision" ReferencedContainer="container:PulseCanvasVision.xcodeproj"/></BuildableProductRunnable></LaunchAction> | |
| 6 | + <ProfileAction buildConfiguration="Release"><BuildableProductRunnable runnableDebuggingMode="0"><BuildableReference BuildableIdentifier="primary" BlueprintIdentifier="34A04005BCAF206EEC990BD9" BuildableName="PulseCanvas Vision.app" BlueprintName="PulseCanvasVision" ReferencedContainer="container:PulseCanvasVision.xcodeproj"/></BuildableProductRunnable></ProfileAction> | |
| 7 | + <AnalyzeAction buildConfiguration="Debug"/> | |
| 8 | + <ArchiveAction buildConfiguration="Release" revealArchiveInOrganizer="YES"/> | |
| 9 | + </Scheme> |
Sources/PulseCanvas/AppLifecycle.swift added
| 1 | + import AppKit | |
| 2 | + | |
| 3 | + /// Closing the last editor or radio window ends playback and quits, even if an | |
| 4 | + /// auxiliary credits window remains open. Minimizing is not a close event. | |
| 5 | + @MainActor | |
| 6 | + final class AppLifecycle: NSObject, NSApplicationDelegate { | |
| 7 | + private let primaryWindows = NSHashTable<NSWindow>.weakObjects() | |
| 8 | + private weak var audio: AudioController? | |
| 9 | + private weak var radio: RadioController? | |
| 10 | + | |
| 11 | + override init() { | |
| 12 | + super.init() | |
| 13 | + NotificationCenter.default.addObserver(self, selector: #selector(windowWillClose(_:)), | |
| 14 | + name: NSWindow.willCloseNotification, object: nil) | |
| 15 | + } | |
| 16 | + | |
| 17 | + func attach(audio: AudioController, radio: RadioController) { | |
| 18 | + self.audio = audio; self.radio = radio | |
| 19 | + } | |
| 20 | + | |
| 21 | + func track(_ window: NSWindow?) { | |
| 22 | + if let window { primaryWindows.add(window) } | |
| 23 | + } | |
| 24 | + | |
| 25 | + func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { true } | |
| 26 | + | |
| 27 | + func applicationWillTerminate(_ notification: Notification) { stopPlayback() } | |
| 28 | + | |
| 29 | + private func stopPlayback() { radio?.shutdown(); audio?.stop() } | |
| 30 | + | |
| 31 | + @objc private func windowWillClose(_ notification: Notification) { | |
| 32 | + guard let window = notification.object as? NSWindow, primaryWindows.contains(window) else { return } | |
| 33 | + primaryWindows.remove(window) | |
| 34 | + guard primaryWindows.allObjects.isEmpty else { return } | |
| 35 | + stopPlayback() | |
| 36 | + // Finish the native close event before terminating the SwiftUI scene host. | |
| 37 | + DispatchQueue.main.async { NSApplication.shared.terminate(nil) } | |
| 38 | + } | |
| 39 | + } |
Sources/PulseCanvas/AppUpdater.swift added
| 1 | + #if DIRECT_BUILD && canImport(Sparkle) && !LOCAL_BUILD | |
| 2 | + import Combine | |
| 3 | + import Sparkle | |
| 4 | + import SwiftUI | |
| 5 | + | |
| 6 | + /// The direct-download edition retains Sparkle for the lifetime of the app. | |
| 7 | + /// App Store updates are delivered exclusively by Apple. | |
| 8 | + @MainActor final class AppUpdater: NSObject, ObservableObject, SPUUpdaterDelegate, SPUStandardUserDriverDelegate { | |
| 9 | + private var controller: SPUStandardUpdaterController! | |
| 10 | + private var observation: NSKeyValueObservation? | |
| 11 | + private var activation: AnyCancellable? | |
| 12 | + private var probeTimer: Timer? | |
| 13 | + private var lastProbe: Date? | |
| 14 | + private var started = false | |
| 15 | + @Published private(set) var availableVersion: String? | |
| 16 | + @Published private(set) var canCheck = false | |
| 17 | + @Published var automaticChecks = false { | |
| 18 | + didSet { | |
| 19 | + guard started else { return } | |
| 20 | + controller.updater.automaticallyChecksForUpdates = automaticChecks | |
| 21 | + if automaticChecks { lastProbe = nil; probeIfNeeded() } | |
| 22 | + } | |
| 23 | + } | |
| 24 | + override init() { | |
| 25 | + super.init() | |
| 26 | + controller = SPUStandardUpdaterController(startingUpdater: false, updaterDelegate: self, userDriverDelegate: self) | |
| 27 | + automaticChecks = controller.updater.automaticallyChecksForUpdates | |
| 28 | + observation = controller.updater.observe(\.canCheckForUpdates, options: [.initial, .new]) { [weak self] updater, _ in | |
| 29 | + let ready = updater.canCheckForUpdates | |
| 30 | + Task { @MainActor in | |
| 31 | + self?.canCheck = ready | |
| 32 | + if ready { self?.probeIfNeeded() } | |
| 33 | + } | |
| 34 | + } | |
| 35 | + controller.startUpdater() | |
| 36 | + started = true | |
| 37 | + activation = NotificationCenter.default.publisher(for: NSApplication.didBecomeActiveNotification).sink { [weak self] _ in | |
| 38 | + Task { @MainActor in self?.probeIfNeeded() } | |
| 39 | + } | |
| 40 | + probeTimer = Timer.scheduledTimer(withTimeInterval: 900, repeats: true) { [weak self] _ in | |
| 41 | + Task { @MainActor in self?.probeIfNeeded() } | |
| 42 | + } | |
| 43 | + probeIfNeeded() | |
| 44 | + } | |
| 45 | + deinit { probeTimer?.invalidate() } | |
| 46 | + | |
| 47 | + private func probeIfNeeded() { | |
| 48 | + guard started, automaticChecks, availableVersion == nil, | |
| 49 | + controller.updater.canCheckForUpdates, !controller.updater.sessionInProgress, | |
| 50 | + lastProbe.map({ Date().timeIntervalSince($0) >= 900 }) ?? true else { return } | |
| 51 | + lastProbe = Date() | |
| 52 | + controller.updater.checkForUpdateInformation() | |
| 53 | + } | |
| 54 | + func checkForUpdates() { | |
| 55 | + guard controller.updater.canCheckForUpdates else { return } | |
| 56 | + controller.checkForUpdates(nil) | |
| 57 | + } | |
| 58 | + | |
| 59 | + nonisolated func updater(_ updater: SPUUpdater, didFindValidUpdate item: SUAppcastItem) { | |
| 60 | + let version = item.displayVersionString | |
| 61 | + Task { @MainActor [weak self] in self?.availableVersion = version } | |
| 62 | + } | |
| 63 | + nonisolated func updaterDidNotFindUpdate(_ updater: SPUUpdater, error: any Error) { | |
| 64 | + Task { @MainActor [weak self] in self?.availableVersion = nil } | |
| 65 | + } | |
| 66 | + nonisolated func updater(_ updater: SPUUpdater, userDidMake choice: SPUUserUpdateChoice, | |
| 67 | + forUpdate updateItem: SUAppcastItem, state: SPUUserUpdateState) { | |
| 68 | + if choice == .skip { | |
| 69 | + Task { @MainActor [weak self] in self?.availableVersion = nil } | |
| 70 | + } | |
| 71 | + } | |
| 72 | + nonisolated var supportsGentleScheduledUpdateReminders: Bool { true } | |
| 73 | + nonisolated func standardUserDriverShouldHandleShowingScheduledUpdate(_ update: SUAppcastItem, andInImmediateFocus immediateFocus: Bool) -> Bool { false } | |
| 74 | + nonisolated func standardUserDriverWillHandleShowingUpdate(_ handleShowingUpdate: Bool, | |
| 75 | + forUpdate update: SUAppcastItem, state: SPUUserUpdateState) { | |
| 76 | + let version = update.displayVersionString | |
| 77 | + Task { @MainActor [weak self] in self?.availableVersion = version } | |
| 78 | + } | |
| 79 | + } | |
| 80 | + | |
| 81 | + struct AppUpdateButton: View { | |
| 82 | + @ObservedObject var updater: AppUpdater | |
| 83 | + var body: some View { | |
| 84 | + if let version = updater.availableVersion { | |
| 85 | + Button { updater.checkForUpdates() } label: { | |
| 86 | + Image(systemName: "tray.and.arrow.down.fill").font(.system(size: 17, weight: .semibold)) | |
| 87 | + } | |
| 88 | + .buttonStyle(StudioButtonStyle(treatment: .primary, circular: true)) | |
| 89 | + .disabled(!updater.canCheck) | |
| 90 | + .help("Update \(version) is available. Click to install.") | |
| 91 | + .accessibilityLabel("Install update \(version)") | |
| 92 | + } | |
| 93 | + } | |
| 94 | + } | |
| 95 | + #endif |
Sources/PulseCanvas/AudioController.swift added
| 1 | + import Foundation | |
| 2 | + import AVFoundation | |
| 3 | + import Combine | |
| 4 | + | |
| 5 | + /// A single project soundtrack, with real PCM analysis for the preview. | |
| 6 | + @MainActor | |
| 7 | + final class AudioController: ObservableObject { | |
| 8 | + @Published private(set) var selectedURL: URL? | |
| 9 | + @Published private(set) var title = String(localized: "Add a soundtrack") | |
| 10 | + @Published private(set) var duration = 0.0 | |
| 11 | + @Published private(set) var isPlaying = false | |
| 12 | + private(set) var progress = 0.0 | |
| 13 | + private(set) var playbackSeconds = 0.0 | |
| 14 | + @Published private(set) var status = String(localized: "Choose music to sync your visuals") | |
| 15 | + private(set) var spectrum = [Float](repeating: 0, count: 32) | |
| 16 | + private(set) var beatPulse: Float = 0 | |
| 17 | + private(set) var trebleAttackTime: Double? = nil | |
| 18 | + private(set) var treblePulse: Float = 0 | |
| 19 | + private(set) var momentum: Float = 0 | |
| 20 | + private(set) var beatMotionTime: Double = 0 | |
| 21 | + private(set) var envelopes = SIMD4<Float>(repeating: 0) | |
| 22 | + private(set) var swell: Float = 0 | |
| 23 | + @Published private(set) var previewSectionStart: Double? | |
| 24 | + // High-rate audio data bypasses ObservableObject; only playback widgets observe it. | |
| 25 | + let visualizationUpdated = PassthroughSubject<Void, Never>() | |
| 26 | + private var visualizationEnabled = true | |
| 27 | + private var lastBackgroundProgressRefresh: TimeInterval = 0 | |
| 28 | + /// Background listening keeps its playback clock and completion callbacks, | |
| 29 | + /// without spending CPU on audio features for an invisible renderer. | |
| 30 | + func setVisualizationEnabled(_ enabled: Bool) { | |
| 31 | + visualizationEnabled = enabled | |
| 32 | + if enabled { updateProgress() } | |
| 33 | + } | |
| 34 | + private var previewSectionEnd: Double? | |
| 35 | + @Published var loopEnabled = true | |
| 36 | + /// Radio owns full-song completion; bounded Studio previews still loop normally. | |
| 37 | + var onSoundtrackFinished: (() -> Void)? | |
| 38 | + @Published var volume: Float = 0.7 { didSet { engine.mainMixerNode.outputVolume = min(1, max(0, volume)) } } | |
| 39 | + private let engine = AVAudioEngine() | |
| 40 | + private let player = AVAudioPlayerNode() | |
| 41 | + private var file: AVAudioFile? | |
| 42 | + private var analyzer: SoundtrackAnalyzer? | |
| 43 | + private var segmentStart: AVAudioFramePosition = 0 | |
| 44 | + private var generation = UUID() | |
| 45 | + private var timer: Timer? | |
| 46 | + private var attemptedDefaultSoundtrack = false | |
| 47 | + private var soundtrackAccess: SecurityScopedAccess? | |
| 48 | + private(set) var soundtrackBookmark: Data? | |
| 49 | + | |
| 50 | + init() { | |
| 51 | + engine.attach(player) | |
| 52 | + engine.connect(player, to: engine.mainMixerNode, format: nil) | |
| 53 | + engine.mainMixerNode.outputVolume = volume | |
| 54 | + timer = Timer(timeInterval: 1.0 / 60, repeats: true) { [weak self] _ in | |
| 55 | + Task { @MainActor [weak self] in self?.updateProgress(fromTimer: true) } | |
| 56 | + } | |
| 57 | + RunLoop.main.add(timer!, forMode: .common) | |
| 58 | + } | |
| 59 | + | |
| 60 | + @discardableResult | |
| 61 | + func loadDefaultSoundtrackIfNeeded() -> Bool { | |
| 62 | + guard !attemptedDefaultSoundtrack else { return selectedURL != nil } | |
| 63 | + attemptedDefaultSoundtrack = true | |
| 64 | + guard selectedURL == nil else { return true } | |
| 65 | + guard let url = BundledSoundtrack.url else { return false } | |
| 66 | + return load(url: url) | |
| 67 | + } | |
| 68 | + | |
| 69 | + @discardableResult | |
| 70 | + func load(url: URL, bookmark: Data? = nil) -> Bool { | |
| 71 | + do { | |
| 72 | + let url = SecurityScopedAccess.resolve(bookmark: bookmark, fallback: url) | |
| 73 | + return install(try PreparedSoundtrack(url: url)) | |
| 74 | + } catch { status = String(localized: "Cannot open soundtrack: \(error.localizedDescription)"); return false } | |
| 75 | + } | |
| 76 | + | |
| 77 | + /// Prepared on a worker, then transferred exclusively to the playback actor. | |
| 78 | + @discardableResult | |
| 79 | + func install(_ prepared: PreparedSoundtrack, title displayTitle: String? = nil) -> Bool { | |
| 80 | + do { | |
| 81 | + let opened = prepared.file, url = prepared.url | |
| 82 | + stop() | |
| 83 | + analyzer = prepared.analyzer | |
| 84 | + file = opened | |
| 85 | + engine.disconnectNodeOutput(player) | |
| 86 | + engine.connect(player, to: engine.mainMixerNode, format: opened.processingFormat) | |
| 87 | + engine.prepare() | |
| 88 | + #if os(macOS) | |
| 89 | + try engine.start() | |
| 90 | + #endif | |
| 91 | + soundtrackAccess = prepared.access | |
| 92 | + soundtrackBookmark = BundledSoundtrack.identifier(for: url) == nil ? try? prepared.access.readOnlyBookmark() : nil | |
| 93 | + selectedURL = url | |
| 94 | + title = displayTitle ?? url.deletingPathExtension().lastPathComponent | |
| 95 | + duration = Double(opened.length) / opened.processingFormat.sampleRate | |
| 96 | + schedule(from: 0, playing: false) | |
| 97 | + analyze(frame: 0) | |
| 98 | + status = String(localized: "Soundtrack ready") | |
| 99 | + return true | |
| 100 | + } catch { status = String(localized: "Cannot open soundtrack: \(error.localizedDescription)"); return false } | |
| 101 | + } | |
| 102 | + | |
| 103 | + /// Retain the already analyzed Studio song while Radio temporarily owns playback. | |
| 104 | + /// The snapshot is used on the same actor after Radio has stopped its player. | |
| 105 | + func retainedSoundtrack() -> PreparedSoundtrack? { | |
| 106 | + guard let url = selectedURL, let access = soundtrackAccess, let file, let analyzer else { return nil } | |
| 107 | + return PreparedSoundtrack(url: url, access: access, file: file, analyzer: analyzer) | |
| 108 | + } | |
| 109 | + | |
| 110 | + func clear() { | |
| 111 | + stop(); file = nil; analyzer = nil; selectedURL = nil; title = String(localized: "Add a soundtrack"); duration = 0 | |
| 112 | + soundtrackAccess = nil; soundtrackBookmark = nil | |
| 113 | + engine.stop(); status = String(localized: "Choose music to sync your visuals") | |
| 114 | + } | |
| 115 | + | |
| 116 | + func segmentPlan(beatsPerSection: Int = 16) -> SongSegmentation? { analyzer?.segmentPlan(beatsPerSection: beatsPerSection) } | |
| 117 | + | |
| 118 | + private func startPlaybackEngine() -> Bool { | |
| 119 | + do { | |
| 120 | + #if !os(macOS) | |
| 121 | + try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default) | |
| 122 | + try AVAudioSession.sharedInstance().setActive(true) | |
| 123 | + #endif | |
| 124 | + if !engine.isRunning { try engine.start() } | |
| 125 | + return true | |
| 126 | + } catch { status = String(localized: "Audio playback couldn't start: \(error.localizedDescription)"); return false } | |
| 127 | + } | |
| 128 | + func playPause() { | |
| 129 | + guard file != nil else { return } | |
| 130 | + if !isPlaying && !startPlaybackEngine() { return } | |
| 131 | + if isPlaying { updateProgress(); player.pause(); isPlaying = false; status = String(localized: "Paused") } | |
| 132 | + else { | |
| 133 | + if progress >= 0.9999 { schedule(from: 0, playing: true) } | |
| 134 | + else { | |
| 135 | + if previewSectionStart != nil { seek(fraction: progress) } | |
| 136 | + player.play(); isPlaying = true | |
| 137 | + } | |
| 138 | + status = String(localized: "Playing soundtrack") | |
| 139 | + } | |
| 140 | + } | |
| 141 | + | |
| 142 | + /// Leave any bounded section preview and play the complete Studio timeline. | |
| 143 | + func playFullSoundtrack() { | |
| 144 | + guard file != nil else { return } | |
| 145 | + seek(fraction: progress >= 0.9999 ? 0 : progress) | |
| 146 | + if !isPlaying { playPause() } | |
| 147 | + } | |
| 148 | + | |
| 149 | + func pause() { if isPlaying { playPause() } } | |
| 150 | + | |
| 151 | + func stop() { | |
| 152 | + generation = UUID(); player.stop(); isPlaying = false; segmentStart = 0 | |
| 153 | + previewSectionStart = nil; previewSectionEnd = nil | |
| 154 | + progress = 0; playbackSeconds = 0; spectrum = [Float](repeating: 0, count: 32); beatPulse = 0; momentum = 0; beatMotionTime = 0; envelopes = .zero; swell = 0; treblePulse = 0; trebleAttackTime = nil | |
| 155 | + visualizationUpdated.send() | |
| 156 | + } | |
| 157 | + | |
| 158 | + /// Loop the selected section until paused or replaced; style controls restart it. | |
| 159 | + func playSection(start: Double, end: Double, restart: Bool = false) { | |
| 160 | + guard let file, start.isFinite, end.isFinite, start >= 0, end > start, end <= duration + 0.001 else { return } | |
| 161 | + if !restart && isPlaying && previewSectionStart == start { pause(); return } | |
| 162 | + let rate = file.processingFormat.sampleRate | |
| 163 | + let first = min(file.length - 1, AVAudioFramePosition(start == 0 ? 0 : ceil((start * rate).nextUp))) | |
| 164 | + let last = min(file.length, AVAudioFramePosition(end * rate)) | |
| 165 | + guard last > first else { return } | |
| 166 | + previewSectionStart = start; previewSectionEnd = end | |
| 167 | + progress = Double(first) / Double(file.length); playbackSeconds = Double(first) / rate | |
| 168 | + analyze(frame: first) | |
| 169 | + schedule(from: first, playing: true, end: last) | |
| 170 | + status = String(localized: "Playing Studio section · Looping") | |
| 171 | + } | |
| 172 | + | |
| 173 | + /// Selecting a card preserves playback: switch a running loop, or seek while paused. | |
| 174 | + func selectSection(start: Double, end: Double) { | |
| 175 | + guard file != nil, start.isFinite, end.isFinite, start >= 0, end > start, end <= duration + 0.001 else { return } | |
| 176 | + if isPlaying { playSection(start: start, end: end, restart: true) } | |
| 177 | + else { seekToSection(start: start) } | |
| 178 | + } | |
| 179 | + | |
| 180 | + func seek(fraction: Double) { | |
| 181 | + guard let file else { return } | |
| 182 | + let fraction = min(1, max(0, fraction)) | |
| 183 | + seek(frame: min(file.length - 1, AVAudioFramePosition(fraction * Double(file.length)))) | |
| 184 | + } | |
| 185 | + | |
| 186 | + func seekToSection(start: Double) { | |
| 187 | + guard let file, start.isFinite, start >= 0, start < duration else { return } | |
| 188 | + let rate = file.processingFormat.sampleRate | |
| 189 | + // Stay inside the selected section when its boundary lies between samples. | |
| 190 | + let first = start == 0 ? 0 : ceil((start * rate).nextUp) | |
| 191 | + seek(frame: min(file.length - 1, AVAudioFramePosition(first))) | |
| 192 | + } | |
| 193 | + | |
| 194 | + private func seek(frame: AVAudioFramePosition) { | |
| 195 | + guard let file else { return } | |
| 196 | + previewSectionStart = nil; previewSectionEnd = nil | |
| 197 | + schedule(from: frame, playing: isPlaying) | |
| 198 | + progress = Double(frame) / Double(file.length) | |
| 199 | + playbackSeconds = Double(frame) / file.processingFormat.sampleRate | |
| 200 | + analyze(frame: frame) | |
| 201 | + } | |
| 202 | + | |
| 203 | + func visualizationPCM(at time: Double) -> [Float] { (try? analyzer?.pcm(at: time)) ?? [] } | |
| 204 | + | |
| 205 | + private func analyze(frame: AVAudioFramePosition) { | |
| 206 | + defer { visualizationUpdated.send() } | |
| 207 | + guard visualizationEnabled else { return } | |
| 208 | + guard let file, let analyzer else { return } | |
| 209 | + do { | |
| 210 | + let features = try analyzer.frame(at: Double(frame) / file.processingFormat.sampleRate, | |
| 211 | + clipStart: 0, clipEnd: duration) | |
| 212 | + spectrum = features.bands | |
| 213 | + beatPulse = features.pulse | |
| 214 | + momentum = features.momentum | |
| 215 | + beatMotionTime = features.beatMotionTime | |
| 216 | + envelopes = features.envelopes; swell = features.swell | |
| 217 | + trebleAttackTime = features.trebleAttackTime | |
| 218 | + treblePulse = features.treblePulse | |
| 219 | + } catch { | |
| 220 | + spectrum = [Float](repeating: 0, count: 32); beatPulse = 0; momentum = 0; beatMotionTime = 0; envelopes = .zero; swell = 0; treblePulse = 0; trebleAttackTime = nil | |
| 221 | + status = String(localized: "Audio analysis failed: \(error.localizedDescription)") | |
| 222 | + } | |
| 223 | + } | |
| 224 | + | |
| 225 | + private func schedule(from start: AVAudioFramePosition, playing: Bool, end: AVAudioFramePosition? = nil) { | |
| 226 | + guard let file else { return } | |
| 227 | + if playing && !startPlaybackEngine() { return } | |
| 228 | + if end == nil { previewSectionStart = nil; previewSectionEnd = nil } | |
| 229 | + generation = UUID(); let token = generation | |
| 230 | + player.stop(); segmentStart = start | |
| 231 | + let remaining = AVAudioFrameCount(min(Int64(UInt32.max), (end ?? file.length) - start)) | |
| 232 | + player.scheduleSegment(file, startingFrame: start, frameCount: remaining, at: nil, completionCallbackType: .dataPlayedBack) { [weak self] _ in | |
| 233 | + Task { @MainActor [weak self] in | |
| 234 | + guard let self, self.generation == token else { return } | |
| 235 | + if let end { | |
| 236 | + guard self.isPlaying else { return } | |
| 237 | + self.schedule(from: start, playing: true, end: end) | |
| 238 | + self.playbackSeconds = Double(start) / file.processingFormat.sampleRate | |
| 239 | + self.progress = self.playbackSeconds / self.duration | |
| 240 | + self.analyze(frame: start) | |
| 241 | + self.status = String(localized: "Playing Studio section · Looping") | |
| 242 | + return | |
| 243 | + } | |
| 244 | + let finished = self.isPlaying ? self.onSoundtrackFinished : nil | |
| 245 | + if self.isPlaying && self.loopEnabled && finished == nil { | |
| 246 | + self.schedule(from: 0, playing: true) | |
| 247 | + self.progress = 0; self.playbackSeconds = 0 | |
| 248 | + self.analyze(frame: 0) | |
| 249 | + self.status = String(localized: "Playing soundtrack · Looping") | |
| 250 | + return | |
| 251 | + } | |
| 252 | + self.isPlaying = false; self.progress = 1; self.playbackSeconds = self.duration | |
| 253 | + self.beatPulse = 0; self.momentum = 0; self.envelopes = .zero; self.swell = 0; self.treblePulse = 0; self.trebleAttackTime = nil; self.spectrum = [Float](repeating: 0, count: 32) | |
| 254 | + self.visualizationUpdated.send() | |
| 255 | + self.status = String(localized: "End of soundtrack") | |
| 256 | + finished?() | |
| 257 | + } | |
| 258 | + } | |
| 259 | + if playing { player.play() } | |
| 260 | + isPlaying = playing | |
| 261 | + } | |
| 262 | + | |
| 263 | + private func updateProgress(fromTimer: Bool = false) { | |
| 264 | + if fromTimer && !visualizationEnabled { | |
| 265 | + let now = ProcessInfo.processInfo.systemUptime | |
| 266 | + guard now - lastBackgroundProgressRefresh >= 1 else { return } | |
| 267 | + lastBackgroundProgressRefresh = now | |
| 268 | + } | |
| 269 | + guard isPlaying, let file, let time = player.lastRenderTime, let position = player.playerTime(forNodeTime: time) else { return } | |
| 270 | + playbackSeconds = min(previewSectionEnd.map { max(0, $0 - 1 / file.processingFormat.sampleRate) } ?? duration, max(0, Double(segmentStart) / file.processingFormat.sampleRate + max(0, Double(position.sampleTime) / file.processingFormat.sampleRate - player.outputPresentationLatency))) | |
| 271 | + progress = duration > 0 ? playbackSeconds / duration : 0 | |
| 272 | + analyze(frame: AVAudioFramePosition(playbackSeconds * file.processingFormat.sampleRate)) | |
| 273 | + } | |
| 274 | + } | |
| 275 | + | |
| 276 | + /// The worker must relinquish this object before the main actor installs it. | |
| 277 | + /// AVAudioFile and its analyzer are never accessed concurrently. | |
| 278 | + final class PreparedSoundtrack: @unchecked Sendable { | |
| 279 | + let url: URL | |
| 280 | + let access: SecurityScopedAccess | |
| 281 | + let file: AVAudioFile | |
| 282 | + let analyzer: SoundtrackAnalyzer | |
| 283 | + fileprivate init(url: URL, access: SecurityScopedAccess, file: AVAudioFile, analyzer: SoundtrackAnalyzer) { | |
| 284 | + self.url = url; self.access = access; self.file = file; self.analyzer = analyzer | |
| 285 | + } | |
| 286 | + init(url: URL) throws { | |
| 287 | + self.url = url | |
| 288 | + access = SecurityScopedAccess(url: url) | |
| 289 | + file = try AVAudioFile(forReading: url) | |
| 290 | + guard file.length > 0 else { throw SoundtrackError.empty } | |
| 291 | + analyzer = try SoundtrackAnalyzer(url: url) | |
| 292 | + } | |
| 293 | + } | |
| 294 | + | |
| 295 | + private enum SoundtrackError: LocalizedError { | |
| 296 | + case empty | |
| 297 | + var errorDescription: String? { String(localized: "This file has no audio samples.") } | |
| 298 | + } |
Sources/PulseCanvas/BundledSoundtrack.swift added
| 1 | + import Foundation | |
| 2 | + | |
| 3 | + enum BundledSoundtrack { | |
| 4 | + static let identifier = "pulsecanvas" | |
| 5 | + | |
| 6 | + static var url: URL? { | |
| 7 | + let candidates = [ | |
| 8 | + Bundle.module.url(forResource: "PulseCanvas", withExtension: "mp3", subdirectory: "NativeAssets/Audio"), | |
| 9 | + Bundle.module.url(forResource: "PulseCanvas", withExtension: "mp3", subdirectory: "Resources/Audio"), | |
| 10 | + URL(fileURLWithPath: FileManager.default.currentDirectoryPath) | |
| 11 | + .appendingPathComponent("Sources/PulseCanvas/Resources/Audio/PulseCanvas.mp3") | |
| 12 | + ] | |
| 13 | + return candidates.compactMap { $0 }.first { FileManager.default.fileExists(atPath: $0.path) } | |
| 14 | + } | |
| 15 | + | |
| 16 | + static func identifier(for soundtrack: URL?) -> String? { | |
| 17 | + guard let soundtrack, let bundled = url, | |
| 18 | + soundtrack.standardizedFileURL == bundled.standardizedFileURL else { return nil } | |
| 19 | + return identifier | |
| 20 | + } | |
| 21 | + | |
| 22 | + /// A bundled track uses a stable project reference, independent of where | |
| 23 | + /// the application is installed on this or another Mac. | |
| 24 | + static func resolve(identifier: String?, externalURL: URL?) throws -> URL? { | |
| 25 | + guard let identifier else { return externalURL } | |
| 26 | + guard identifier == Self.identifier else { throw CocoaError(.fileReadCorruptFile) } | |
| 27 | + guard let url else { throw CocoaError(.fileReadNoSuchFile) } | |
| 28 | + return url | |
| 29 | + } | |
| 30 | + } |
Sources/PulseCanvas/CanvasPreviewLayout.swift added
| 1 | + import Foundation | |
| 2 | + | |
| 3 | + /// Short canvases share their title/footer area with the image instead of | |
| 4 | + /// subtracting fixed chrome that can leave the renderer only a few pixels high. | |
| 5 | + struct CanvasPreviewLayout { | |
| 6 | + let overlaysChrome: Bool | |
| 7 | + let padding: CGFloat | |
| 8 | + let preview: CGRect | |
| 9 | + | |
| 10 | + init(size: CGSize, aspectRatio: Double) { | |
| 11 | + // Reintroduce title space gradually as the window grows, so crossing a | |
| 12 | + // compact-layout threshold does not suddenly shrink the visualization. | |
| 13 | + let chrome = min(1, max(0, (size.height - 280) / 160)) | |
| 14 | + overlaysChrome = chrome < 1 | |
| 15 | + padding = 12 + 10 * chrome | |
| 16 | + let top: CGFloat = 58 * chrome | |
| 17 | + let bottom: CGFloat = 27 * chrome | |
| 18 | + let available = CGRect(x: padding, y: padding + top, | |
| 19 | + width: max(0, size.width - 2 * padding), | |
| 20 | + height: max(0, size.height - 2 * padding - top - bottom)) | |
| 21 | + let ratio = CGFloat(aspectRatio) | |
| 22 | + let width = min(available.width, available.height * ratio) | |
| 23 | + let height = width / ratio | |
| 24 | + preview = CGRect(x: available.midX - width / 2, y: available.midY - height / 2, | |
| 25 | + width: width, height: height) | |
| 26 | + } | |
| 27 | + } |
Sources/PulseCanvas/CloudProjectPackage.swift added
| 1 | + import Foundation | |
| 2 | + | |
| 3 | + struct CloudAudioInfo: Codable, Sendable { | |
| 4 | + var asset: String | |
| 5 | + var name: String | |
| 6 | + var bytes: Int | |
| 7 | + func validated() throws -> Self { | |
| 8 | + guard asset.count == 70, asset.hasSuffix(".audio"), | |
| 9 | + asset.dropLast(6).allSatisfy({ $0.isHexDigit && $0.isASCII }), | |
| 10 | + !name.isEmpty, name.count < 256, !name.contains("/"), name != ".", name != "..", !name.contains("\0"), | |
| 11 | + bytes > 0, bytes <= UserBackup.maximumSourceBytes else { throw CocoaError(.fileReadCorruptFile) } | |
| 12 | + return self | |
| 13 | + } | |
| 14 | + } | |
| 15 | + | |
| 16 | + struct CloudProjectInfo: Codable, Sendable { | |
| 17 | + var title: String | |
| 18 | + var asset: String | |
| 19 | + var bytes: Int | |
| 20 | + var nativeOnly: Bool | |
| 21 | + var audio: CloudAudioInfo? | |
| 22 | + var isAvailableInEdition: Bool { | |
| 23 | + #if DIRECT_BUILD && !STORE_BUILD | |
| 24 | + true | |
| 25 | + #else | |
| 26 | + nativeOnly | |
| 27 | + #endif | |
| 28 | + } | |
| 29 | + func validated() throws -> Self { | |
| 30 | + guard !title.isEmpty, title.count <= 500, asset.count == 69, asset.hasSuffix(".json"), | |
| 31 | + asset.dropLast(5).allSatisfy({ $0.isHexDigit && $0.isASCII }), | |
| 32 | + bytes > 0, bytes < 8_000_000 else { throw CocoaError(.fileReadCorruptFile) } | |
| 33 | + if let audio { _ = try audio.validated() } | |
| 34 | + return self | |
| 35 | + } | |
| 36 | + } | |
| 37 | + | |
| 38 | + enum CloudProjectPackage { | |
| 39 | + static func fingerprint(_ data: Data) throws -> String { | |
| 40 | + var stamp = data | |
| 41 | + if let object = try JSONSerialization.jsonObject(with: data) as? [String: Any], | |
| 42 | + object["bundledSoundtrack"] == nil, let text = object["soundtrack"] as? String, let source = URL(string: text) { | |
| 43 | + let bookmark = (object["soundtrackBookmark"] as? String).flatMap { Data(base64Encoded: $0) } | |
| 44 | + let resolved = SecurityScopedAccess.resolve(bookmark: bookmark, fallback: source) | |
| 45 | + let lease = SecurityScopedAccess(url: resolved) | |
| 46 | + let values = try resolved.resourceValues(forKeys: [.fileSizeKey, .contentModificationDateKey]) | |
| 47 | + stamp.append(Data("\(values.fileSize ?? -1)|\(values.contentModificationDate?.timeIntervalSince1970 ?? 0)".utf8)) | |
| 48 | + withExtendedLifetime(lease) {} | |
| 49 | + } | |
| 50 | + return CloudSyncLedger.digest(stamp) | |
| 51 | + } | |
| 52 | + static func key(for data: Data, filename: String) throws -> String { | |
| 53 | + let object = try JSONSerialization.jsonObject(with: data) as? [String: Any] | |
| 54 | + if let id = object?["cloudProjectID"] as? String, !id.isEmpty, id.count <= 100 { return id } | |
| 55 | + return CloudSyncLedger.digest(Data(filename.utf8)) | |
| 56 | + } | |
| 57 | + static func make(_ data: Data, filename: String, key: String, in workspace: URL) throws -> (info: CloudProjectInfo, project: URL, audio: URL?) { | |
| 58 | + guard data.count < 8_000_000, var object = try JSONSerialization.jsonObject(with: data) as? [String: Any], | |
| 59 | + object["version"] as? Int == 1, object["appearance"] is [String: Any] else { throw CocoaError(.fileReadCorruptFile) } | |
| 60 | + object["cloudProjectID"] = key | |
| 61 | + try FileManager.default.createDirectory(at: workspace, withIntermediateDirectories: true) | |
| 62 | + var audioInfo: CloudAudioInfo?, audioFile: URL? | |
| 63 | + var lease: SecurityScopedAccess? | |
| 64 | + if object["bundledSoundtrack"] == nil, let text = object["soundtrack"] as? String, let source = URL(string: text) { | |
| 65 | + guard source.isFileURL else { throw CocoaError(.fileReadCorruptFile) } | |
| 66 | + let bookmark = (object["soundtrackBookmark"] as? String).flatMap { Data(base64Encoded: $0) } | |
| 67 | + let resolved = SecurityScopedAccess.resolve(bookmark: bookmark, fallback: source) | |
| 68 | + lease = SecurityScopedAccess(url: resolved) | |
| 69 | + let values = try resolved.resourceValues(forKeys: [.isRegularFileKey, .isSymbolicLinkKey, .fileSizeKey]) | |
| 70 | + guard values.isRegularFile == true, values.isSymbolicLink != true, | |
| 71 | + (values.fileSize ?? Int.max) <= UserBackup.maximumSourceBytes else { throw CocoaError(.fileReadCorruptFile) } | |
| 72 | + let staged = workspace.appendingPathComponent(UUID().uuidString) | |
| 73 | + try FileManager.default.copyItem(at: resolved, to: staged) | |
| 74 | + let audioAsset = try hashFile(staged) + ".audio" | |
| 75 | + let destination = workspace.appendingPathComponent(audioAsset) | |
| 76 | + try FileManager.default.moveItem(at: staged, to: destination) | |
| 77 | + audioFile = destination | |
| 78 | + audioInfo = try CloudAudioInfo(asset: audioAsset, name: resolved.lastPathComponent, | |
| 79 | + bytes: destination.resourceValues(forKeys: [.fileSizeKey]).fileSize ?? 0).validated() | |
| 80 | + let portable = URL(fileURLWithPath: "/PulseCanvasCloud/" + source.lastPathComponent) | |
| 81 | + object["soundtrack"] = portable.absoluteString | |
| 82 | + } | |
| 83 | + object = try UserBackup.sanitized(object) as! [String: Any] | |
| 84 | + let projectData = try JSONSerialization.data(withJSONObject: object, options: [.sortedKeys]) | |
| 85 | + let destination = workspace.appendingPathComponent(CloudSyncLedger.digest(projectData) + ".json") | |
| 86 | + try projectData.write(to: destination, options: .atomic) | |
| 87 | + withExtendedLifetime(lease) {} | |
| 88 | + var title = URL(fileURLWithPath: filename).deletingPathExtension().lastPathComponent | |
| 89 | + if title.count > 17, title.prefix(16).allSatisfy(\.isHexDigit), title.dropFirst(16).hasPrefix("-") { title = String(title.dropFirst(17)) } | |
| 90 | + let identities = object["effectIdentities"] as? [String: String] ?? [:] | |
| 91 | + let nativeOnly = !identities.isEmpty && identities.values.allSatisfy { $0.hasPrefix("native:") } | |
| 92 | + return (try CloudProjectInfo(title: String(title.prefix(500)), asset: destination.lastPathComponent, | |
| 93 | + bytes: projectData.count, nativeOnly: nativeOnly, audio: audioInfo).validated(), destination, audioFile) | |
| 94 | + } | |
| 95 | + static func hashFile(_ url: URL) throws -> String { | |
| 96 | + UserBackup.hash(try Data(contentsOf: url, options: .alwaysMapped)) | |
| 97 | + } | |
| 98 | + static func open(_ info: CloudProjectInfo, key: String, project: URL, audio: URL?, destination: URL) throws -> Data { | |
| 99 | + _ = try info.validated() | |
| 100 | + guard try project.resourceValues(forKeys: [.fileSizeKey]).fileSize == info.bytes, | |
| 101 | + try hashFile(project) + ".json" == info.asset, | |
| 102 | + var object = try JSONSerialization.jsonObject(with: Data(contentsOf: project)) as? [String: Any], | |
| 103 | + object["version"] as? Int == 1, object["appearance"] is [String: Any] else { throw CocoaError(.fileReadCorruptFile) } | |
| 104 | + // Check every downloaded asset before writing local files. | |
| 105 | + if let expected = info.audio { | |
| 106 | + guard let audio, try audio.resourceValues(forKeys: [.fileSizeKey]).fileSize == expected.bytes, | |
| 107 | + try hashFile(audio) + ".audio" == expected.asset else { throw CocoaError(.fileReadCorruptFile) } | |
| 108 | + } | |
| 109 | + object = try UserBackup.sanitized(object) as! [String: Any] | |
| 110 | + if let expected = info.audio, let audio { | |
| 111 | + try FileManager.default.createDirectory(at: destination, withIntermediateDirectories: true) | |
| 112 | + let localAudio = destination.appendingPathComponent(expected.name) | |
| 113 | + try FileManager.default.copyItem(at: audio, to: localAudio) | |
| 114 | + object["soundtrack"] = localAudio.absoluteString | |
| 115 | + } | |
| 116 | + object["cloudProjectID"] = key | |
| 117 | + return try JSONSerialization.data(withJSONObject: object, options: [.sortedKeys]) | |
| 118 | + } | |
| 119 | + } |
Sources/PulseCanvas/CloudSyncAppData.swift added
| 1 | + import Foundation | |
| 2 | + | |
| 3 | + /// Only portable user choices cross devices. Volume, playback state, authorization | |
| 4 | + /// bookmarks, support clicks and downloaded public Radio caches stay on each device. | |
| 5 | + @MainActor enum CloudSyncAppData { | |
| 6 | + struct SavedLooks: Codable { var presets: [Int: VisualPreset]; var identities: [Int: String]? } | |
| 7 | + static let visionLooksKey = "PulseCanvas.cloudLooks.v1" | |
| 8 | + private static func normalized(_ saved: SavedLooks, library: ProjectMPresets) -> [Int: VisualPreset] { | |
| 9 | + var result: [Int: VisualPreset] = [:] | |
| 10 | + for scene in saved.presets.keys.sorted() where !library.isRetiredScene(scene, identities: saved.identities) { | |
| 11 | + guard let look = saved.presets[scene], look.isValid, | |
| 12 | + let resolved = try? library.migratedScene(scene, identities: saved.identities), | |
| 13 | + library.availableScenes.contains(resolved), result[resolved] == nil else { continue } | |
| 14 | + result[resolved] = look | |
| 15 | + } | |
| 16 | + return result | |
| 17 | + } | |
| 18 | + static func canDeleteSong(_ change: CloudSyncChange) -> Bool { | |
| 19 | + #if os(visionOS) | |
| 20 | + guard let song = try? JSONDecoder().decode(FavoriteRadioSong.self, from: change.payload) else { return false } | |
| 21 | + return song.sourceURL.absoluteString == "https://radio.pulsecanvas.si/stations.json" | |
| 22 | + #else | |
| 23 | + return true | |
| 24 | + #endif | |
| 25 | + } | |
| 26 | + static func snapshot(defaults: UserDefaults = .standard, library suppliedLibrary: ProjectMPresets? = nil) throws -> (values: [String: Data], scope: Set<String>) { | |
| 27 | + let library = suppliedLibrary ?? .shared | |
| 28 | + var values: [String: Data] = [:], scope = Set<String>() | |
| 29 | + let backup = try FavoritesBackup.read(library.exportFavorites()) | |
| 30 | + for scene in library.availableScenes { | |
| 31 | + let id = library.identity(for: scene) | |
| 32 | + scope.insert("visualFavorite:" + id); scope.insert("look:" + id) | |
| 33 | + } | |
| 34 | + for favorite in backup.favorites { values["visualFavorite:" + favorite.id] = try CloudSyncLedger.encoded(favorite) } | |
| 35 | + #if os(visionOS) | |
| 36 | + if let data = defaults.data(forKey: visionLooksKey), let looks = try? JSONDecoder().decode([String: VisualPreset].self, from: data) { | |
| 37 | + for (id, look) in looks where look.isValid { values["look:" + id] = try CloudSyncLedger.encoded(look) } | |
| 38 | + } | |
| 39 | + #else | |
| 40 | + #if STORE_BUILD | |
| 41 | + let key = "PulseCanvas.metalStudio.v1" | |
| 42 | + #else | |
| 43 | + let key = "PulseCanvas.studio.v1" | |
| 44 | + #endif | |
| 45 | + if let data = defaults.data(forKey: key), let saved = try? JSONDecoder().decode(SavedLooks.self, from: data) { | |
| 46 | + for (scene, look) in normalized(saved, library: library) { | |
| 47 | + values["look:" + library.identity(for: scene)] = try CloudSyncLedger.encoded(look) | |
| 48 | + } | |
| 49 | + } | |
| 50 | + #endif | |
| 51 | + if let data = defaults.data(forKey: "PulseCanvas.radio.favoriteSongs.v1") { | |
| 52 | + let songs = try JSONDecoder().decode([FavoriteRadioSong].self, from: data) | |
| 53 | + for song in songs where song.isValid && song.sourceURL.scheme == "https" && song.catalogURL.scheme == "https" { | |
| 54 | + let portable = FavoriteRadioSong(track: song.track, sourceURL: song.sourceURL, catalogURL: song.catalogURL, | |
| 55 | + stationID: song.stationID, folderBookmark: nil) | |
| 56 | + values["songFavorite:" + song.id] = try CloudSyncLedger.encoded(portable) | |
| 57 | + } | |
| 58 | + } | |
| 59 | + // Songs removed from a successfully refreshed local library are explicit | |
| 60 | + // changes. The caller adds its previous local song IDs to this scope. | |
| 61 | + scope.formUnion(values.keys.filter { $0.hasPrefix("songFavorite:") }) | |
| 62 | + return (values, scope) | |
| 63 | + } | |
| 64 | + | |
| 65 | + static func validate(_ change: CloudSyncChange) throws { | |
| 66 | + _ = try change.validated() | |
| 67 | + guard !change.deleted else { return } | |
| 68 | + switch change.kind { | |
| 69 | + case .visualFavorite: | |
| 70 | + let value = try JSONDecoder().decode(FavoritesBackup.Favorite.self, from: change.payload) | |
| 71 | + guard value.id == change.key, value.appearance?.isValid ?? true, (value.name?.count ?? 0) < 1000 else { throw CocoaError(.fileReadCorruptFile) } | |
| 72 | + case .songFavorite: | |
| 73 | + let value = try JSONDecoder().decode(FavoriteRadioSong.self, from: change.payload) | |
| 74 | + guard value.id == change.key, value.isValid, value.folderBookmark == nil, | |
| 75 | + value.sourceURL.scheme == "https", value.catalogURL.scheme == "https" else { throw CocoaError(.fileReadCorruptFile) } | |
| 76 | + case .look: | |
| 77 | + guard try JSONDecoder().decode(VisualPreset.self, from: change.payload).isValid else { throw CocoaError(.fileReadCorruptFile) } | |
| 78 | + case .project: | |
| 79 | + _ = try JSONDecoder().decode(CloudProjectInfo.self, from: change.payload).validated() | |
| 80 | + } | |
| 81 | + } | |
| 82 | + | |
| 83 | + static func apply(_ changes: [CloudSyncChange], defaults: UserDefaults = .standard, library suppliedLibrary: ProjectMPresets? = nil) throws { | |
| 84 | + let library = suppliedLibrary ?? .shared | |
| 85 | + try changes.forEach(validate) | |
| 86 | + let favorites = try changes.filter { $0.kind == .visualFavorite && !$0.deleted }.map { | |
| 87 | + try JSONDecoder().decode(FavoritesBackup.Favorite.self, from: $0.payload) | |
| 88 | + } | |
| 89 | + library.applyCloudFavorites(favorites, removed: Set(changes.filter { $0.kind == .visualFavorite && $0.deleted }.map(\.key))) | |
| 90 | + var songs = (defaults.data(forKey: "PulseCanvas.radio.favoriteSongs.v1").flatMap { try? JSONDecoder().decode([FavoriteRadioSong].self, from: $0) } ?? []) | |
| 91 | + for change in changes where change.kind == .songFavorite { | |
| 92 | + songs.removeAll { $0.id == change.key } | |
| 93 | + if !change.deleted { songs.append(try JSONDecoder().decode(FavoriteRadioSong.self, from: change.payload)) } | |
| 94 | + } | |
| 95 | + defaults.set(try CloudSyncLedger.encoded(songs.sorted { $0.id < $1.id }), forKey: "PulseCanvas.radio.favoriteSongs.v1") | |
| 96 | + let scenes = Dictionary(uniqueKeysWithValues: library.availableScenes.map { (library.identity(for: $0), $0) }) | |
| 97 | + #if os(visionOS) | |
| 98 | + var looks = defaults.data(forKey: visionLooksKey).flatMap { try? JSONDecoder().decode([String: VisualPreset].self, from: $0) } ?? [:] | |
| 99 | + for change in changes where change.kind == .look && scenes[change.key] != nil { | |
| 100 | + looks[change.key] = change.deleted ? nil : try JSONDecoder().decode(VisualPreset.self, from: change.payload) | |
| 101 | + } | |
| 102 | + defaults.set(try CloudSyncLedger.encoded(looks), forKey: visionLooksKey) | |
| 103 | + #else | |
| 104 | + #if STORE_BUILD | |
| 105 | + let key = "PulseCanvas.metalStudio.v1" | |
| 106 | + #else | |
| 107 | + let key = "PulseCanvas.studio.v1" | |
| 108 | + #endif | |
| 109 | + var saved = defaults.data(forKey: key).flatMap { try? JSONDecoder().decode(SavedLooks.self, from: $0) } ?? SavedLooks(presets: [:]) | |
| 110 | + let normalized = normalized(saved, library: library) | |
| 111 | + if normalized != saved.presets, defaults.data(forKey: key + ".beforeICloud") == nil { | |
| 112 | + defaults.set(defaults.data(forKey: key), forKey: key + ".beforeICloud") | |
| 113 | + } | |
| 114 | + saved.presets = normalized | |
| 115 | + for change in changes where change.kind == .look { | |
| 116 | + guard let scene = scenes[change.key] else { continue } | |
| 117 | + saved.presets[scene] = change.deleted ? nil : try JSONDecoder().decode(VisualPreset.self, from: change.payload) | |
| 118 | + } | |
| 119 | + saved.identities = library.identities(for: Set(saved.presets.keys)) | |
| 120 | + defaults.set(try CloudSyncLedger.encoded(saved), forKey: key) | |
| 121 | + #endif | |
| 122 | + NotificationCenter.default.post(name: .pulseCanvasCloudDataApplied, object: nil) | |
| 123 | + } | |
| 124 | + } |
Sources/PulseCanvas/CloudSyncLedger.swift added
| 1 | + import CryptoKit | |
| 2 | + import Foundation | |
| 3 | + | |
| 4 | + /// Immutable change files avoid two offline devices overwriting the same cloud file. | |
| 5 | + /// An explicit tombstone is required to remove an item; an incomplete download is | |
| 6 | + /// never interpreted as an empty library. | |
| 7 | + struct CloudSyncChange: Codable, Equatable, Sendable { | |
| 8 | + enum Kind: String, Codable, Sendable { case visualFavorite, songFavorite, look, project } | |
| 9 | + var schema = 1 | |
| 10 | + var event = UUID().uuidString | |
| 11 | + var device: String | |
| 12 | + var sequence: UInt64 | |
| 13 | + var kind: Kind | |
| 14 | + var key: String | |
| 15 | + var parent: String? | |
| 16 | + var deleted: Bool | |
| 17 | + var payload: Data | |
| 18 | + var identity: String { kind.rawValue + ":" + key } | |
| 19 | + var order: String { String(format: "%020llu", sequence) + device + event } | |
| 20 | + | |
| 21 | + func validated() throws -> Self { | |
| 22 | + guard schema == 1, UUID(uuidString: event) != nil, UUID(uuidString: device) != nil, | |
| 23 | + sequence > 0, sequence < UInt64.max - 1, !key.isEmpty, key.utf8.count <= 2048, | |
| 24 | + parent.map({ UUID(uuidString: $0) != nil && $0 != event }) ?? true, | |
| 25 | + payload.count <= 2_000_000, !deleted || payload.isEmpty else { throw CocoaError(.fileReadCorruptFile) } | |
| 26 | + return self | |
| 27 | + } | |
| 28 | + } | |
| 29 | + | |
| 30 | + struct CloudSyncLedger: Codable, Sendable { | |
| 31 | + var schema = 1 | |
| 32 | + var device = UUID().uuidString | |
| 33 | + var sequence: UInt64 = 0 | |
| 34 | + var events: [String: CloudSyncChange] = [:] | |
| 35 | + var heads: [String: String] = [:] | |
| 36 | + var baseline: [String: Data] = [:] | |
| 37 | + var pending: Set<String> = [] | |
| 38 | + | |
| 39 | + var current: [CloudSyncChange] { heads.values.compactMap { events[$0] } } | |
| 40 | + static func digest(_ data: Data) -> String { SHA256.hash(data: data).map { String(format: "%02x", $0) }.joined() } | |
| 41 | + static func encoded<T: Encodable>(_ value: T) throws -> Data { | |
| 42 | + let encoder = JSONEncoder(); encoder.outputFormatting = [.sortedKeys] | |
| 43 | + return try encoder.encode(value) | |
| 44 | + } | |
| 45 | + static func read(_ data: Data) throws -> Self { | |
| 46 | + guard data.count < 100_000_000 else { throw CocoaError(.fileReadCorruptFile) } | |
| 47 | + let ledger = try JSONDecoder().decode(Self.self, from: data) | |
| 48 | + guard ledger.schema == 1, UUID(uuidString: ledger.device) != nil, | |
| 49 | + ledger.events.allSatisfy({ $0.key == $0.value.event && (try? $0.value.validated()) != nil }), | |
| 50 | + ledger.heads.allSatisfy({ ledger.events[$0.value]?.identity == $0.key }), | |
| 51 | + ledger.pending.isSubset(of: Set(ledger.events.keys)) else { throw CocoaError(.fileReadCorruptFile) } | |
| 52 | + return ledger | |
| 53 | + } | |
| 54 | + | |
| 55 | + @discardableResult | |
| 56 | + mutating func edit(_ kind: CloudSyncChange.Kind, key: String, payload: Data?) throws -> CloudSyncChange? { | |
| 57 | + let identity = kind.rawValue + ":" + key | |
| 58 | + let previous = heads[identity].flatMap { events[$0] } | |
| 59 | + if let previous, previous.deleted == (payload == nil), previous.payload == (payload ?? Data()) { return nil } | |
| 60 | + guard sequence < UInt64.max - 2 else { throw CocoaError(.fileWriteUnknown) } | |
| 61 | + sequence += 1 | |
| 62 | + let change = try CloudSyncChange(device: device, sequence: sequence, kind: kind, key: key, | |
| 63 | + parent: previous?.event, deleted: payload == nil, payload: payload ?? Data()).validated() | |
| 64 | + events[change.event] = change; heads[identity] = change.event; pending.insert(change.event) | |
| 65 | + return change | |
| 66 | + } | |
| 67 | + | |
| 68 | + /// A saved file is based on the revision last opened on this device, which | |
| 69 | + /// can differ from a newer cloud head discovered while it was being edited. | |
| 70 | + mutating func editProject(key: String, payload: Data, basedOn parent: String?) throws -> CloudSyncChange? { | |
| 71 | + let identity = CloudSyncChange.Kind.project.rawValue + ":" + key | |
| 72 | + if let head = heads[identity].flatMap({ events[$0] }), !head.deleted, head.payload == payload { return nil } | |
| 73 | + guard sequence < UInt64.max - 2 else { throw CocoaError(.fileWriteUnknown) } | |
| 74 | + let change = try CloudSyncChange(device: device, sequence: sequence + 1, kind: .project, | |
| 75 | + key: key, parent: parent, deleted: false, payload: payload).validated() | |
| 76 | + try merge([change]) | |
| 77 | + pending.insert(change.event) | |
| 78 | + return change | |
| 79 | + } | |
| 80 | + | |
| 81 | + /// Only identities present in the previous *local* snapshot can be removed. | |
| 82 | + /// Scope excludes designs unavailable in this edition, so a Metal device can't | |
| 83 | + /// delete a Creators-only favorite from another device. | |
| 84 | + mutating func observe(_ snapshot: [String: Data], scope: Set<String>) throws { | |
| 85 | + for identity in snapshot.keys.sorted() { | |
| 86 | + guard let pair = Self.split(identity), let payload = snapshot[identity] else { continue } | |
| 87 | + if baseline[identity] != payload { _ = try edit(pair.0, key: pair.1, payload: payload) } | |
| 88 | + } | |
| 89 | + for identity in baseline.keys.sorted() where snapshot[identity] == nil && scope.contains(identity) { | |
| 90 | + if let pair = Self.split(identity) { _ = try edit(pair.0, key: pair.1, payload: nil) } | |
| 91 | + } | |
| 92 | + baseline = snapshot | |
| 93 | + } | |
| 94 | + static func split(_ identity: String) -> (CloudSyncChange.Kind, String)? { | |
| 95 | + guard let separator = identity.firstIndex(of: ":"), let kind = CloudSyncChange.Kind(rawValue: String(identity[..<separator])) else { return nil } | |
| 96 | + return (kind, String(identity[identity.index(after: separator)...])) | |
| 97 | + } | |
| 98 | + func isAncestor(_ event: String, of descendant: CloudSyncChange) -> Bool { | |
| 99 | + var parent = descendant.parent, seen = Set<String>() | |
| 100 | + while let value = parent, seen.insert(value).inserted { | |
| 101 | + if value == event { return true } | |
| 102 | + parent = events[value]?.parent | |
| 103 | + } | |
| 104 | + return false | |
| 105 | + } | |
| 106 | + /// iCloud can download a child before its parent. Wait for the causal chain | |
| 107 | + /// before comparing projects so a delayed ancestor isn't called a conflict. | |
| 108 | + func readyChanges(_ incoming: [CloudSyncChange]) -> [CloudSyncChange] { | |
| 109 | + var known = Set(events.keys), ready: [CloudSyncChange] = [] | |
| 110 | + var waiting = incoming | |
| 111 | + while !waiting.isEmpty { | |
| 112 | + let next = waiting.filter { $0.parent == nil || known.contains($0.parent!) } | |
| 113 | + guard !next.isEmpty else { break } | |
| 114 | + ready.append(contentsOf: next); known.formUnion(next.map(\.event)) | |
| 115 | + let processed = Set(next.map(\.event)) | |
| 116 | + waiting.removeAll { processed.contains($0.event) } | |
| 117 | + } | |
| 118 | + return ready | |
| 119 | + } | |
| 120 | + mutating func merge(_ incoming: [CloudSyncChange]) throws { | |
| 121 | + // Validate the whole batch before mutating anything. | |
| 122 | + let validated = try incoming.map { try $0.validated() }.sorted { $0.order < $1.order } | |
| 123 | + var batch: [String: CloudSyncChange] = [:] | |
| 124 | + for change in validated { | |
| 125 | + if let duplicate = batch[change.event], duplicate != change { throw CocoaError(.fileReadCorruptFile) } | |
| 126 | + batch[change.event] = change | |
| 127 | + if let existing = events[change.event] { | |
| 128 | + guard existing == change else { throw CocoaError(.fileReadCorruptFile) } | |
| 129 | + } | |
| 130 | + } | |
| 131 | + for change in validated { | |
| 132 | + if let parent = change.parent.flatMap({ batch[$0] ?? events[$0] }) { | |
| 133 | + guard parent.identity == change.identity, parent.sequence < change.sequence else { throw CocoaError(.fileReadCorruptFile) } | |
| 134 | + } | |
| 135 | + } | |
| 136 | + for change in validated where events[change.event] == nil { | |
| 137 | + events[change.event] = change; sequence = max(sequence, change.sequence) | |
| 138 | + } | |
| 139 | + for change in validated { | |
| 140 | + let previous = heads[change.identity].flatMap { events[$0] } | |
| 141 | + guard let previous else { heads[change.identity] = change.event; continue } | |
| 142 | + guard previous.event != change.event else { continue } | |
| 143 | + let newer = isAncestor(previous.event, of: change) | |
| 144 | + let older = isAncestor(change.event, of: previous) | |
| 145 | + if change.kind == .project, !newer, !older, !previous.deleted, !change.deleted, previous.payload != change.payload { | |
| 146 | + // Preserve a concurrent project revision as a separate visible copy. | |
| 147 | + let loser = previous.order < change.order ? previous : change | |
| 148 | + let forkKey = "conflict-" + Self.digest(Data((loser.key + loser.event).utf8)) | |
| 149 | + let forkIdentity = CloudSyncChange.Kind.project.rawValue + ":" + forkKey | |
| 150 | + var fork = loser | |
| 151 | + let hex = Array(Self.digest(Data(("fork-" + loser.event).utf8)).prefix(32)) | |
| 152 | + let pieces = [0..<8, 8..<12, 12..<16, 16..<20, 20..<32].map { String(hex[$0]) } | |
| 153 | + fork.event = pieces.joined(separator: "-"); fork.key = forkKey; fork.parent = nil | |
| 154 | + events[fork.event] = fork; heads[forkIdentity] = fork.event; pending.insert(fork.event) | |
| 155 | + } | |
| 156 | + if newer || (!older && previous.order < change.order) { heads[change.identity] = change.event } | |
| 157 | + } | |
| 158 | + } | |
| 159 | + } |
Sources/PulseCanvas/CloudSyncView.swift added
| 1 | + import SwiftUI | |
| 2 | + | |
| 3 | + struct CloudSyncView: View { | |
| 4 | + @ObservedObject private var cloud = CloudSyncService.shared | |
| 5 | + var prepare: () -> Void = {} | |
| 6 | + var openProject: ((Data) -> Void)? = nil | |
| 7 | + @State private var confirmEnable = false | |
| 8 | + @State private var removing: CloudSyncChange? | |
| 9 | + @State private var message: String? | |
| 10 | + var body: some View { | |
| 11 | + VStack(alignment: .leading, spacing: 12) { | |
| 12 | + Toggle("Sync with iCloud", isOn: Binding(get: { cloud.enabled }, set: { value in | |
| 13 | + if value { confirmEnable = true } else { cloud.setEnabled(false) } | |
| 14 | + })).accessibilityIdentifier("iCloudSyncToggle") | |
| 15 | + Text("Keep visualizer favorites, song favorites, saved looks and saved projects available on your Mac, iPhone, iPad and Apple Vision Pro using the same Apple Account.") | |
| 16 | + .font(.callout).foregroundStyle(.secondary) | |
| 17 | + Text("Saved projects include their soundtracks and use your iCloud storage. Each device shows the projects and visualizers it can open. Personal Radio albums, playback and volume stay on each device.") | |
| 18 | + .font(.caption).foregroundStyle(.secondary) | |
| 19 | + HStack { | |
| 20 | + Button("Sync now", systemImage: "arrow.triangle.2.circlepath") { cloud.syncNow() } | |
| 21 | + .disabled(!cloud.enabled || cloud.busy).accessibilityIdentifier("iCloudSyncNow") | |
| 22 | + if cloud.busy { ProgressView().controlSize(.small) } | |
| 23 | + } | |
| 24 | + Text(message ?? cloud.status).font(.callout).textSelection(.enabled).accessibilityIdentifier("iCloudSyncStatus") | |
| 25 | + if let date = cloud.lastSync { Text("Last checked \(date.formatted(date: .abbreviated, time: .shortened))").font(.caption).foregroundStyle(.secondary) } | |
| 26 | + if cloud.enabled { | |
| 27 | + DisclosureGroup("iCloud projects (\(cloud.projects.count))") { | |
| 28 | + if cloud.projects.isEmpty { Text("Save a project to add it to iCloud. Projects download when you open them.").font(.caption).foregroundStyle(.secondary) } | |
| 29 | + ForEach(cloud.projects, id: \.event) { change in | |
| 30 | + if let info = try? JSONDecoder().decode(CloudProjectInfo.self, from: change.payload) { | |
| 31 | + HStack { | |
| 32 | + VStack(alignment: .leading) { | |
| 33 | + Text(info.title).lineLimit(2) | |
| 34 | + if change.key.hasPrefix("conflict-") { Text("Conflict copy — both edits were kept").font(.caption).foregroundStyle(.secondary) } | |
| 35 | + } | |
| 36 | + Spacer() | |
| 37 | + if let openProject { | |
| 38 | + Button("Open") { | |
| 39 | + prepare(); message = nil | |
| 40 | + Task { | |
| 41 | + do { openProject(try await cloud.openProject(change)) } | |
| 42 | + catch { message = String(localized: "Couldn't open the project yet. \(cloud.status)") } | |
| 43 | + } | |
| 44 | + }.disabled(cloud.busy) | |
| 45 | + } | |
| 46 | + Button { removing = change } label: { Image(systemName: "trash") } | |
| 47 | + .accessibilityLabel("Remove \(info.title) from iCloud") | |
| 48 | + }.padding(.vertical, 6) | |
| 49 | + } | |
| 50 | + } | |
| 51 | + } | |
| 52 | + } | |
| 53 | + }.task { cloud.start() } | |
| 54 | + .alert("Enable iCloud sync?", isPresented: $confirmEnable) { | |
| 55 | + Button("Cancel", role: .cancel) {} | |
| 56 | + Button("Enable iCloud") { cloud.setEnabled(true) } | |
| 57 | + } message: { | |
| 58 | + Text("Merge this device’s favorites and saved looks with your Apple Account, and upload saved projects with their music. Changes sync to your other PulseCanvas devices. Turning sync off keeps local data and existing iCloud copies.") | |
| 59 | + } | |
| 60 | + .alert("Remove this project from iCloud?", isPresented: Binding(get: { removing != nil }, set: { if !$0 { removing = nil } })) { | |
| 61 | + Button("Cancel", role: .cancel) { removing = nil } | |
| 62 | + Button("Remove from iCloud", role: .destructive) { | |
| 63 | + if let removing { cloud.removeProject(removing) } | |
| 64 | + removing = nil | |
| 65 | + } | |
| 66 | + } message: { Text("This removes it from the synced project list on all devices. Existing local project and audio files are kept.") } | |
| 67 | + } | |
| 68 | + } |
Sources/PulseCanvas/ExportOverlayView.swift added
| 1 | + import AppKit | |
| 2 | + import SwiftUI | |
| 3 | + | |
| 4 | + @MainActor | |
| 5 | + struct ExportOverlayView: View { | |
| 6 | + @ObservedObject var exporter: SocialExportController | |
| 7 | + @State private var showSuccess = false | |
| 8 | + private let accent = Color(red: 0.95, green: 0.68, blue: 0.55) | |
| 9 | + | |
| 10 | + var body: some View { | |
| 11 | + ZStack { | |
| 12 | + if exporter.isExporting { | |
| 13 | + Color.black.opacity(0.82) | |
| 14 | + VStack(spacing: 22) { | |
| 15 | + Text("Creating your video").font(.system(size: 26, weight: .semibold, design: .rounded)) | |
| 16 | + if let preview = exporter.framePreview { | |
| 17 | + Image(decorative: preview, scale: 1).resizable().scaledToFit() | |
| 18 | + .frame(maxHeight: 240).clipShape(RoundedRectangle(cornerRadius: 10)) | |
| 19 | + .accessibilityLabel("Current rendered frame") | |
| 20 | + } else { | |
| 21 | + ProgressView().controlSize(.large).frame(height: 120) | |
| 22 | + } | |
| 23 | + Text(exporter.status).font(.system(size: 17, weight: .medium)).monospacedDigit() | |
| 24 | + ProgressView(value: exporter.progress).progressViewStyle(.linear).tint(accent) | |
| 25 | + .scaleEffect(x: 1, y: 2).accessibilityLabel("Video export progress") | |
| 26 | + HStack { | |
| 27 | + if exporter.totalFrames > 0 { | |
| 28 | + Text("\(exporter.renderedFrames.formatted()) / \(exporter.totalFrames.formatted()) frames") | |
| 29 | + } | |
| 30 | + Spacer() | |
| 31 | + Text("\(Int(exporter.progress * 100))%").monospacedDigit() | |
| 32 | + }.font(.system(size: 13)).foregroundStyle(.secondary) | |
| 33 | + if let remaining = exporter.estimatedSecondsRemaining { | |
| 34 | + Text("About \(remainingTime(remaining)) remaining · \(exporter.framesPerSecond.formatted(.number.precision(.fractionLength(1)))) frames/s") | |
| 35 | + .font(.system(size: 14, weight: .medium)).monospacedDigit().foregroundStyle(accent) | |
| 36 | + } else if exporter.renderedFrames < exporter.totalFrames { | |
| 37 | + Text("Estimating time remaining…").font(.system(size: 14)).foregroundStyle(.secondary) | |
| 38 | + } | |
| 39 | + Button("Cancel export") { exporter.cancel() } | |
| 40 | + .buttonStyle(StudioButtonStyle(compact: true)) | |
| 41 | + .disabled(exporter.cancellationRequested) | |
| 42 | + }.padding(.horizontal, 60).padding(.vertical, 32) | |
| 43 | + } else if showSuccess, let url = exporter.exportedURL { | |
| 44 | + VStack(spacing: 14) { | |
| 45 | + Image(systemName: "checkmark.circle.fill").font(.system(size: 36)).foregroundStyle(.green) | |
| 46 | + Text("Video saved").font(.system(size: 20, weight: .semibold, design: .rounded)) | |
| 47 | + Text(url.lastPathComponent).font(.system(size: 12)).foregroundStyle(.secondary).lineLimit(2) | |
| 48 | + Button { NSWorkspace.shared.activateFileViewerSelecting([url]) } label: { | |
| 49 | + Label("Show in Finder", systemImage: "folder") | |
| 50 | + }.buttonStyle(StudioButtonStyle(treatment: .primary, compact: true)) | |
| 51 | + }.padding(28).frame(width: 370) | |
| 52 | + .background(Color(red: 0.20, green: 0.17, blue: 0.22), in: RoundedRectangle(cornerRadius: 18)) | |
| 53 | + .overlay(RoundedRectangle(cornerRadius: 18).strokeBorder(.white.opacity(0.15))) | |
| 54 | + .overlay(alignment: .topTrailing) { | |
| 55 | + Button { withAnimation { showSuccess = false } } label: { | |
| 56 | + Image(systemName: "xmark").frame(width: 44, height: 44) | |
| 57 | + }.buttonStyle(.plain).accessibilityLabel("Dismiss export success") | |
| 58 | + } | |
| 59 | + .shadow(color: .black.opacity(0.4), radius: 24, y: 8) | |
| 60 | + .transition(.opacity.combined(with: .scale(scale: 0.96))) | |
| 61 | + } | |
| 62 | + }.frame(maxWidth: .infinity, maxHeight: .infinity) | |
| 63 | + .onChange(of: exporter.exportedURL) { _, url in withAnimation { showSuccess = url != nil } } | |
| 64 | + .task(id: exporter.exportedURL) { | |
| 65 | + guard exporter.exportedURL != nil else { return } | |
| 66 | + do { try await Task.sleep(for: .seconds(10)) } catch { return } | |
| 67 | + withAnimation { showSuccess = false } | |
| 68 | + } | |
| 69 | + } | |
| 70 | + private func remainingTime(_ seconds: Double) -> String { | |
| 71 | + let rounded = max(1, Int(ceil(seconds))) | |
| 72 | + if rounded >= 3600 { return "\(rounded / 3600)h \((rounded % 3600) / 60)m" } | |
| 73 | + if rounded >= 60 { return "\(rounded / 60)m \(rounded % 60)s" } | |
| 74 | + return "\(rounded)s" | |
| 75 | + } | |
| 76 | + | |
| 77 | + } |
Sources/PulseCanvas/ProjectMEngine.swift added
| 1 | + #if !STORE_BUILD | |
| 2 | + import Foundation | |
| 3 | + import Darwin | |
| 4 | + import OpenGL | |
| 5 | + import OpenGL.GL3 | |
| 6 | + import IOSurface | |
| 7 | + import CoreVideo | |
| 8 | + @preconcurrency import Metal | |
| 9 | + | |
| 10 | + private final class ProjectMAPI { | |
| 11 | + typealias Handle = UnsafeMutableRawPointer | |
| 12 | + let library: UnsafeMutableRawPointer | |
| 13 | + let create: @convention(c) () -> Handle? | |
| 14 | + let destroy: @convention(c) (Handle) -> Void | |
| 15 | + let load: @convention(c) (Handle, UnsafePointer<CChar>, Bool) -> Void | |
| 16 | + let loadData: @convention(c) (Handle, UnsafePointer<CChar>, Bool) -> Void | |
| 17 | + let size: @convention(c) (Handle, Int, Int) -> Void | |
| 18 | + let frameTime: @convention(c) (Handle, Double) -> Void | |
| 19 | + let fps: @convention(c) (Handle, Int32) -> Void | |
| 20 | + let lock: @convention(c) (Handle, Bool) -> Void | |
| 21 | + let clean: @convention(c) (Handle, Bool) -> Void | |
| 22 | + let pcm: @convention(c) (Handle, UnsafePointer<Float>, UInt32, Int32) -> Void | |
| 23 | + let render: @convention(c) (Handle, UInt32) -> Void | |
| 24 | + let texturePaths: @convention(c) (Handle, UnsafePointer<UnsafePointer<CChar>?>, Int) -> Void | |
| 25 | + typealias Failure = @convention(c) (UnsafePointer<CChar>?, UnsafePointer<CChar>?, UnsafeMutableRawPointer?) -> Void | |
| 26 | + let failure: @convention(c) (Handle, Failure?, UnsafeMutableRawPointer?) -> Void | |
| 27 | + | |
| 28 | + init() throws { | |
| 29 | + let candidates = [Bundle.main.privateFrameworksURL?.appendingPathComponent("libprojectM.dylib"), | |
| 30 | + URL(fileURLWithPath: FileManager.default.currentDirectoryPath).appendingPathComponent(".build/projectm/install/lib/libprojectM-4.4.2.0.dylib")] | |
| 31 | + guard let path = candidates.compactMap({$0}).first(where: {FileManager.default.fileExists(atPath: $0.path)}), | |
| 32 | + let library = dlopen(path.path, RTLD_NOW | RTLD_LOCAL) else { throw ProjectMError("ProjectM engine is missing. Build with scripts/build-projectm.sh.") } | |
| 33 | + self.library = library | |
| 34 | + func symbol<T>(_ name: String, _ type: T.Type) throws -> T { | |
| 35 | + guard let address = dlsym(library, name) else { throw ProjectMError("ProjectM API is missing \(name)") } | |
| 36 | + return unsafeBitCast(address, to: type) | |
| 37 | + } | |
| 38 | + create = try symbol("projectm_create", (@convention(c) () -> Handle?).self) | |
| 39 | + destroy = try symbol("projectm_destroy", (@convention(c) (Handle) -> Void).self) | |
| 40 | + load = try symbol("projectm_load_preset_file", (@convention(c) (Handle, UnsafePointer<CChar>, Bool) -> Void).self) | |
| 41 | + loadData = try symbol("projectm_load_preset_data", (@convention(c) (Handle, UnsafePointer<CChar>, Bool) -> Void).self) | |
| 42 | + size = try symbol("projectm_set_window_size", (@convention(c) (Handle, Int, Int) -> Void).self) | |
| 43 | + frameTime = try symbol("projectm_set_frame_time", (@convention(c) (Handle, Double) -> Void).self) | |
| 44 | + fps = try symbol("projectm_set_fps", (@convention(c) (Handle, Int32) -> Void).self) | |
| 45 | + lock = try symbol("projectm_set_preset_locked", (@convention(c) (Handle, Bool) -> Void).self) | |
| 46 | + clean = try symbol("projectm_set_preset_start_clean", (@convention(c) (Handle, Bool) -> Void).self) | |
| 47 | + pcm = try symbol("projectm_pcm_add_float", (@convention(c) (Handle, UnsafePointer<Float>, UInt32, Int32) -> Void).self) | |
| 48 | + render = try symbol("projectm_opengl_render_frame_fbo", (@convention(c) (Handle, UInt32) -> Void).self) | |
| 49 | + texturePaths = try symbol("projectm_set_texture_search_paths", (@convention(c) (Handle, UnsafePointer<UnsafePointer<CChar>?>, Int) -> Void).self) | |
| 50 | + failure = try symbol("projectm_set_preset_switch_failed_event_callback", (@convention(c) (Handle, Failure?, UnsafeMutableRawPointer?) -> Void).self) | |
| 51 | + } | |
| 52 | + // Retain the loaded library for process lifetime: upstream caches GL entry points. | |
| 53 | + } | |
| 54 | + | |
| 55 | + /// A separate OpenGL context hosts the unmodified ProjectM engine. IOSurface | |
| 56 | + /// shares its frames with Metal; no glReadPixels or CPU image copies are used. | |
| 57 | + final class ProjectMEngine { | |
| 58 | + private let api: ProjectMAPI | |
| 59 | + private let context: CGLContextObj | |
| 60 | + private var instance: ProjectMAPI.Handle? | |
| 61 | + private var surface: IOSurfaceRef? | |
| 62 | + private var metalTexture: MTLTexture? | |
| 63 | + private var glTexture: GLuint = 0 | |
| 64 | + private var framebuffer: GLuint = 0 | |
| 65 | + private var activePath: String? | |
| 66 | + private var previousTime: Double? | |
| 67 | + private var previousSourceTime: Double? | |
| 68 | + private var loadError: String? | |
| 69 | + private var timeOrigin: Double = 0 | |
| 70 | + private var previousChaos: Float? | |
| 71 | + | |
| 72 | + init() throws { | |
| 73 | + api = try ProjectMAPI() | |
| 74 | + var format: CGLPixelFormatObj?, count: GLint = 0 | |
| 75 | + var attributes: [CGLPixelFormatAttribute] = [kCGLPFAOpenGLProfile, CGLPixelFormatAttribute(rawValue: UInt32(kCGLOGLPVersion_3_2_Core.rawValue)), kCGLPFAAccelerated, CGLPixelFormatAttribute(rawValue: 0)] | |
| 76 | + guard CGLChoosePixelFormat(&attributes, &format, &count) == kCGLNoError, let format else { throw ProjectMError("OpenGL acceleration is unavailable") } | |
| 77 | + defer { CGLDestroyPixelFormat(format) } | |
| 78 | + var created: CGLContextObj? | |
| 79 | + guard CGLCreateContext(format, nil, &created) == kCGLNoError, let created else { throw ProjectMError("Cannot create ProjectM graphics context") } | |
| 80 | + context = created | |
| 81 | + } | |
| 82 | + deinit { | |
| 83 | + let old = CGLGetCurrentContext(); CGLSetCurrentContext(context) | |
| 84 | + if let instance { api.destroy(instance) } | |
| 85 | + glDeleteFramebuffers(1, &framebuffer); glDeleteTextures(1, &glTexture) | |
| 86 | + CGLSetCurrentContext(old); CGLDestroyContext(context) | |
| 87 | + } | |
| 88 | + | |
| 89 | + func frame(preset: URL, texturePaths: [URL], device: MTLDevice, width: Int, height: Int, | |
| 90 | + time: Double, sourceTime: Double, pcm: [Float], chaos: Float, fps: Int = 60) throws -> MTLTexture { | |
| 91 | + let old = CGLGetCurrentContext(); CGLSetCurrentContext(context) | |
| 92 | + defer { CGLSetCurrentContext(old) } | |
| 93 | + // Presets own frame counters, feedback and audio filter history. A new | |
| 94 | + // local clock must start with a new instance; rewinding a retained | |
| 95 | + // instance makes its delta/progress negative and can corrupt beat values. | |
| 96 | + let reset = instance == nil || activePath != preset.path || (previousTime.map {time < $0 - 0.001} ?? false) || (chaos == 0 && (previousChaos ?? 0) > 0) | |
| 97 | + if reset { | |
| 98 | + if let instance { api.destroy(instance) } | |
| 99 | + instance = nil | |
| 100 | + guard let created = api.create() else { throw ProjectMError("Cannot start ProjectM") } | |
| 101 | + instance = created; activePath = nil | |
| 102 | + api.failure(created, { _, message, user in | |
| 103 | + guard let user else { return } | |
| 104 | + let engine = Unmanaged<ProjectMEngine>.fromOpaque(user).takeUnretainedValue() | |
| 105 | + engine.loadError = message.map {String(cString: $0)} ?? "Preset could not load" | |
| 106 | + }, Unmanaged.passUnretained(self).toOpaque()) | |
| 107 | + api.frameTime(created, 0); api.fps(created, Int32(fps)); api.lock(created, true); api.clean(created, true) | |
| 108 | + } | |
| 109 | + if activePath != preset.path, let instance { | |
| 110 | + timeOrigin = time; activePath = preset.path; loadError = nil; previousTime = nil; previousSourceTime = nil | |
| 111 | + let strings = texturePaths.map {strdup($0.path)} | |
| 112 | + defer { strings.forEach {free($0)} } | |
| 113 | + let pointers = strings.map { $0.map {UnsafePointer<CChar>($0)} } | |
| 114 | + pointers.withUnsafeBufferPointer { api.texturePaths(instance, $0.baseAddress!, $0.count) } | |
| 115 | + api.size(instance, width, height) | |
| 116 | + api.frameTime(instance, 0) | |
| 117 | + preset.path.withCString {api.load(instance, $0, false)} | |
| 118 | + if loadError != nil, let repaired = try MilkdropCompatibility.normalizedData(at: preset) { | |
| 119 | + loadError = nil | |
| 120 | + repaired.withCString {api.loadData(instance, $0, false)} | |
| 121 | + } | |
| 122 | + } | |
| 123 | + if let loadError { throw ProjectMError("\(preset.lastPathComponent): \(loadError)") } | |
| 124 | + guard let instance else { throw ProjectMError("ProjectM did not initialize") } | |
| 125 | + let resized = metalTexture?.width != width || metalTexture?.height != height | |
| 126 | + if resized { | |
| 127 | + glDeleteFramebuffers(1, &framebuffer); glDeleteTextures(1, &glTexture) | |
| 128 | + // Window drawable widths are arbitrary. Metal requires aligned row | |
| 129 | + // strides even when the visible pixel width is not aligned. | |
| 130 | + let rowBytes = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, ((width * 4 + 255) / 256) * 256) | |
| 131 | + let allocationSize = IOSurfaceAlignProperty(kIOSurfaceAllocSize, rowBytes * height) | |
| 132 | + guard let surface = IOSurfaceCreate([kIOSurfaceWidth: width, kIOSurfaceHeight: height, kIOSurfaceBytesPerElement: 4, kIOSurfaceBytesPerRow: rowBytes, kIOSurfaceAllocSize: allocationSize, kIOSurfacePixelFormat: kCVPixelFormatType_32BGRA] as CFDictionary) else { throw ProjectMError("Cannot allocate ProjectM surface") } | |
| 133 | + let descriptor = MTLTextureDescriptor.texture2DDescriptor(pixelFormat: .bgra8Unorm, width: width, height: height, mipmapped: false) | |
| 134 | + descriptor.storageMode = .shared; descriptor.usage = [.shaderRead] | |
| 135 | + guard let texture = device.makeTexture(descriptor: descriptor, iosurface: surface, plane: 0) else { throw ProjectMError("Cannot share ProjectM surface with Metal") } | |
| 136 | + self.surface = surface; metalTexture = texture | |
| 137 | + glGenTextures(1, &glTexture); glBindTexture(GLenum(GL_TEXTURE_RECTANGLE), glTexture) | |
| 138 | + guard CGLTexImageIOSurface2D(context, GLenum(GL_TEXTURE_RECTANGLE), GLenum(GL_RGBA), GLsizei(width), GLsizei(height), GLenum(GL_BGRA), GLenum(GL_UNSIGNED_INT_8_8_8_8_REV), surface, 0) == kCGLNoError else { throw ProjectMError("Cannot share ProjectM surface with OpenGL") } | |
| 139 | + glGenFramebuffers(1, &framebuffer); glBindFramebuffer(GLenum(GL_FRAMEBUFFER), framebuffer) | |
| 140 | + glFramebufferTexture2D(GLenum(GL_FRAMEBUFFER), GLenum(GL_COLOR_ATTACHMENT0), GLenum(GL_TEXTURE_RECTANGLE), glTexture, 0) | |
| 141 | + guard glCheckFramebufferStatus(GLenum(GL_FRAMEBUFFER)) == GLenum(GL_FRAMEBUFFER_COMPLETE) else { throw ProjectMError("ProjectM framebuffer is incomplete") } | |
| 142 | + } | |
| 143 | + if !resized, previousTime == time, previousChaos == chaos, let metalTexture { return metalTexture } | |
| 144 | + api.size(instance, width, height); api.fps(instance, Int32(fps)) | |
| 145 | + api.frameTime(instance, max(0, time - timeOrigin)) | |
| 146 | + if previousSourceTime != sourceTime || previousChaos != chaos { | |
| 147 | + let samples = pcm.isEmpty ? [Float](repeating: 0, count: 1024) : pcm.map { min(1, max(-1, $0 * chaos)) } | |
| 148 | + samples.withUnsafeBufferPointer {api.pcm(instance, $0.baseAddress!, UInt32($0.count / (pcm.isEmpty ? 1 : 2)), pcm.isEmpty ? 1 : 2)} | |
| 149 | + } | |
| 150 | + api.render(instance, framebuffer) | |
| 151 | + // Complete OpenGL writes before the Metal compositor samples this IOSurface. | |
| 152 | + glFinish() | |
| 153 | + previousTime = time; previousSourceTime = sourceTime; previousChaos = chaos | |
| 154 | + return metalTexture! | |
| 155 | + } | |
| 156 | + } | |
| 157 | + | |
| 158 | + /// Milkdrop packs sometimes wrap identifiers or numeric literals between numbered | |
| 159 | + /// EEL lines. Retrying a failed preset with joined equation chunks preserves the | |
| 160 | + /// expression; HLSL shaders and all successfully parsed presets remain untouched. | |
| 161 | + enum MilkdropCompatibility { | |
| 162 | + static func normalizedData(at url: URL) throws -> String? { | |
| 163 | + let data = try Data(contentsOf: url) | |
| 164 | + guard let text = String(data: data, encoding: .utf8) ?? String(data: data, encoding: .isoLatin1) else {return nil} | |
| 165 | + let pattern = try NSRegularExpression(pattern: #"^(per_frame_init_|per_frame_|per_pixel_|wave_[0-9]+_(?:init|per_frame|per_point)|shape_[0-9]+_(?:init|per_frame))([0-9]+)$"#) | |
| 166 | + let numericSuffix = try NSRegularExpression(pattern: #"([0-9]+(?:\.[0-9]*)?)[lL]\b"#) | |
| 167 | + let assignment = try NSRegularExpression(pattern: #"^[A-Za-z_][A-Za-z_0-9]*\s*="#) | |
| 168 | + var groups: [String: [(Int, String)]] = [:], untouched: [String] = [] | |
| 169 | + for line in text.components(separatedBy: .newlines) { | |
| 170 | + guard let equals = line.firstIndex(of: "=") else {untouched.append(line); continue} | |
| 171 | + let key = String(line[..<equals]).trimmingCharacters(in: .whitespaces) | |
| 172 | + let range = NSRange(key.startIndex..., in: key) | |
| 173 | + guard let match = pattern.firstMatch(in: key, range: range), | |
| 174 | + let prefixRange = Range(match.range(at: 1), in: key), | |
| 175 | + let indexRange = Range(match.range(at: 2), in: key), let index = Int(key[indexRange]) else {untouched.append(line); continue} | |
| 176 | + let raw = String(line[line.index(after:equals)...]) | |
| 177 | + let code = String(raw.components(separatedBy: "//")[0]).trimmingCharacters(in: .whitespacesAndNewlines) | |
| 178 | + groups[String(key[prefixRange]), default: []].append((index, code)) | |
| 179 | + } | |
| 180 | + guard !groups.isEmpty else {return nil} | |
| 181 | + for prefix in groups.keys.sorted() { | |
| 182 | + var combined = "" | |
| 183 | + for (_, chunk) in groups[prefix]!.sorted(by: {$0.0 < $1.0}) where !chunk.isEmpty { | |
| 184 | + // An assignment at a new chunk starts a statement unless it is | |
| 185 | + // still inside parentheses. Other chunks continue the same token. | |
| 186 | + if !combined.isEmpty && !combined.hasSuffix(";") && combined.filter({$0 == "("}).count == combined.filter({$0 == ")"}).count, | |
| 187 | + assignment.firstMatch(in:chunk,range:NSRange(chunk.startIndex...,in:chunk)) != nil {combined += ";"} | |
| 188 | + combined += chunk | |
| 189 | + } | |
| 190 | + combined = numericSuffix.stringByReplacingMatches(in:combined,range:NSRange(combined.startIndex...,in:combined),withTemplate:"$1") | |
| 191 | + if !combined.isEmpty && !combined.hasSuffix(";") {combined += ";"} | |
| 192 | + untouched.append(prefix+"1="+combined) | |
| 193 | + } | |
| 194 | + return untouched.joined(separator:"\n") | |
| 195 | + } | |
| 196 | + } | |
| 197 | + | |
| 198 | + /// Retina window size must not silently turn an interactive preview into a 4K render. | |
| 199 | + /// The Metal compositor scales this surface; offline export keeps its full resolution. | |
| 200 | + enum ProjectMPreviewSize { | |
| 201 | + static func dimensions(width: Int, height: Int) -> (width: Int, height: Int) { | |
| 202 | + let scale = min(1, 1280 / Double(max(width, height))) | |
| 203 | + return (max(1, Int((Double(width) * scale).rounded())), max(1, Int((Double(height) * scale).rounded()))) | |
| 204 | + } | |
| 205 | + } | |
| 206 | + | |
| 207 | + #endif |
Sources/PulseCanvas/PulseCanvasAgentAccess.swift added
| 1 | + #if os(macOS) && DIRECT_BUILD && !STORE_BUILD | |
| 2 | + import AppKit | |
| 3 | + import SwiftUI | |
| 4 | + | |
| 5 | + @MainActor | |
| 6 | + final class PulseMCPAccess: ObservableObject { | |
| 7 | + @AppStorage("PulseCanvas.agent.enabled") var enabled = false | |
| 8 | + @AppStorage("PulseCanvas.agent.playback") var playback = false | |
| 9 | + @AppStorage("PulseCanvas.agent.editing") var editing = false | |
| 10 | + @AppStorage("PulseCanvas.agent.rendering") var rendering = false | |
| 11 | + @AppStorage("PulseCanvas.agent.inputBookmark") private var inputBookmark = Data() | |
| 12 | + @AppStorage("PulseCanvas.agent.outputBookmark") private var outputBookmark = Data() | |
| 13 | + | |
| 14 | + @Published private(set) var lastConnection: Date? | |
| 15 | + @Published private(set) var hostRunning = false | |
| 16 | + let host = PulseMCPMailbox.Host() | |
| 17 | + | |
| 18 | + nonisolated static var edition: String { | |
| 19 | + #if STORE_BUILD | |
| 20 | + "app-store" | |
| 21 | + #elseif LOCAL_BUILD | |
| 22 | + "direct-local" | |
| 23 | + #else | |
| 24 | + "direct" | |
| 25 | + #endif | |
| 26 | + } | |
| 27 | + nonisolated static var version: String { | |
| 28 | + Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "development" | |
| 29 | + } | |
| 30 | + nonisolated static var offlineStatus: PulseMCP.Object { | |
| 31 | + ["running": false, "enabled": false, "edition": edition, "version": version, | |
| 32 | + "playback": false, "editing": false, "rendering": false, "pendingExports": 0] | |
| 33 | + } | |
| 34 | + | |
| 35 | + func host(_ service: PulseMCPService) { | |
| 36 | + host.start { [weak self, weak service] name, arguments in | |
| 37 | + guard let self, let service else { return ["error": PulseMCPError("APP_UNAVAILABLE", "Open PulseCanvas Studio.").payload] } | |
| 38 | + if name == "get_app_status" || enabled { lastConnection = Date() } | |
| 39 | + return await service.call(name, arguments) | |
| 40 | + } | |
| 41 | + hostRunning = host.isRunning | |
| 42 | + } | |
| 43 | + | |
| 44 | + func permits(_ permission: String) -> Bool { | |
| 45 | + switch permission { | |
| 46 | + case "playback": playback | |
| 47 | + case "editing": editing | |
| 48 | + case "rendering": rendering | |
| 49 | + default: false | |
| 50 | + } | |
| 51 | + } | |
| 52 | + | |
| 53 | + enum Folder: String { case input, output } | |
| 54 | + | |
| 55 | + func grant(_ folder: Folder, url: URL) throws { | |
| 56 | + let options: URL.BookmarkCreationOptions = folder == .input | |
| 57 | + ? [.withSecurityScope, .securityScopeAllowOnlyReadAccess] : [.withSecurityScope] | |
| 58 | + let bookmark = try url.bookmarkData(options: options, includingResourceValuesForKeys: nil, relativeTo: nil) | |
| 59 | + switch folder { | |
| 60 | + case .input: inputBookmark = bookmark | |
| 61 | + case .output: outputBookmark = bookmark | |
| 62 | + } | |
| 63 | + objectWillChange.send() | |
| 64 | + } | |
| 65 | + | |
| 66 | + func revoke(_ folder: Folder) { | |
| 67 | + switch folder { | |
| 68 | + case .input: inputBookmark = Data() | |
| 69 | + case .output: outputBookmark = Data() | |
| 70 | + } | |
| 71 | + objectWillChange.send() | |
| 72 | + } | |
| 73 | + | |
| 74 | + func scope(_ folder: Folder) -> SecurityScopedAccess? { | |
| 75 | + let data = folder == .input ? inputBookmark : outputBookmark | |
| 76 | + guard !data.isEmpty else { return nil } | |
| 77 | + var stale = false | |
| 78 | + guard let url = try? URL(resolvingBookmarkData: data, options: [.withSecurityScope, .withoutUI, .withoutMounting], | |
| 79 | + relativeTo: nil, bookmarkDataIsStale: &stale), !stale else { return nil } | |
| 80 | + let access = SecurityScopedAccess(url: url) | |
| 81 | + guard (try? access.url.resourceValues(forKeys: [.isDirectoryKey]).isDirectory) == true else { return nil } | |
| 82 | + return access | |
| 83 | + } | |
| 84 | + | |
| 85 | + struct AuthorizedPath { | |
| 86 | + let url: URL | |
| 87 | + let scope: SecurityScopedAccess | |
| 88 | + } | |
| 89 | + | |
| 90 | + func authorize(_ path: String, in folders: [Folder], writing: Bool = false) throws -> AuthorizedPath { | |
| 91 | + guard path.hasPrefix("/"), !path.utf8.contains(0) else { | |
| 92 | + throw PulseMCPError("INVALID_PATH", "Use an absolute local file path.") | |
| 93 | + } | |
| 94 | + let url = URL(fileURLWithPath: path).standardizedFileURL | |
| 95 | + for folder in folders { | |
| 96 | + guard let grant = scope(folder) else { continue } | |
| 97 | + let root = grant.url.resolvingSymlinksInPath().path | |
| 98 | + let parent = url.deletingLastPathComponent().resolvingSymlinksInPath() | |
| 99 | + let prefix = root == "/" ? "/" : root + "/" | |
| 100 | + guard parent.path == root || parent.path.hasPrefix(prefix) else { continue } | |
| 101 | + let candidate = parent.appendingPathComponent(url.lastPathComponent, isDirectory: false) | |
| 102 | + let resolved = candidate.resolvingSymlinksInPath() | |
| 103 | + guard resolved.path.hasPrefix(prefix), !writing || candidate.path == resolved.path else { continue } | |
| 104 | + if writing { | |
| 105 | + guard (try? parent.resourceValues(forKeys: [.isDirectoryKey]).isDirectory) == true else { | |
| 106 | + throw PulseMCPError("OUTPUT_UNAVAILABLE", "Choose an existing directory in the authorized output folder.") | |
| 107 | + } | |
| 108 | + } else if let properties = try? resolved.resourceValues(forKeys: [.isRegularFileKey, .isUbiquitousItemKey, .ubiquitousItemDownloadingStatusKey]) { | |
| 109 | + guard properties.isRegularFile == true else { | |
| 110 | + throw PulseMCPError("FILE_UNAVAILABLE", "Choose an existing regular file in the authorized folder.") | |
| 111 | + } | |
| 112 | + if properties.isUbiquitousItem == true, | |
| 113 | + properties.ubiquitousItemDownloadingStatus != .current && properties.ubiquitousItemDownloadingStatus != .downloaded { | |
| 114 | + throw PulseMCPError("FILE_UNAVAILABLE", "Download the file locally before using it in PulseCanvas.") | |
| 115 | + } | |
| 116 | + } else { | |
| 117 | + throw PulseMCPError("FILE_UNAVAILABLE", "The file could not be read. Check that it exists and is downloaded.") | |
| 118 | + } | |
| 119 | + return AuthorizedPath(url: writing ? candidate : resolved, scope: grant) | |
| 120 | + } | |
| 121 | + throw PulseMCPError("PERMISSION_REQUIRED", "Authorize the containing folder under PulseCanvas Studio → Settings → Agent access.") | |
| 122 | + } | |
| 123 | + | |
| 124 | + static var command: String { | |
| 125 | + Bundle.main.executableURL?.path ?? "/Applications/PulseCanvas Studio.app/Contents/MacOS/PulseCanvas" | |
| 126 | + } | |
| 127 | + | |
| 128 | + static func saveClaudeConnection(in directory: URL) throws { | |
| 129 | + let config = directory.appendingPathComponent(".mcp.json", isDirectory: false) | |
| 130 | + let fileManager = FileManager.default | |
| 131 | + let exists = fileManager.fileExists(atPath: config.path) | |
| 132 | + let original: Data? | |
| 133 | + var contents: PulseMCP.Object | |
| 134 | + if exists { | |
| 135 | + let info = try config.resourceValues(forKeys: [.isRegularFileKey, .isSymbolicLinkKey, .fileSizeKey]) | |
| 136 | + guard info.isRegularFile == true, info.isSymbolicLink != true, (info.fileSize ?? Int.max) <= PulseMCP.maxMessage else { | |
| 137 | + throw PulseMCPError("INVALID_CONFIG", "Choose a project with a regular .mcp.json file smaller than 2 MB.") | |
| 138 | + } | |
| 139 | + let data = try Data(contentsOf: config) | |
| 140 | + guard let object = try JSONSerialization.jsonObject(with: data) as? PulseMCP.Object else { | |
| 141 | + throw PulseMCPError("INVALID_CONFIG", "The existing .mcp.json must contain a JSON object.") | |
| 142 | + } | |
| 143 | + contents = object | |
| 144 | + original = data | |
| 145 | + } else { | |
| 146 | + contents = [:] | |
| 147 | + original = nil | |
| 148 | + } | |
| 149 | + guard contents["mcpServers"] == nil || contents["mcpServers"] is PulseMCP.Object else { | |
| 150 | + throw PulseMCPError("INVALID_CONFIG", "Correct the existing mcpServers object before adding PulseCanvas.") | |
| 151 | + } | |
| 152 | + var servers = contents["mcpServers"] as? PulseMCP.Object ?? [:] | |
| 153 | + let entry: PulseMCP.Object = ["type": "stdio", "command": command, "args": [PulseMCP.argument]] | |
| 154 | + if let existing = servers["pulsecanvas"] { | |
| 155 | + guard let existing = existing as? PulseMCP.Object, existing["command"] as? String == command, | |
| 156 | + existing["args"] as? [String] == [PulseMCP.argument] else { | |
| 157 | + throw PulseMCPError("CONFIG_CONFLICT", "This project already has a different pulsecanvas entry. Edit that entry explicitly.") | |
| 158 | + } | |
| 159 | + return | |
| 160 | + } | |
| 161 | + servers["pulsecanvas"] = entry | |
| 162 | + contents["mcpServers"] = servers | |
| 163 | + let data = try JSONSerialization.data(withJSONObject: contents, options: [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes]) | |
| 164 | + if let original { | |
| 165 | + guard try Data(contentsOf: config) == original else { | |
| 166 | + throw PulseMCPError("CONFIG_CONFLICT", "The project configuration changed. Check the existing file and try again.") | |
| 167 | + } | |
| 168 | + try (data + Data([10])).write(to: config, options: .atomic) | |
| 169 | + } else { | |
| 170 | + try (data + Data([10])).write(to: config, options: .withoutOverwriting) | |
| 171 | + } | |
| 172 | + } | |
| 173 | + } | |
| 174 | + | |
| 175 | + struct PulseMCPSettings: View { | |
| 176 | + @ObservedObject var access: PulseMCPAccess | |
| 177 | + @State private var client = "Claude Code" | |
| 178 | + @State private var feedback = "" | |
| 179 | + @State private var testing = false | |
| 180 | + | |
| 181 | + var body: some View { | |
| 182 | + Section("Agent access") { | |
| 183 | + Toggle("Allow local agents to connect", isOn: $access.enabled) | |
| 184 | + VStack(alignment: .leading, spacing: 10) { | |
| 185 | + Text(access.lastConnection.map { "Last local request: \($0.formatted())" } | |
| 186 | + ?? (access.hostRunning ? "Ready for a local connection" : "Connection unavailable")) | |
| 187 | + .foregroundStyle(.secondary) | |
| 188 | + Toggle("Allow song loading and playback control", isOn: $access.playback) | |
| 189 | + Toggle("Allow favorites and project edits", isOn: $access.editing) | |
| 190 | + Toggle("Allow previews and video exports", isOn: $access.rendering) | |
| 191 | + folderRow("Input folder", .input) | |
| 192 | + folderRow("Project and export folder", .output) | |
| 193 | + Picker("Client", selection: $client) { | |
| 194 | + Text("Claude Code").tag("Claude Code") | |
| 195 | + Text("Codex").tag("Codex") | |
| 196 | + }.pickerStyle(.segmented) | |
| 197 | + if client == "Claude Code" { | |
| 198 | + Button("Save project connection…") { saveProjectConnection() } | |
| 199 | + Text("Open Claude → Code and start a new local session in that folder. Approve the project connection and check Connectors for PulseCanvas.") | |
| 200 | + } else { | |
| 201 | + Text("In Codex, open Settings → MCP servers → Add server → STDIO. Name the server pulsecanvas. Save, restart, and enter /mcp in a local chat.") | |
| 202 | + copyRow("Command", PulseMCPAccess.command) | |
| 203 | + copyRow("Argument", PulseMCP.argument) | |
| 204 | + } | |
| 205 | + DisclosureGroup("Advanced") { | |
| 206 | + Text(PulseMCP.jsonText(["mcpServers": ["pulsecanvas": ["type": "stdio", "command": PulseMCPAccess.command, "args": [PulseMCP.argument]]]])) | |
| 207 | + .font(.system(.caption, design: .monospaced)).textSelection(.enabled) | |
| 208 | + } | |
| 209 | + Button("Test connection") { testConnection() }.disabled(testing) | |
| 210 | + if !feedback.isEmpty { Text(feedback).textSelection(.enabled) } | |
| 211 | + }.font(.callout).disabled(!access.enabled) | |
| 212 | + } | |
| 213 | + } | |
| 214 | + | |
| 215 | + private func folderRow(_ title: String, _ folder: PulseMCPAccess.Folder) -> some View { | |
| 216 | + HStack { | |
| 217 | + Text(title) | |
| 218 | + Spacer() | |
| 219 | + if let scope = access.scope(folder) { | |
| 220 | + Text(scope.url.path).lineLimit(1).truncationMode(.middle).help(scope.url.path) | |
| 221 | + Button("Remove") { access.revoke(folder) } | |
| 222 | + } | |
| 223 | + Button("Choose…") { | |
| 224 | + let panel = folderPicker() | |
| 225 | + panel.begin { response in | |
| 226 | + guard response == .OK, let url = panel.url else { return } | |
| 227 | + do { try access.grant(folder, url: url); feedback = "Folder authorized." } | |
| 228 | + catch { feedback = error.localizedDescription } | |
| 229 | + } | |
| 230 | + } | |
| 231 | + } | |
| 232 | + } | |
| 233 | + | |
| 234 | + private func copyRow(_ label: String, _ value: String) -> some View { | |
| 235 | + HStack { | |
| 236 | + Text(label) | |
| 237 | + Text(value).lineLimit(1).truncationMode(.middle).textSelection(.enabled) | |
| 238 | + Spacer() | |
| 239 | + Button("Copy \(label.lowercased())") { | |
| 240 | + NSPasteboard.general.clearContents() | |
| 241 | + NSPasteboard.general.setString(value, forType: .string) | |
| 242 | + } | |
| 243 | + } | |
| 244 | + } | |
| 245 | + | |
| 246 | + private func folderPicker() -> NSOpenPanel { | |
| 247 | + let panel = NSOpenPanel() | |
| 248 | + panel.canChooseDirectories = true | |
| 249 | + panel.canChooseFiles = false | |
| 250 | + panel.allowsMultipleSelection = false | |
| 251 | + return panel | |
| 252 | + } | |
| 253 | + | |
| 254 | + private func saveProjectConnection() { | |
| 255 | + let panel = folderPicker() | |
| 256 | + panel.message = "Choose the folder you open in Claude Code." | |
| 257 | + panel.begin { response in | |
| 258 | + guard response == .OK, let url = panel.url else { return } | |
| 259 | + let scope = SecurityScopedAccess(url: url) | |
| 260 | + defer { withExtendedLifetime(scope) {} } | |
| 261 | + do { | |
| 262 | + try PulseMCPAccess.saveClaudeConnection(in: scope.url) | |
| 263 | + feedback = "Project connection saved in \(scope.url.lastPathComponent)/.mcp.json." | |
| 264 | + } catch { feedback = error.localizedDescription } | |
| 265 | + } | |
| 266 | + } | |
| 267 | + | |
| 268 | + private func testConnection() { | |
| 269 | + testing = true | |
| 270 | + Task { | |
| 271 | + let connected = await Task.detached { | |
| 272 | + let response = PulseMCPMailbox.call("get_app_status", [:])["value"] as? PulseMCP.Object | |
| 273 | + return response?["enabled"] as? Bool == true | |
| 274 | + }.value | |
| 275 | + testing = false | |
| 276 | + feedback = connected ? "Local connection passed." : "Connection failed. Reopen PulseCanvas Studio and try again." | |
| 277 | + } | |
| 278 | + } | |
| 279 | + } | |
| 280 | + #endif |
Sources/PulseCanvas/PulseCanvasMCPProjects.swift added
| 1 | + #if os(macOS) && DIRECT_BUILD && !STORE_BUILD | |
| 2 | + import CryptoKit | |
| 3 | + import Foundation | |
| 4 | + | |
| 5 | + struct PulseMCPSeed: RandomNumberGenerator { | |
| 6 | + private var state: UInt64 | |
| 7 | + init(_ seed: String) { | |
| 8 | + state = SHA256.hash(data: Data(seed.utf8)).prefix(8).reduce(0) { ($0 << 8) | UInt64($1) } | |
| 9 | + } | |
| 10 | + mutating func next() -> UInt64 { | |
| 11 | + state &+= 0x9E3779B97F4A7C15 | |
| 12 | + var result = state | |
| 13 | + result = (result ^ (result >> 30)) &* 0xBF58476D1CE4E5B9 | |
| 14 | + result = (result ^ (result >> 27)) &* 0x94D049BB133111EB | |
| 15 | + return result ^ (result >> 31) | |
| 16 | + } | |
| 17 | + } | |
| 18 | + #endif |
Sources/PulseCanvas/Resources/Canvas.metal added
| 1 | + #include <metal_stdlib> | |
| 2 | + using namespace metal; | |
| 3 | + struct CanvasMeshInput { | |
| 4 | + float3 position; | |
| 5 | + float4 color; | |
| 6 | + float2 uv; | |
| 7 | + float3 normal; | |
| 8 | + }; | |
| 9 | + struct CanvasOutput { float4 position [[position]]; float4 color; float3 surface; float3 normal; float3 faceNormal [[flat]]; }; | |
| 10 | + vertex CanvasOutput canvasVertex(uint id [[vertex_id]], device const CanvasMeshInput *vertices [[buffer(0)]], | |
| 11 | + constant float4x4 &mvp [[buffer(1)]], device const uint *indices [[buffer(3)]]) { | |
| 12 | + CanvasMeshInput input=vertices[indices[id]]; | |
| 13 | + uint triangle=id/3*3; | |
| 14 | + float3 a=vertices[indices[triangle]].position; | |
| 15 | + float3 b=vertices[indices[triangle+1]].position; | |
| 16 | + float3 c=vertices[indices[triangle+2]].position; | |
| 17 | + float3 face=cross(b-a,c-a); | |
| 18 | + CanvasOutput output; | |
| 19 | + output.position = mvp * float4(input.position, 1); | |
| 20 | + output.surface = input.position; | |
| 21 | + output.color = input.color; | |
| 22 | + // Derivatives at narrow triangle edges can depend on helper-lane values. | |
| 23 | + // Derive the face normal from its vertices so lighting has stable inputs. | |
| 24 | + output.normal = input.normal; | |
| 25 | + output.faceNormal=dot(face,face)>1e-12 ? normalize(face) : float3(0,0,1); | |
| 26 | + return output; | |
| 27 | + } | |
| 28 | + fragment float4 canvasFragment(CanvasOutput input [[stage_in]]) { | |
| 29 | + float3 normal = length_squared(input.normal) > 0.25 ? normalize(input.normal) : input.faceNormal; | |
| 30 | + float diffuse = abs(dot(normal, normalize(float3(-0.35,0.45,0.82)))); | |
| 31 | + float specular = pow(abs(dot(normal, normalize(float3(-0.15,0.25,0.96)))), 18); | |
| 32 | + float depth = clamp(1.2 - length(input.surface) / 100, 0.4, 1.0); | |
| 33 | + float shade = (0.30 + 0.70 * diffuse + 0.20 * specular) * depth; | |
| 34 | + return float4(input.color.rgb * shade, input.color.a); | |
| 35 | + } | |
| 36 | + | |
| 37 | + struct CanvasInput { float3 position [[attribute(0)]]; float4 color [[attribute(1)]]; float2 uv [[attribute(2)]]; }; | |
| 38 | + struct CanvasPointUniforms { float4x4 mvp; float pointSize; float viewportScale; float2 padding; }; | |
| 39 | + struct CanvasPoint { float4 position [[position]]; float4 color; float size [[point_size]]; }; | |
| 40 | + vertex CanvasPoint canvasPointVertex(CanvasInput input [[stage_in]], constant CanvasPointUniforms &u [[buffer(1)]]) { | |
| 41 | + CanvasPoint output; | |
| 42 | + output.position = u.mvp * float4(input.position, 1); | |
| 43 | + // A world-space bead diameter projected at this depth. | |
| 44 | + output.size = clamp(u.pointSize * u.viewportScale / max(output.position.w, 0.1), 1.0, 160.0); | |
| 45 | + output.color = input.color; | |
| 46 | + return output; | |
| 47 | + } | |
| 48 | + /// A lit bead computed inside each sprite; no texture is sampled. | |
| 49 | + fragment float4 canvasPointFragment(CanvasPoint input [[stage_in]], float2 coord [[point_coord]]) { | |
| 50 | + float2 p = coord * 2 - 1; | |
| 51 | + float radius2 = dot(p, p); | |
| 52 | + if (radius2 >= 1) discard_fragment(); | |
| 53 | + float3 normal = float3(p.x, -p.y, sqrt(1 - radius2)); | |
| 54 | + float diffuse = max(0.0, dot(normal, normalize(float3(-0.4, 0.45, 0.8)))); | |
| 55 | + float shine = pow(max(0.0, dot(normal, normalize(float3(-0.25, 0.3, 0.92)))), 24); | |
| 56 | + float rim = pow(1 - normal.z, 2); | |
| 57 | + float3 color = input.color.rgb * (0.2 + 0.75 * diffuse + 0.35 * rim) + shine * 0.45; | |
| 58 | + return float4(color, 0.82 * smoothstep(1.0, 0.82, sqrt(radius2))); | |
| 59 | + } |
Sources/PulseCanvas/Resources/NativeCommon.metal added
| 1 | + #include <metal_stdlib> | |
| 2 | + using namespace metal; | |
| 3 | + | |
| 4 | + // PulseCanvas native effect prelude. Original procedural code: no external images, | |
| 5 | + // preset equations or third-party shader sources. Classic mathematical forms are | |
| 6 | + // implemented from their definitions. This file is prepended to every Native*.metal | |
| 7 | + // effect file when the renderer compiles the native library. | |
| 8 | + // | |
| 9 | + // Layout matches NativeUniforms in VisualizerRenderer.swift. The first fields match | |
| 10 | + // SpatialFrame so every native pass shares one uniform block. | |
| 11 | + struct NativeFrame { | |
| 12 | + float2 resolution; float time; int scene; | |
| 13 | + float4 rhythm; // attack swell, drive, low and high levels (Chaos-scaled) | |
| 14 | + float4 style; // brightness, size, fog, camera zoom | |
| 15 | + float4 camera; // rotation, Chaos, detail, zoom speed | |
| 16 | + float4 colors[5]; | |
| 17 | + float4 bands; // smoothed low, low-mid, high-mid, high (Chaos-scaled) | |
| 18 | + float4 motion; // zoom travel, music clock, procedural time, smoothed energy | |
| 19 | + }; | |
| 20 | + | |
| 21 | + // Everything an effect needs, already normalized. Every audio term is zero at zero Chaos. | |
| 22 | + struct Ctx { | |
| 23 | + float2 uv; // centred, y up; the shorter canvas edge spans [-1, 1] | |
| 24 | + float2 screen; // 0...1 across the canvas | |
| 25 | + float2 extent; // half-size of the canvas in uv units (>= 1 on each axis) | |
| 26 | + float px; // one pixel in uv units | |
| 27 | + float t; // procedural time (speed-scaled, never audio-driven) | |
| 28 | + float m; // music clock: advances faster in energetic passages | |
| 29 | + float e; // smoothed musical energy, 0...~1 | |
| 30 | + float hit; // short attack envelope | |
| 31 | + float4 b; // smoothed bands: low, low-mid, high-mid, high | |
| 32 | + float travel; // integrated forward zoom distance | |
| 33 | + float size; // size control, 1 at default | |
| 34 | + float fog; // depth control, 0...1 | |
| 35 | + float detail; // detail control, 0...1 | |
| 36 | + }; | |
| 37 | + | |
| 38 | + constant float PI = 3.14159265; | |
| 39 | + constant float TAU = 6.2831853; | |
| 40 | + | |
| 41 | + // ---------------------------------------------------------------- hashing / noise | |
| 42 | + float hash11(float p) { p = fract(p * .1031); p *= p + 33.33; p *= p + p; return fract(p); } | |
| 43 | + float hash21(float2 p) { float3 q = fract(float3(p.xyx) * .1031); q += dot(q, q.yzx + 33.33); return fract((q.x + q.y) * q.z); } | |
| 44 | + float2 hash22(float2 p) { float3 q = fract(float3(p.xyx) * float3(.1031, .1030, .0973)); q += dot(q, q.yzx + 33.33); return fract((q.xx + q.yz) * q.zy); } | |
| 45 | + float3 hash33(float3 p) { p = fract(p * float3(.1031, .1030, .0973)); p += dot(p, p.yxz + 33.33); return fract((p.xxy + p.yxx) * p.zyx); } | |
| 46 | + float hash31(float3 p) { p = fract(p * .1031); p += dot(p, p.zyx + 31.32); return fract((p.x + p.y) * p.z); } | |
| 47 | + | |
| 48 | + float noise2(float2 p) { | |
| 49 | + float2 i = floor(p), f = fract(p), u = f * f * (3 - 2 * f); | |
| 50 | + return mix(mix(hash21(i), hash21(i + float2(1, 0)), u.x), mix(hash21(i + float2(0, 1)), hash21(i + 1), u.x), u.y); | |
| 51 | + } | |
| 52 | + float noise3(float3 p) { | |
| 53 | + float3 i = floor(p), f = fract(p), u = f * f * (3 - 2 * f); | |
| 54 | + float a = hash31(i), b = hash31(i + float3(1, 0, 0)), c = hash31(i + float3(0, 1, 0)), d = hash31(i + float3(1, 1, 0)); | |
| 55 | + float e = hash31(i + float3(0, 0, 1)), g = hash31(i + float3(1, 0, 1)), h = hash31(i + float3(0, 1, 1)), k = hash31(i + 1); | |
| 56 | + return mix(mix(mix(a, b, u.x), mix(c, d, u.x), u.y), mix(mix(e, g, u.x), mix(h, k, u.x), u.y), u.z); | |
| 57 | + } | |
| 58 | + float fbm2(float2 p, int octaves) { | |
| 59 | + float sum = 0, amplitude = .5; | |
| 60 | + for (int i = 0; i < octaves; ++i) { sum += amplitude * noise2(p); p = float2(p.x * 1.6 - p.y * 1.2, p.x * 1.2 + p.y * 1.6) + 3.1; amplitude *= .5; } | |
| 61 | + return sum; | |
| 62 | + } | |
| 63 | + float fbm3(float3 p, int octaves) { | |
| 64 | + float sum = 0, amplitude = .5; | |
| 65 | + for (int i = 0; i < octaves; ++i) { sum += amplitude * noise3(p); p = p * 2.03 + float3(1.7, -3.1, 2.3); amplitude *= .5; } | |
| 66 | + return sum; | |
| 67 | + } | |
| 68 | + // Smooth divergence-free-looking flow from a noise potential. | |
| 69 | + float2 curl2(float2 p) { | |
| 70 | + const float e = .05; | |
| 71 | + float a = noise2(p + float2(0, e)), b = noise2(p - float2(0, e)); | |
| 72 | + float c = noise2(p + float2(e, 0)), d = noise2(p - float2(e, 0)); | |
| 73 | + return float2(a - b, d - c) / (2 * e); | |
| 74 | + } | |
| 75 | + // Voronoi: x = nearest distance, y = second distance, zw = nearest cell id. | |
| 76 | + float4 voronoi(float2 p, float jitter, float phase) { | |
| 77 | + float2 cell = floor(p), f = fract(p); | |
| 78 | + float first = 8, second = 8; float2 winner = 0; | |
| 79 | + for (int y = -1; y <= 1; ++y) for (int x = -1; x <= 1; ++x) { | |
| 80 | + float2 g = float2(x, y), seed = hash22(cell + g); | |
| 81 | + float2 site = g + .5 + jitter * .5 * sin(phase + seed * TAU); | |
| 82 | + float d = length(site - f); | |
| 83 | + if (d < first) { second = first; first = d; winner = cell + g; } else second = min(second, d); | |
| 84 | + } | |
| 85 | + return float4(first, second, winner); | |
| 86 | + } | |
| 87 | + | |
| 88 | + // ---------------------------------------------------------------- geometry | |
| 89 | + float2 rot(float2 p, float a) { float c = cos(a), s = sin(a); return float2(c * p.x - s * p.y, s * p.x + c * p.y); } | |
| 90 | + float smin(float a, float b, float k) { float h = clamp(.5 + .5 * (b - a) / k, 0.f, 1.f); return mix(b, a, h) - k * h * (1 - h); } | |
| 91 | + float smax(float a, float b, float k) { return -smin(-a, -b, k); } | |
| 92 | + float sdBox(float3 p, float3 b) { float3 q = abs(p) - b; return length(max(q, 0.f)) + min(max(q.x, max(q.y, q.z)), 0.f); } | |
| 93 | + float sdBox2(float2 p, float2 b) { float2 q = abs(p) - b; return length(max(q, 0.f)) + min(max(q.x, q.y), 0.f); } | |
| 94 | + float sdTorus(float3 p, float2 t) { return length(float2(length(p.xz) - t.x, p.y)) - t.y; } | |
| 95 | + float sdCapsule(float3 p, float3 a, float3 b, float r) { float3 pa = p - a, ba = b - a; float h = clamp(dot(pa, ba) / dot(ba, ba), 0.f, 1.f); return length(pa - ba * h) - r; } | |
| 96 | + float sdSegment(float2 p, float2 a, float2 b) { float2 pa = p - a, ba = b - a; float h = clamp(dot(pa, ba) / max(dot(ba, ba), 1e-6f), 0.f, 1.f); return length(pa - ba * h); } | |
| 97 | + float sdHex(float2 p, float r) { const float3 k = float3(-.8660254, .5, .57735); p = abs(p); p -= 2 * min(dot(k.xy, p), 0.f) * k.xy; p -= float2(clamp(p.x, -k.z * r, k.z * r), r); return length(p) * sign(p.y); } | |
| 98 | + // Hexagonal tiling: xy = local offset, zw = cell id. | |
| 99 | + float4 hexCell(float2 p) { | |
| 100 | + const float2 s = float2(1, 1.7320508); | |
| 101 | + float2 a = p - s * floor(p / s + .5), b = p - s * (floor((p - s * .5) / s + .5) + .5); | |
| 102 | + return dot(a, a) < dot(b, b) ? float4(a, round(p / s)) : float4(b, round((p - s * .5) / s) + .5); | |
| 103 | + } | |
| 104 | + // Repeat with a stable cell index. | |
| 105 | + float repeatId(float x, float period) { return floor(x / period + .5); } | |
| 106 | + | |
| 107 | + // ---------------------------------------------------------------- shading | |
| 108 | + float3 paint(float phase, constant NativeFrame &f) { | |
| 109 | + float cycle = phase - floor(phase * .5) * 2; | |
| 110 | + float x = (cycle < 1 ? cycle : 2 - cycle) * 4; | |
| 111 | + int i = min(3, int(x)); | |
| 112 | + return mix(f.colors[i].rgb, f.colors[i + 1].rgb, x - float(i)); | |
| 113 | + } | |
| 114 | + float3 deep(float phase, constant NativeFrame &f) { return paint(phase, f) * paint(phase + .5, f); } | |
| 115 | + float glow(float d, float width) { return width * width / (width * width + d * d); } | |
| 116 | + float line(float d, float width, float px) { return 1 - smoothstep(width - px, width + px, abs(d)); } | |
| 117 | + float fill(float d, float px) { return 1 - smoothstep(-px, px, d); } | |
| 118 | + float3 hsvTint(float3 color, float amount) { float l = dot(color, float3(.299, .587, .114)); return mix(float3(l), color, amount); } | |
| 119 | + // Thin-film interference tint, used for soap, oil and opal colors; blended with the palette. | |
| 120 | + float3 filmColor(float thickness, constant NativeFrame &f) { | |
| 121 | + float3 rainbow = .5 + .5 * cos(TAU * (thickness + float3(0, .33, .67))); | |
| 122 | + return mix(paint(thickness, f), rainbow * paint(thickness * .5 + .2, f) * 2, .45); | |
| 123 | + } | |
| 124 | + | |
| 125 | + // ---------------------------------------------------------------- raymarch helpers | |
| 126 | + float3 cameraRay(float2 uv, float3 forward, float3 up, float lens) { | |
| 127 | + float3 w = normalize(forward), u = normalize(cross(up, w)), v = cross(w, u); | |
| 128 | + return normalize(uv.x * u + uv.y * v + lens * w); | |
| 129 | + } | |
| 130 | + // Slot k (back to front) of a forward-moving stack of n layers. x = phase (0 far, 1 at | |
| 131 | + // the viewer), y = a stable layer id that survives the wrap, so layers never pop. | |
| 132 | + float2 layerSlot(int k, int n, float travel) { | |
| 133 | + float shift = travel * float(n); | |
| 134 | + return float2((float(k) + fract(shift)) / float(n), float(k) - floor(shift)); | |
| 135 | + } | |
| 136 | + float layerFade(float phase) { return smoothstep(0.f, .22f, phase) * (1 - smoothstep(.8f, 1.f, phase)); } | |
| 137 | + // Magnification for a layer: far layers are small and dense, near layers large. | |
| 138 | + float layerScale(float phase, float range) { return exp2((1 - phase) * range); } | |
| 139 | + // Seamless scale-space zoom for self-similar patterns: two octaves crossfade at weight 0. | |
| 140 | + float2 octaveZoom(float travel, int octave) { | |
| 141 | + float z = fract(travel); | |
| 142 | + float weight = octave == 0 ? 1 - smoothstep(0.f, 1.f, z) : smoothstep(0.f, 1.f, z); | |
| 143 | + return float2(exp2(float(octave) - z), weight); | |
| 144 | + } | |
| 145 | + // Oblique camera over a ground plane; the horizon sits above the canvas so the plane | |
| 146 | + // fills every aspect ratio. Returns ground x, forward distance and view distance. | |
| 147 | + float3 groundView(float2 uv, float2 extent, float height, float margin) { | |
| 148 | + float horizon = extent.y + margin; | |
| 149 | + float depth = height / max(horizon - uv.y, 1e-3f); | |
| 150 | + return float3(uv.x * depth, depth, depth * length(float2(1, uv.x))); | |
| 151 | + } | |
| 152 | + | |
| 153 | + // ---------------------------------------------------------------- context / output | |
| 154 | + Ctx makeContext(float2 position, constant NativeFrame &f) { | |
| 155 | + Ctx c; | |
| 156 | + float2 res = max(f.resolution, float2(1)); | |
| 157 | + float shortSide = min(res.x, res.y); | |
| 158 | + c.screen = position / res; | |
| 159 | + c.extent = res / shortSide; | |
| 160 | + float2 uv = (position - res * .5) / (shortSide * .5); | |
| 161 | + uv.y = -uv.y; | |
| 162 | + float zoom = clamp(f.style.w, .3f, 2.f); | |
| 163 | + c.uv = rot(uv, f.camera.x) / zoom; | |
| 164 | + c.extent /= zoom; | |
| 165 | + c.px = 2 / (shortSide * zoom); | |
| 166 | + c.travel = f.motion.x; | |
| 167 | + c.m = f.motion.y; | |
| 168 | + c.t = f.motion.z; | |
| 169 | + c.e = clamp(f.motion.w, 0.f, 1.5f); | |
| 170 | + c.hit = clamp(f.rhythm.x, 0.f, 1.f); | |
| 171 | + c.b = clamp(f.bands, 0.f, 1.f); | |
| 172 | + c.size = sqrt(clamp(f.style.y, .3f, 6.f)); | |
| 173 | + c.fog = clamp(f.style.z, 0.f, 1.f); | |
| 174 | + c.detail = clamp(f.camera.z, 0.f, 1.f); | |
| 175 | + return c; | |
| 176 | + } | |
| 177 | + | |
| 178 | + // ---------------------------------------------------------------- roller-coaster course | |
| 179 | + // Coaster versions ride a real tube that winds through space instead of a straight bore. Each | |
| 180 | + // pixel's ray is traced against a tube whose centreline bends away ahead of the camera; the design | |
| 181 | + // is handed the wall's own coordinates (the angle around the tube and the depth along it) as | |
| 182 | + // the uv a straight tunnel has there. The walls stay rigid: they sweep past while the far end | |
| 183 | + // swings away around each bend and drops behind the wall on tight turns, the track climbs and | |
| 184 | + // dives, and the camera banks into each turn. Mirrored in NativeExpansionCommon.metal. | |
| 185 | + float2 coasterPath(float z, float seed) { | |
| 186 | + return float2(1.5 * sin(z * .3 + seed) + .6 * sin(z * .55 + seed * 2.3), | |
| 187 | + 1.1 * sin(z * .26 + seed * 1.7 + 1.1) + .5 * sin(z * .5 + seed * .6)); | |
| 188 | + } | |
| 189 | + float2 coasterSlope(float z, float seed) { | |
| 190 | + return float2(.45 * cos(z * .3 + seed) + .33 * cos(z * .55 + seed * 2.3), | |
| 191 | + .286 * cos(z * .26 + seed * 1.7 + 1.1) + .25 * cos(z * .5 + seed * .6)); | |
| 192 | + } | |
| 193 | + // Distance from the tube's axis across its section: round, or square for box corridors. | |
| 194 | + float coasterRadius(float2 q, bool square) { return square ? max(fabs(q.x), fabs(q.y)) : length(q); } | |
| 195 | + // Where the ray is across the tube's section at depth z, relative to the bending centreline. | |
| 196 | + float2 coasterLateral(float2 ray, float z, float along, float2 origin, float2 slope, float seed) { | |
| 197 | + return ray * z - (coasterPath(along + z, seed) - origin - slope * z); | |
| 198 | + } | |
| 199 | + Ctx coasterTube(Ctx c, float seed, float along, bool square) { | |
| 200 | + // The camera rides the centreline. Its view lags the track a little, so each turn swings | |
| 201 | + // the outer wall into view before the far end goes round it, and it banks into the turn. | |
| 202 | + float2 origin = coasterPath(along, seed), slope = coasterSlope(along - 1.2, seed); | |
| 203 | + float2 ray = rot(c.uv, -.3 * (coasterSlope(along + 4, seed).x - slope.x)); | |
| 204 | + float spread = length(ray); | |
| 205 | + float z = .05, inside = .05, gap = 1; | |
| 206 | + float2 lateral = ray * z; | |
| 207 | + for (int i = 0; i < 40; ++i) { | |
| 208 | + lateral = coasterLateral(ray, z, along, origin, slope, seed); | |
| 209 | + gap = 1 - coasterRadius(lateral, square); | |
| 210 | + if (gap < 0) break; | |
| 211 | + inside = z; | |
| 212 | + if (gap < .002 || z > 60) break; | |
| 213 | + z += gap * .85 / (spread + min(2.f, .4f * z + .6f)); | |
| 214 | + } | |
| 215 | + // A step can cross the wall: bisect between the last depth inside and the first outside. | |
| 216 | + if (gap < 0) { | |
| 217 | + float outside = z; | |
| 218 | + for (int i = 0; i < 6; ++i) { | |
| 219 | + z = .5 * (inside + outside); | |
| 220 | + lateral = coasterLateral(ray, z, along, origin, slope, seed); | |
| 221 | + if (coasterRadius(lateral, square) < 1) inside = z; else outside = z; | |
| 222 | + } | |
| 223 | + } | |
| 224 | + float2 uv = lateral / max(coasterRadius(lateral, square), 1e-4f) / z; | |
| 225 | + // Pixel footprint for anti-aliasing: walls bunch up on the inside of a turn. | |
| 226 | + c.px = clamp(max(length(dfdx(uv)), length(dfdy(uv))), c.px * .25f, c.px * 6); | |
| 227 | + c.uv = uv; | |
| 228 | + return c; | |
| 229 | + } | |
| 230 | + // The Coaster versions (390–455) ride the track of the design they come from. | |
| 231 | + Ctx coasterRide(Ctx c, int source, bool box) { return coasterTube(c, float(source) * 1.37, c.travel * 2.4 + c.m * .8, box); } | |
| 232 | + | |
| 233 | + float4 finish(float3 color, float2 position, constant NativeFrame &f) { | |
| 234 | + color = max(color, float3(0)) * max(0.f, f.style.x); | |
| 235 | + color = 1 - exp(-color * 1.55); | |
| 236 | + // Static ordered dither keeps smooth gradients from banding in 8-bit video. | |
| 237 | + float dither = (hash21(floor(position)) - .5) / 255; | |
| 238 | + return float4(saturate(color + dither), 1); | |
| 239 | + } | |
| 240 | + | |
| 241 | + // Each effect is `float3 name(Ctx c, constant NativeFrame &f)`; this emits its fragment. | |
| 242 | + #define NATIVE_EFFECT(name) \ | |
| 243 | + fragment float4 name##Fragment(float4 position [[position]], constant NativeFrame &f [[buffer(0)]]) { \ | |
| 244 | + Ctx c = makeContext(position.xy, f); \ | |
| 245 | + return finish(name(c, f), position.xy, f); \ | |
| 246 | + } | |
| 247 | + // A design's Coaster version: the same design riding the roller-coaster course (box: square tube). | |
| 248 | + #define NATIVE_COASTER(name, source, box) \ | |
| 249 | + fragment float4 name##CoasterFragment(float4 position [[position]], constant NativeFrame &f [[buffer(0)]]) { \ | |
| 250 | + Ctx c = coasterRide(makeContext(position.xy, f), source, box); \ | |
| 251 | + return finish(name(c, f), position.xy, f); \ | |
| 252 | + } | |
| 253 | + | |
| 254 | + vertex float4 nativeVertex(uint id [[vertex_id]]) { | |
| 255 | + const float2 p[3] = {float2(-1, -1), float2(3, -1), float2(-1, 3)}; | |
| 256 | + return float4(p[id], 0, 1); | |
| 257 | + } |
Sources/PulseCanvas/Resources/NativeDrive.metal added
| 1 | + | |
| 2 | + // Independently travelling reflections on existing scene surfaces. Their four | |
| 3 | + // spatial phases follow different frequency bands; attacks launch narrow wavefronts. | |
| 4 | + // Only material samples change: the camera and horizon remain in place. | |
| 5 | + | |
| 6 | + // PulseCanvas native designs: driving scenes. Original procedural code; see NativeCommon.metal. | |
| 7 | + // Roads are pseudo-3D. A camera at eye height looks along a bending road: ground pixels get a | |
| 8 | + // depth from their distance below the horizon, vertical planes (rails, facades, cable planes) | |
| 9 | + // are solved per pixel, and roadside objects are projected from world-space instances whose | |
| 10 | + // ids stay stable as the travel distance grows, so nothing pops when a period wraps. | |
| 11 | + | |
| 12 | + // ---------------------------------------------------------------- shared helpers | |
| 13 | + // Lateral offset of a road centre along world distance s, its slope and its curvature. | |
| 14 | + | |
| 15 | + | |
| 16 | + // Road centre at depth z, seen from a camera at s0 that looks along the road's tangent. | |
| 17 | + | |
| 18 | + // The same with the camera's own bend and slope computed once per pixel. | |
| 19 | + struct DrvRoad { float4 k; float s0; float base; float slope; }; | |
| 20 | + | |
| 21 | + | |
| 22 | + // Depth at which the ray through screen x meets the vertical plane at road-relative lateral x. | |
| 23 | + // Damped fixed-point iteration; returns -1 where it does not settle (far, near the vanishing | |
| 24 | + // point), so callers simply skip the plane there. | |
| 25 | + | |
| 26 | + // Anti-aliased stripe of half width w around d = 0, given the pixel footprint aa. | |
| 27 | + float drvStripe(float d, float w, float aa) { | |
| 28 | + aa = max(aa, 1e-5f); | |
| 29 | + return (1 - smoothstep(w - aa, w + aa, abs(d))) * min(1.f, w / aa); | |
| 30 | + } | |
| 31 | + // Anti-aliased dashes centred on multiples of period; fades to the duty cycle when tiny. | |
| 32 | + | |
| 33 | + | |
| 34 | + // The band an element listens to, chosen by its integer id. | |
| 35 | + | |
| 36 | + // Point stars: one candidate per cell, a soft dot about a pixel wide. | |
| 37 | + | |
| 38 | + // Rear view of a car in metres, origin at the rear centre on the road. | |
| 39 | + // x = body coverage, y = tail lamps, z = rear glass. | |
| 40 | + | |
| 41 | + // Skyline of towers along a horizon: x = silhouette coverage, y = lit window amount. | |
| 42 | + | |
| 43 | + | |
| 44 | + // ---------------------------------------------------------------- 134 Night Highway | |
| 45 | + // A divided highway at night: median lamp masts throw sodium pools, tail lights pull away | |
| 46 | + // and oncoming headlights rush past on the far carriageway, the skyline glows ahead. | |
| 47 | + | |
| 48 | + | |
| 49 | + // ---------------------------------------------------------------- 135 Neon Boulevard | |
| 50 | + // Neon facade at (along, height) on one side of the street. blur widens the tubes for | |
| 51 | + // reflections in the wet asphalt. | |
| 52 | + | |
| 53 | + | |
| 54 | + // ---------------------------------------------------------------- 136 Desert Interstate | |
| 55 | + | |
| 56 | + | |
| 57 | + // ---------------------------------------------------------------- 137 Mountain Switchbacks | |
| 58 | + // Serpentine road: straight rows across the slope joined by hairpins. Returns distance to | |
| 59 | + // the centreline, arc length along the road and a signed offset (positive = outer/downhill). | |
| 60 | + | |
| 61 | + | |
| 62 | + // Pine crown height above p on a jittered grid (2x2 neighbours, tallest wins). | |
| 63 | + | |
| 64 | + // A chase view from above over hairpin bends cut into a forested slope at dusk. The camera | |
| 65 | + // swings with the car through each hairpin; mist pools in the valley below. Bass runs the | |
| 66 | + // rail reflectors in sequence, attacks flash the reflectors next to the car. | |
| 67 | + | |
| 68 | + | |
| 69 | + // ---------------------------------------------------------------- 138 Sodium Tunnel | |
| 70 | + // First depth where a camera ray (lateral/vertical slope per metre) leaves a tube whose | |
| 71 | + // centre follows the road bend: geometric march, then bisection. | |
| 72 | + | |
| 73 | + | |
| 74 | + // ---------------------------------------------------------------- 139 Coastal Cruise | |
| 75 | + | |
| 76 | + | |
| 77 | + // ---------------------------------------------------------------- 140 Long Exposure | |
| 78 | + // A hillside view of an S-shaped freeway at night as a long exposure: every lane is a | |
| 79 | + // continuous ribbon, warm one way and cool the other, with brighter car heads riding the | |
| 80 | + // front of each streak over the speckled city grid. Bass thickens the ribbons, highs add | |
| 81 | + // sparkles, attacks send a bright pulse down the fast lanes. | |
| 82 | + | |
| 83 | + | |
| 84 | + // ---------------------------------------------------------------- 141 Light Cycles | |
| 85 | + constant uint drvCyclePatterns[8] = {0x0Fu, 0x33u, 0x55u, 0x3Cu, 0x5Au, 0x66u, 0x69u, 0x96u}; | |
| 86 | + // Lateral lane (in steps) of a bike at the start of cycle n: balanced 8-step blocks of | |
| 87 | + // right-angle jogs, so every position has a closed form. | |
| 88 | + float drvCycleX(float n, float seed) { | |
| 89 | + float block = floor(n / 8); | |
| 90 | + uint i = uint(n - block * 8); | |
| 91 | + uint mask = drvCyclePatterns[uint(hash11(block * 7.3 + seed) * 7.99)]; | |
| 92 | + if (hash11(block * 3.7 + seed * 1.3) > .5) mask ^= 0xFFu; | |
| 93 | + uint ones = popcount(mask & ((1u << i) - 1u)); | |
| 94 | + return float(2 * int(ones) - int(i)); | |
| 95 | + } | |
| 96 | + float3 neonTrails(Ctx c, constant NativeFrame &f) { | |
| 97 | + const float Lf = 9, M = 3.2, Lc = Lf + M, wallH = 1.1, lens = 1.5; | |
| 98 | + float progress = c.travel * 9 + c.t * 3 + c.m * 8; | |
| 99 | + float pl = progress - 7; | |
| 100 | + float nl = floor(pl / Lc); | |
| 101 | + float camX = M * mix(drvCycleX(nl, 0), drvCycleX(nl + 1, 0), smoothstep(.2f, 1.f, (pl - nl * Lc) / Lc)); | |
| 102 | + float3 ro = float3(camX, 5.4, progress * Lf / Lc - 12); | |
| 103 | + float3 forward = normalize(float3(0, -.42, 1)); | |
| 104 | + float3 rd = cameraRay(c.uv, forward, float3(0, 1, 0), lens); | |
| 105 | + float3 camU = normalize(cross(float3(0, 1, 0), forward)), camV = cross(forward, camU); | |
| 106 | + float tFloor = rd.y < 0 ? ro.y / -rd.y : 1e5; | |
| 107 | + float tTop = rd.y < 0 ? (ro.y - wallH) / -rd.y : 1e5; | |
| 108 | + float3 G = ro + rd * tFloor; | |
| 109 | + float3 T = ro + rd * tTop; | |
| 110 | + float tBest = tFloor; | |
| 111 | + float3 hitColor = 0; | |
| 112 | + float3 floorGlow = 0, halo = 0; | |
| 113 | + float width = .14 * c.size; | |
| 114 | + // Ground footprint of the part of this ray that can see a wall, its glow or its halo. | |
| 115 | + float tHalo = rd.y < 0 ? max(ro.y - wallH - 2.5, 0.f) / -rd.y : 0; | |
| 116 | + float2 traceLo = min((ro + rd * tHalo).xz, G.xz) - 5, traceHi = max((ro + rd * tHalo).xz, G.xz) + 5; | |
| 117 | + for (int b = 0; b < 5; ++b) { | |
| 118 | + float fb = float(b); | |
| 119 | + float home = (b == 0 ? 0 : (b % 2 == 1 ? -1 : 1) * (floor((fb + 1) * .5) * 3)) * M; | |
| 120 | + float pb = progress * (1 + (b == 0 ? 0 : .03 * (fb - 2.5))) + (b == 0 ? 0 : fb * 7 - 4); | |
| 121 | + float nb = floor(pb / Lc); | |
| 122 | + float rb = pb - nb * Lc; | |
| 123 | + float seed = fb * 13.1; | |
| 124 | + float3 tone = paint(fb * .25, f); | |
| 125 | + float boost = 1 + c.b[b % 4] * 1.6; | |
| 126 | + for (int k = 0; k < 6 && rd.y < 0; ++k) { | |
| 127 | + float n = nb - float(k); | |
| 128 | + float xn = home + M * drvCycleX(n, seed), xn1 = home + M * drvCycleX(n + 1, seed); | |
| 129 | + float z0 = n * Lf; | |
| 130 | + float progStart = n * Lc; | |
| 131 | + if (max(xn, xn1) < traceLo.x || min(xn, xn1) > traceHi.x || z0 + Lf < traceLo.y || z0 > traceHi.y) continue; | |
| 132 | + for (int part = 0; part < 2; ++part) { | |
| 133 | + float2 a, bb; | |
| 134 | + float len; | |
| 135 | + if (part == 0) { | |
| 136 | + float reach = k == 0 ? min(rb, Lf) : Lf; | |
| 137 | + a = float2(xn, z0); bb = float2(xn, z0 + reach); len = reach; | |
| 138 | + } else { | |
| 139 | + if (k == 0 && rb < Lf) continue; | |
| 140 | + float reach = k == 0 ? (rb - Lf) / M : 1; | |
| 141 | + a = float2(xn, z0 + Lf); bb = float2(mix(xn, xn1, reach), z0 + Lf); len = M * reach; | |
| 142 | + } | |
| 143 | + float startProg = progStart + (part == 0 ? 0 : Lf); | |
| 144 | + // Floor glow from this wall. | |
| 145 | + float2 ba = bb - a; | |
| 146 | + float hG = clamp(dot(G.xz - a, ba) / max(dot(ba, ba), 1e-4f), 0.f, 1.f); | |
| 147 | + float age = pb - (startProg + hG * len); | |
| 148 | + float bright = exp(-max(age, 0.f) / 36) * (1 - smoothstep(3.6 * Lc, 5 * Lc, age)) * boost; | |
| 149 | + float dG = length(G.xz - a - ba * hG); | |
| 150 | + floorGlow += tone * bright * exp(-dG * 1.4) * .5; | |
| 151 | + // Top face. | |
| 152 | + float hT = clamp(dot(T.xz - a, ba) / max(dot(ba, ba), 1e-4f), 0.f, 1.f); | |
| 153 | + float dT = length(T.xz - a - ba * hT); | |
| 154 | + float ageT = pb - (startProg + hT * len); | |
| 155 | + float brightT = exp(-max(ageT, 0.f) / 36) * (1 - smoothstep(3.6 * Lc, 5 * Lc, ageT)) * boost; | |
| 156 | + if (dT < width && tTop < tBest) { tBest = tTop; hitColor = tone * brightT * 2.2 + paint(.95, f) * brightT * .6; } | |
| 157 | + // Side face (vertical plane). | |
| 158 | + float denom = part == 0 ? rd.x : rd.z; | |
| 159 | + float tPlane = abs(denom) > 1e-5 ? (part == 0 ? (a.x - ro.x) / denom : (a.y - ro.z) / denom) : -1.f; | |
| 160 | + if (tPlane > 0) { | |
| 161 | + float3 P = ro + rd * tPlane; | |
| 162 | + float along = part == 0 ? P.z : P.x; | |
| 163 | + float lo = part == 0 ? min(a.y, bb.y) : min(a.x, bb.x), hi = part == 0 ? max(a.y, bb.y) : max(a.x, bb.x); | |
| 164 | + float h = P.y / wallH; | |
| 165 | + float ageP = pb - (startProg + (part == 0 ? P.z - a.y : abs(P.x - a.x))); | |
| 166 | + float brightP = exp(-max(ageP, 0.f) / 36) * (1 - smoothstep(3.6 * Lc, 5 * Lc, ageP)) * boost; | |
| 167 | + if (along > lo && along < hi && h > 0 && h < 1 && tPlane < tBest) { | |
| 168 | + tBest = tPlane; | |
| 169 | + hitColor = tone * brightP * (.35 + 1.3 * pow(h, 3.f)) + paint(.95, f) * brightP * smoothstep(.9f, 1.f, h) * .8; | |
| 170 | + } | |
| 171 | + float out = length(float2(max(max(lo - along, along - hi), 0.f), max(max(-h, h - 1), 0.f) * wallH)); | |
| 172 | + halo += tone * brightP * exp(-out * 2.2) * .12 * step(hi - lo, 1e3); | |
| 173 | + } | |
| 174 | + } | |
| 175 | + } | |
| 176 | + // Bike head glow. | |
| 177 | + float xh = home + M * mix(drvCycleX(nb, seed), drvCycleX(nb + 1, seed), saturate((rb - Lf) / M)); | |
| 178 | + float3 headP = float3(xh, .6, nb * Lf + min(rb, Lf)); | |
| 179 | + float3 v = headP - ro; | |
| 180 | + float zc = dot(v, forward); | |
| 181 | + if (zc > .5) { | |
| 182 | + float2 sp = lens * float2(dot(v, camU), dot(v, camV)) / zc; | |
| 183 | + float r = length(c.uv - sp); | |
| 184 | + halo += tone * (glow(r, .5 / zc) * 2 + exp(-r * zc * 1.2) * .5) * boost; | |
| 185 | + if (b == 0) halo += paint(.95, f) * c.hit * (exp(-abs(length(G.xz - headP.xz) - c.hit * 6) * 2) * .8 + glow(r, 1.5 / zc) * 1.5); | |
| 186 | + } | |
| 187 | + } | |
| 188 | + float3 color; | |
| 189 | + if (tBest < tFloor - 1e-3) color = hitColor; | |
| 190 | + else if (rd.y < 0) { | |
| 191 | + float fp = c.px * tFloor / lens / max(-rd.y, .15f); | |
| 192 | + float2 cell = abs(fract(G.xz / 4 + .5) - .5) * 4; | |
| 193 | + float grid = max(drvStripe(cell.x, .03, fp), drvStripe(cell.y, .03, fp)); | |
| 194 | + color = deep(.92, f) * .05 + paint(.05, f) * grid * .22 + floorGlow; | |
| 195 | + } else color = 0; | |
| 196 | + float fogK = exp(-min(tBest, tFloor) * (.008 + c.fog * .02)); | |
| 197 | + float3 sky = deep(.95, f) * .12 + paint(.55, f) * .25 * exp(-abs(rd.y) * 14) + paint(.85, f) * .03 * step(.5, fract(rd.y * 60)); | |
| 198 | + color = mix(sky, color, rd.y < 0 ? fogK : 0) + halo; | |
| 199 | + return color; | |
| 200 | + } | |
| 201 | + | |
| 202 | + // ---------------------------------------------------------------- 142 Rally Forest | |
| 203 | + // Chasing a rally car down a forest track: trunks whip past in parallax rows, sun shafts | |
| 204 | + // fall through the canopy and dust rolls back from the car. Bass kicks up the dust plume, | |
| 205 | + // highs glitter in the shafts, attacks throw mud from the rear wheels. | |
| 206 | + | |
| 207 | + | |
| 208 | + // ---------------------------------------------------------------- 143 Bridge Run | |
| 209 | + // Crossing a long suspension bridge at night: floodlit towers approach and pass, the main | |
| 210 | + // cables sweep down and up strung with lights, suspenders flick past and the skyline glows | |
| 211 | + // across the river. Bass runs a wave along the cable lights, highs twinkle the skyline, | |
| 212 | + // attacks brighten the tower beacons. | |
| 213 | + | |
| 214 | + | |
| 215 | + // ---------------------------------------------------------------- 144 Coaster Loop | |
| 216 | + // Track centreline at u from the sines/cosines of its four base phases (u * freq + phase), | |
| 217 | + // with a vertical loop and a corkscrew in every 330 m of layout. twist is the rails' extra | |
| 218 | + // roll through the corkscrew; bank is the gentle lean into turns. | |
| 219 | + constant float4 drvCoasterFreq = float4(.037, .089, .05, .12); | |
| 220 | + constant float4 drvCoasterPhase = float4(0, 1.3, .4, 2.1); | |
| 221 | + | |
| 222 | + // The second track weaves around the first's base path, crossing above and below it. | |
| 223 | + | |
| 224 | + | |
| 225 | + // A projected track sample: screen centre, screen offset to the right rail, depth, position. | |
| 226 | + struct DrvRail { float2 c; float2 o; float z; float u; }; | |
| 227 | + | |
| 228 | + // One span of twin rails, a quadratic from m0 to m1 bending toward the sample k between them | |
| 229 | + // (corner cutting keeps the curve smooth), drawn in three pieces with perspective width, a | |
| 230 | + // glossy top highlight and a glow halo. | |
| 231 | + | |
| 232 | + // A night ride on a light-show coaster: glossy twin rails outlined in palette light sweep | |
| 233 | + // far ahead as the track climbs, loops and corkscrews, while a second track weaves around | |
| 234 | + // it with its own lit train. Slim dark towers and crossties streak past and a park | |
| 235 | + // glitters far below. The camera banks gently over a level horizon. Bass chases the rail | |
| 236 | + // lights, highs sparkle them, attacks send surges of light racing along the rails. | |
| 237 | + | |
| 238 | + | |
| 239 | + // ---------------------------------------------------------------- 145 Hover Lanes | |
| 240 | + | |
| 241 | + | |
| 242 | + // ---------------------------------------------------------------- 146 Bullet Train | |
| 243 | + // A golden-hour ride on a high-speed line, seen through the side window: a graded sky with | |
| 244 | + // a low sun, hills in aerial perspective, saturated field patches, a highway whose car | |
| 245 | + // lights streak by, lit farm windows and dark hedges and catenary poles whipping past in | |
| 246 | + // the foreground. Bass shakes the fields' colour bands, highs flash the distant lights, | |
| 247 | + // attacks sweep a tunnel portal's shadow across the near field. | |
| 248 | + | |
| 249 | + | |
| 250 | + // ---------------------------------------------------------------- 147 Apex Chase | |
| 251 | + | |
| 252 | + | |
| 253 | + // ---------------------------------------------------------------- 148 Snow Drive | |
| 254 | + | |
| 255 | + | |
| 256 | + // ---------------------------------------------------------------- 149 Dashboard Glow | |
| 257 | + constant int drvDigitMasks[10] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F}; | |
| 258 | + | |
| 259 | + // One round gauge: arcs, ticks, needle. value in 0..1; redline lights the last 15% of the sweep. | |
| 260 | + | |
| 261 | + // The night road through the windshield, out of focus. | |
| 262 | + | |
| 263 | + // Car interior at night: two glowing dials with a digital readout, the steering wheel in | |
| 264 | + // silhouette and the road ahead out of focus. Needles drift on their own and follow the | |
| 265 | + // bands with Chaos; attacks light the tachometer's rev-limit arc. | |
| 266 | + | |
| 267 | + | |
| 268 | + // ---------------------------------------------------------------- 150 Midnight Skyline | |
| 269 | + | |
| 270 | + | |
| 271 | + #define DRIVE_EFFECTS(X) X(neonTrails) | |
| 272 | + DRIVE_EFFECTS(NATIVE_EFFECT) |
Sources/PulseCanvas/Resources/NativeExpansionDance.metal added
| 1 | + // Original dancing fields: geometry, local choreography and analytic lighting. | |
| 2 | + // Optional forward zoom is supplied by PulseCanvas's continuous scene compositor. | |
| 3 | + | |
| 4 | + float3 velvetSamba(Ctx c, constant NativeFrame &f) { | |
| 5 | + float2 p = c.uv / c.size; | |
| 6 | + float3 color = deep(.5, f) * .18; | |
| 7 | + for (int k = 0; k < 7; ++k) { | |
| 8 | + float layer = float(k); | |
| 9 | + float y = p.y + sin(p.x * (1.6 + layer * .12) + c.t * (.7 + layer * .08) + layer) * (.25 + c.b[k % 4] * .3); | |
| 10 | + y += sin(p.x * 4 - c.t + layer * 1.7) * .09; | |
| 11 | + float band = y - (layer - 3) * .42; | |
| 12 | + float fabric = glow(band, .085); | |
| 13 | + float stitches = pow(.5 + .5 * sin(p.x * 18 + layer * 3 + c.t), 4.f); | |
| 14 | + color += paint(layer * .13 + p.x * .04, f) * fabric * (.8 + stitches * .4); | |
| 15 | + } | |
| 16 | + return color; | |
| 17 | + } | |
| 18 | + | |
| 19 | + float3 neonCaper(Ctx c, constant NativeFrame &f) { | |
| 20 | + float2 p = c.uv * 2.2 / c.size; | |
| 21 | + float2 id = floor(p), q = fract(p) - .5; | |
| 22 | + float phase = id.x * 1.3 + id.y * 2.1; | |
| 23 | + float band = c.b[int(abs(id.x - id.y)) % 4]; | |
| 24 | + q = rot(q, c.t * .7 + phase + band * sin(phase)); | |
| 25 | + float spokes = cos(atan2(q.y, q.x) * 6 + c.t * .4); | |
| 26 | + float radius = .2 + .06 * spokes + .055 * sin(c.t * 1.5 + phase) + band * .08; | |
| 27 | + float distance = length(q) - radius; | |
| 28 | + float body = fill(distance, c.px * 2.2); | |
| 29 | + float border = glow(distance, .025); | |
| 30 | + float3 color = paint(phase * .09, f) * (body * .45 + border * 1.7); | |
| 31 | + color += paint(.7 + id.x * .08, f) * .13 * (.5 + .5 * cos(q.x * 7 + q.y * 6)); | |
| 32 | + return color; | |
| 33 | + } | |
| 34 | + | |
| 35 | + float3 carnivalPulse(Ctx c, constant NativeFrame &f) { | |
| 36 | + float2 p = rot(c.uv / c.size, c.t * .12); | |
| 37 | + float radius = length(p), angle = atan2(p.y, p.x); | |
| 38 | + float3 color = paint(.3, f) * .08; | |
| 39 | + for (int k = 0; k < 4; ++k) { | |
| 40 | + float offset = float(k) * .65; | |
| 41 | + float wave = sin(angle * (5 + float(k)) + c.t * (k % 2 == 0 ? .6 : -.5)); | |
| 42 | + float petal = radius - (.6 + offset + wave * (.16 + c.b[k] * .22)); | |
| 43 | + float fringe = .75 + .25 * sin(angle * 32 + c.t * 2 + offset); | |
| 44 | + color += paint(angle / TAU + float(k) * .2, f) * glow(petal, .08) * fringe; | |
| 45 | + } | |
| 46 | + return color + paint(radius * .16, f) * .12; | |
| 47 | + } | |
| 48 | + | |
| 49 | + float3 ribbonRumba(Ctx c, constant NativeFrame &f) { | |
| 50 | + float2 p = rot(c.uv / c.size, .4); | |
| 51 | + float3 color = deep(.1, f) * .16; | |
| 52 | + for (int k = -3; k <= 3; ++k) { | |
| 53 | + float z = float(k); | |
| 54 | + float curve = sin(p.y * 1.7 + c.t * .8 + z) * .32 + cos(p.y * 3.2 - c.t * .5 + z * 2) * .1; | |
| 55 | + float d = p.x - z * .52 - curve - c.b[(k + 4) % 4] * sin(p.y * 6 + z) * .18; | |
| 56 | + float width = .11 + .045 * cos(p.y * 2 + c.t + z); | |
| 57 | + float silk = 1 - smoothstep(width, width + c.px, abs(d)); | |
| 58 | + float shade = .4 + .6 * pow(max(0.f, 1 - abs(d) / max(.025f, width)), .7f); | |
| 59 | + color += paint(z * .12 + p.y * .05 + .5, f) * silk * shade; | |
| 60 | + color += paint(.85, f) * glow(abs(d) - width, .013) * .3; | |
| 61 | + } | |
| 62 | + return color; | |
| 63 | + } | |
| 64 | + | |
| 65 | + float3 elasticJive(Ctx c, constant NativeFrame &f) { | |
| 66 | + float2 p = c.uv * 2 / c.size; | |
| 67 | + float2 base = floor(p); | |
| 68 | + float3 color = deep(.3, f) * .22; | |
| 69 | + for (int y = -1; y <= 1; ++y) for (int x = -1; x <= 1; ++x) { | |
| 70 | + float2 id = base + float2(x, y); | |
| 71 | + float phase = dot(id, float2(1.6, 2.3)); | |
| 72 | + float band = c.b[int(abs(id.x + id.y)) % 4]; | |
| 73 | + float2 center = id + .5 + float2(sin(c.t * 1.4 + phase), cos(c.t * 1.1 - phase)) * (.1 + band * .14); | |
| 74 | + float2 q = p - center; | |
| 75 | + float ball = glow(length(q), .085 + band * .05); | |
| 76 | + float links = glow(q.y - sin(q.x * PI + c.t + phase) * (.08 + band * .12), .025) * exp(-abs(q.x) * 3); | |
| 77 | + links += glow(q.x - sin(q.y * PI - c.t + phase) * .08, .025) * exp(-abs(q.y) * 3); | |
| 78 | + color += paint(phase * .07, f) * (ball * 1.4 + links * .45); | |
| 79 | + } | |
| 80 | + return color; | |
| 81 | + } | |
| 82 | + | |
| 83 | + float3 liquidTango(Ctx c, constant NativeFrame &f) { | |
| 84 | + float2 p = c.uv * 1.8 / c.size; | |
| 85 | + float2 base = floor(p); | |
| 86 | + float field = 0, colorPhase = 0; | |
| 87 | + for (int y = -1; y <= 1; ++y) for (int x = -1; x <= 1; ++x) { | |
| 88 | + float2 id = base + float2(x, y); | |
| 89 | + float phase = dot(id, float2(1.9, .8)); | |
| 90 | + float band = c.b[int(abs(id.x * 2 + id.y)) % 4]; | |
| 91 | + float2 q = rot(p - id - .5, c.t * .65 + phase); | |
| 92 | + float orbit = .16 + .055 * sin(c.t * 1.7 + phase) + band * .09; | |
| 93 | + float left = dot(q - float2(orbit, 0), q - float2(orbit, 0)); | |
| 94 | + float right = dot(q + float2(orbit, 0), q + float2(orbit, 0)); | |
| 95 | + float contribution = .024 / (.008 + left) + .024 / (.008 + right); | |
| 96 | + field += contribution; colorPhase += phase * contribution; | |
| 97 | + } | |
| 98 | + float liquid = smoothstep(.55f, .9f, field); | |
| 99 | + float rim = glow(field - .72, .15); | |
| 100 | + float specular = pow(.5 + .5 * sin(field * 4 + p.x - p.y), 18.f) * liquid; | |
| 101 | + return paint(colorPhase / max(.1f, field) * .1, f) * (.1 + liquid * .65) + paint(.85, f) * (rim * .8 + specular); | |
| 102 | + } | |
| 103 | + | |
| 104 | + float3 prismPirouette(Ctx c, constant NativeFrame &f) { | |
| 105 | + float2 p = c.uv * 1.7 / c.size; | |
| 106 | + float2 id = floor(p), q = fract(p) - .5; | |
| 107 | + float phase = id.x * 1.7 + id.y * .8; | |
| 108 | + float band = c.b[int(abs(id.x + id.y)) % 4]; | |
| 109 | + float3 color = paint(phase * .1, f) * .12; | |
| 110 | + for (int k = 0; k < 3; ++k) { | |
| 111 | + float2 r = rot(q, c.t * (.4 + float(k) * .15) + phase + float(k) * TAU / 3); | |
| 112 | + float d = max(abs(r.x) * .866 + r.y * .5, -r.y) - (.17 + band * .06); | |
| 113 | + float shard = fill(d, c.px * 1.7) * exp(-length(r) * 1.3); | |
| 114 | + float crease = glow(r.x + r.y * .6, .018) * shard; | |
| 115 | + color += paint(float(k) * .26 + phase * .06, f) * shard * .65 + paint(.9, f) * crease * .45; | |
| 116 | + } | |
| 117 | + return color; | |
| 118 | + } | |
| 119 | + | |
| 120 | + | |
| 121 | + float3 moltenMambo(Ctx c, constant NativeFrame &f) { | |
| 122 | + float2 p = c.uv * 2 / c.size; | |
| 123 | + float carrier = p.x + sin(p.y * 1.7 + c.t * .6) * .8; | |
| 124 | + carrier += sin(p.x * 1.3 - p.y * 1.2 - c.t * .5) * .5; | |
| 125 | + carrier += c.b.x * sin(p.y * 5 + c.t) * .4 + c.b.z * sin(p.x * 7 - c.t) * .15; | |
| 126 | + float wave = sin(carrier * 4 + p.y); | |
| 127 | + float rim = pow(.5 + .5 * cos(carrier * 8 + sin(p.y * 3 + c.t)), 10.f); | |
| 128 | + float shimmer = pow(.5 + .5 * sin(carrier * 3 - p.y * 2 + c.t * .3), 8.f); | |
| 129 | + float3 color = paint(carrier * .08 + .45, f) * (.18 + (.5 + .5 * wave) * .65); | |
| 130 | + return color + paint(.95, f) * (rim * .7 + shimmer * .4); | |
| 131 | + } | |
| 132 | + | |
| 133 | + | |
| 134 | + NATIVE_EFFECT(velvetSamba) | |
| 135 | + NATIVE_EFFECT(neonCaper) | |
| 136 | + NATIVE_EFFECT(carnivalPulse) | |
| 137 | + NATIVE_EFFECT(ribbonRumba) | |
| 138 | + NATIVE_EFFECT(elasticJive) | |
| 139 | + NATIVE_EFFECT(liquidTango) | |
| 140 | + NATIVE_EFFECT(prismPirouette) | |
| 141 | + | |
| 142 | + NATIVE_EFFECT(moltenMambo) | |
| 143 | + |
Sources/PulseCanvas/Resources/NativeExpansionDrive.metal added
| 1 | + // Newly authored PulseCanvas driving studies. No preset formulas, third-party | |
| 2 | + // textures, shader translations or external implementations are used. | |
| 3 | + | |
| 4 | + struct DriveWall { float angle; float radius; float depth; float distance; float aa; }; | |
| 5 | + DriveWall driveWall(float2 p, Ctx c, float pitch) { | |
| 6 | + DriveWall w; | |
| 7 | + p /= c.size; | |
| 8 | + w.radius = max(length(p), .035f); | |
| 9 | + w.angle = atan2(p.y, p.x); | |
| 10 | + w.distance = 1 / w.radius; | |
| 11 | + w.depth = pitch * w.distance + c.travel; | |
| 12 | + w.aa = min(.3f, c.px * (1 + w.distance * w.distance)); | |
| 13 | + return w; | |
| 14 | + } | |
| 15 | + float driveStripe(float phase, float thickness, float aa) { | |
| 16 | + return 1 - smoothstep(thickness, thickness + max(.02f, aa), abs(sin(phase))); | |
| 17 | + } | |
| 18 | + | |
| 19 | + // A continuous curved motorway below a billowing sky. Four staggered lane | |
| 20 | + // markings, luminous shoulders and road ripples have independent audio inputs. | |
| 21 | + | |
| 22 | + | |
| 23 | + // Three braided track ribbons wind around an illuminated tube. The gaps reveal | |
| 24 | + // a second, counter-rotating wall of oblique seams, rather than a flat ring stack. | |
| 25 | + float3 iridescentRaceway(Ctx c, constant NativeFrame &f) { | |
| 26 | + float2 p = rot(c.uv, .12 * sin(c.t * .3)); | |
| 27 | + DriveWall w = driveWall(p, c, 2.4); | |
| 28 | + float helix = w.angle * 3 + w.depth * .8 - c.t * .35; | |
| 29 | + float ribbon = pow(.5 + .5 * cos(helix + c.b.y * sin(w.depth) * 2), 3.f); | |
| 30 | + float seam = driveStripe(w.angle * 12 - w.depth * 1.1 + c.t * .4, .06, w.aa); | |
| 31 | + float curb = driveStripe(helix, .1 + c.b.w * .09, w.aa); | |
| 32 | + float grain = .65 + .35 * sin(w.depth * 4 + sin(w.angle * 7)); | |
| 33 | + float3 color = paint((.5 + .3 * sin(w.angle)) + w.depth * .022, f) * (ribbon * (.65 + grain) + seam * .3); | |
| 34 | + color += paint(w.depth * .05 + .6, f) * curb * (1 + c.hit * .6); | |
| 35 | + return color * smoothstep(.025f, .18f, w.radius) + paint(.5, f) * .08; | |
| 36 | + } | |
| 37 | + | |
| 38 | + // Four beveled planes converge into a bending diamond gallery. Wall reflections | |
| 39 | + // move in opposite directions and diagonal braces open with the low-mid band. | |
| 40 | + float3 cobaltCatapult(Ctx c, constant NativeFrame &f) { | |
| 41 | + float2 p = rot(c.uv / c.size + float2(sin(c.t * .19), cos(c.t * .16)) * .09, PI * .25); | |
| 42 | + float radius = max(max(abs(p.x), abs(p.y)), .045f); | |
| 43 | + float depth = 2.6 / radius + c.travel * 1.8; | |
| 44 | + float face = abs(p.x) > abs(p.y) ? p.y / radius : p.x / radius; | |
| 45 | + float seam = driveStripe(depth * 1.7 + face * 2.5, .075, c.px / radius); | |
| 46 | + float diagonal = driveStripe(face * 8 + sin(depth * .3) * 2, .08 + c.b.y * .18, c.px / radius); | |
| 47 | + float bevel = pow(min(abs(p.x), abs(p.y)) / radius, 16.f); | |
| 48 | + float3 color = paint(face * .13 + depth * .02, f) * (.25 + .22 * sin(depth + face * 5)); | |
| 49 | + color += paint(.75 + depth * .03, f) * (seam * 1.3 + diagonal * .7 + bevel * .8); | |
| 50 | + return color * smoothstep(.02f, .12f, radius) + deep(.7, f) * .12; | |
| 51 | + } | |
| 52 | + | |
| 53 | + // A rocket corridor of long comet plumes. Each plume curves through its own | |
| 54 | + // arc; faded stable depth slots prevent spawning flashes during forward travel. | |
| 55 | + float3 tangerineRocket(Ctx c, constant NativeFrame &f) { | |
| 56 | + float3 color = paint(.4, f) * .08; | |
| 57 | + for (int k = 0; k < 6; ++k) { | |
| 58 | + float2 slot = layerSlot(k, 6, c.travel * .12); | |
| 59 | + float scale = layerScale(slot.x, 2.6) / c.size; | |
| 60 | + float2 p = rot(c.uv * scale, slot.y * .21 + c.t * .15); | |
| 61 | + float a = atan2(p.y, p.x), r = length(p); | |
| 62 | + float plume = driveStripe(a * 9 + r * 1.7 + sin(r + c.t * .3) + slot.y, .08 + c.b.z * .1, c.px * scale / max(.15f, r)); | |
| 63 | + float tail = pow(.5 + .5 * cos(r * 2 - c.t * .8 + slot.y), 3.f); | |
| 64 | + float arc = glow(r - (1.2 + .15 * sin(a * 6 + c.t + slot.y) + c.b[int(slot.y - 4 * floor(slot.y / 4))] * .16), .035 * c.size); | |
| 65 | + color += paint(slot.y * .12 + (.5 + .3 * sin(a)), f) * (plume * tail * .8 + arc * 1.4) * layerFade(slot.x); | |
| 66 | + } | |
| 67 | + return color; | |
| 68 | + } | |
| 69 | + | |
| 70 | + // A pentagonal acceleration chamber with alternating inset facets. Surface | |
| 71 | + // pressure deforms each angular panel; forward zoom and twist stay procedural. | |
| 72 | + float3 prismaticOverdrive(Ctx c, constant NativeFrame &f) { | |
| 73 | + DriveWall w = driveWall(c.uv, c, 1.7); | |
| 74 | + float twist = w.angle + w.depth * .22 + c.t * .12; | |
| 75 | + float panel = cos(twist * 5); | |
| 76 | + float facet = .7 + .3 * panel; | |
| 77 | + float pressure = sin(twist * 10 + w.depth * .8) * c.b.x * .55; | |
| 78 | + float ribs = driveStripe(w.depth * 2.3 + facet * 2 + pressure, .13, w.aa); | |
| 79 | + float bolts = pow(.5 + .5 * cos(twist * 20), 10.f) * pow(.5 + .5 * cos(w.depth * 4.6), 10.f); | |
| 80 | + float3 color = paint((.5 + .3 * sin(twist)) + w.depth * .015, f) * (.18 + facet * .5 + ribs * 1.3); | |
| 81 | + color += paint(.75, f) * bolts * (1 + c.b.w); | |
| 82 | + return color * smoothstep(.025f, .12f, w.radius) + deep(.8, f) * .12; | |
| 83 | + } | |
| 84 | + | |
| 85 | + // Five long ruled sails twist around a dark core. The fabric has distinct | |
| 86 | + // crosswise folds; percussion shakes individual folds rather than the camera. | |
| 87 | + float3 scarletSlipstream(Ctx c, constant NativeFrame &f) { | |
| 88 | + DriveWall w = driveWall(c.uv, c, 2.2); | |
| 89 | + float3 color = deep(.2, f) * .2; | |
| 90 | + for (int k = 0; k < 5; ++k) { | |
| 91 | + float phase = w.angle - float(k) * TAU / 5 + w.depth * (.19 + float(k) * .025) + c.t * .16; | |
| 92 | + float fold = sin(w.depth * 3 + float(k) * 1.7) * (.15 + c.b[k % 4] * .4); | |
| 93 | + float sail = glow(sin(phase) + fold, .14 * c.size) * (.5 + .5 * cos(phase)); | |
| 94 | + float weave = .7 + .3 * sin(w.depth * 9 + phase * 7); | |
| 95 | + color += paint(float(k) * .17 + w.depth * .017, f) * sail * weave; | |
| 96 | + } | |
| 97 | + return color * smoothstep(.025f, .12f, w.radius) + paint(.3, f) * .07; | |
| 98 | + } | |
| 99 | + | |
| 100 | + // Suspended twin carriageways cross a reflective valley. Rail separation is | |
| 101 | + // fixed; their banks and luminous cross ties dance to different frequency bands. | |
| 102 | + float3 laserAutobahn(Ctx c, constant NativeFrame &f) { | |
| 103 | + float2 p = c.uv / c.size; | |
| 104 | + float horizon = .28; | |
| 105 | + float z = 1.8 / max(abs(p.y - horizon), .04f) + c.travel * 2; | |
| 106 | + float x = p.x / max(abs(p.y - horizon), .04f); | |
| 107 | + float roadCenter = sin(z * .14 + c.t * .19) * 1.2; | |
| 108 | + float banks = .5 + .5 * cos(z * .6 + c.b.x * sin(x) * 2); | |
| 109 | + float rails = glow(abs(x - roadCenter) - 2.4, .14 * c.size); | |
| 110 | + float ties = driveStripe(z * 3, .075 + c.b.z * .1, c.px * z) * exp(-abs(x - roadCenter) * .35); | |
| 111 | + float mountains = .5 + .5 * sin(p.x * 3 + sin(p.x * 2 + c.t * .1)); | |
| 112 | + float3 color = paint(.8 + mountains * .15, f) * (.1 + mountains * .2); | |
| 113 | + float3 road = paint(x * .035 + z * .012, f) * (.12 + banks * .2 + rails * 1.7 + ties * .8); | |
| 114 | + return mix(color, road, smoothstep(-.05f, .05f, horizon - p.y)); | |
| 115 | + } | |
| 116 | + | |
| 117 | + // A flowing canyon seen from within. Narrow liquid strata curl around wide | |
| 118 | + // concave walls, with separate bass swells and high-frequency surface ripples. | |
| 119 | + float3 rainbowRiptide(Ctx c, constant NativeFrame &f) { | |
| 120 | + float2 p = c.uv + float2(sin(c.t * .23), cos(c.t * .17)) * .13; | |
| 121 | + DriveWall w = driveWall(p, c, 1.9); | |
| 122 | + float stream = w.depth * .55 + sin(w.angle * 3 + w.depth * .18) * 2; | |
| 123 | + stream += c.b.x * sin(w.angle * 5 + w.depth) * .6; | |
| 124 | + float ripple = sin(stream * 6 + c.b.w * sin(w.angle * 24) * 2); | |
| 125 | + float liquid = .5 + .5 * sin(stream); | |
| 126 | + float sheen = pow(max(0.f, ripple), 14.f); | |
| 127 | + float bank = .3 + .7 * pow(.5 + .5 * cos(w.angle * 2), 2.f); | |
| 128 | + float3 color = paint(stream * .035 + (.5 + .3 * sin(w.angle)), f) * (bank * .65 + liquid * .45); | |
| 129 | + color += paint(.85, f) * sheen * (.8 + c.detail); | |
| 130 | + return color * smoothstep(.025f, .14f, w.radius) + paint(.2, f) * .08; | |
| 131 | + } | |
| 132 | + | |
| 133 | + // A winding road through luminous rectangular archways. Perspective slats | |
| 134 | + // bend continuously left/right; walls carry traveling, independently pulsing bars. | |
| 135 | + float3 electricSwitchback(Ctx c, constant NativeFrame &f) { | |
| 136 | + float2 p = c.uv / c.size; | |
| 137 | + float r = max(max(abs(p.x), abs(p.y * .8)), .04f); | |
| 138 | + float z = 2 / r + c.travel * 2.4; | |
| 139 | + float curve = sin(z * .13 + c.t * .3) * .35 + sin(z * .31) * .13; | |
| 140 | + float side = p.x / r - curve; | |
| 141 | + float arch = driveStripe(z * 1.8 + sin(side * 3) * c.b.y * .25, .1, c.px / r); | |
| 142 | + float vertical = driveStripe(side * 3.5, .08, c.px / r); | |
| 143 | + float bottom = smoothstep(.1f, -.25f, p.y); | |
| 144 | + float groove = .5 + .5 * sin(z * 5 + side * 2 + c.t * .5); | |
| 145 | + float3 color = paint(side * .2 + z * .02, f) * (.18 + arch * 1.4 + vertical * .35 + bottom * groove * .25); | |
| 146 | + return color * smoothstep(.02f, .12f, r) + deep(.65, f) * .15; | |
| 147 | + } | |
| 148 | + | |
| 149 | + // A drum-machine tunnel tiled with dancing oval lamps. Each lamp has a smooth | |
| 150 | + // spatial phase and band assignment; there is no hash-based frame flicker. | |
| 151 | + float3 discoTransit(Ctx c, constant NativeFrame &f) { | |
| 152 | + DriveWall w = driveWall(rot(c.uv, c.t * .07), c, 2.3); | |
| 153 | + float column = w.angle * 8 / PI; | |
| 154 | + float row = w.depth * .7; | |
| 155 | + float2 tile = float2(column, row); | |
| 156 | + float2 id = floor(tile), local = fract(tile) - .5; | |
| 157 | + float phase = sin(id.x * TAU / 16) * 2 + id.y * 1.3; | |
| 158 | + float band = c.b[int(id.x + id.y - 4 * floor((id.x + id.y) / 4))]; | |
| 159 | + float dance = sin(c.t * 1.6 + phase) * .09; | |
| 160 | + float2 shape = (local - float2(dance, sin(c.t + phase) * .07)) / float2(.32 + band * .1, .36); | |
| 161 | + float lamp = 1 - smoothstep(.85f, 1.f, dot(shape, shape)); | |
| 162 | + float center = glow(length(shape), .25); | |
| 163 | + float joints = driveStripe(column * PI, .08, w.aa) + driveStripe(row * PI, .08, w.aa); | |
| 164 | + float3 color = paint(phase * .08 + .3, f) * (lamp * (.5 + band) + center * .7 + joints * .2 + .1); | |
| 165 | + return color * smoothstep(.02f, .13f, w.radius) + paint(.5, f) * .06; | |
| 166 | + } | |
| 167 | + | |
| 168 | + | |
| 169 | + NATIVE_EFFECT(iridescentRaceway) | |
| 170 | + NATIVE_EFFECT(cobaltCatapult) | |
| 171 | + NATIVE_EFFECT(tangerineRocket) | |
| 172 | + NATIVE_EFFECT(prismaticOverdrive) | |
| 173 | + NATIVE_EFFECT(scarletSlipstream) | |
| 174 | + NATIVE_EFFECT(laserAutobahn) | |
| 175 | + NATIVE_EFFECT(rainbowRiptide) | |
| 176 | + NATIVE_EFFECT(electricSwitchback) | |
| 177 | + NATIVE_EFFECT(discoTransit) |
Sources/PulseCanvas/Resources/NativeExpansionFestival.metal added
| 1 | + // Original PulseCanvas dancing surfaces, ribbons, assemblies and liquid forms. | |
| 2 | + | |
| 3 | + float3 radiantRondo(Ctx c, constant NativeFrame &f) { | |
| 4 | + | |
| 5 | + float2 q=c.uv*2.2/c.size, id=floor(q),p=fract(q)-.5;float phase=id.x*.9+id.y*1.3; | |
| 6 | + float a=atan2(p.y,p.x)+c.t*.4,r=length(p), band=c.b[int(abs(id.x+id.y))%4]; | |
| 7 | + float radius=.28+.045*sin(c.t*1.3+phase)+band*.08*sin(a*5+phase); | |
| 8 | + float rim=glow(r-radius,.025), hoops=glow(r-radius*.65,.018), spokes=line(sin(a*8),.06,c.px)*exp(-r*5); | |
| 9 | + return paint(phase*.1+a*.025,f)*(.14+rim+hoops*.7+spokes*.4)+deep(.5,f)*.1; | |
| 10 | + } | |
| 11 | + NATIVE_EFFECT(radiantRondo) | |
| 12 | + | |
| 13 | + float3 fuchsiaFandango(Ctx c, constant NativeFrame &f) { | |
| 14 | + | |
| 15 | + float2 p=c.uv/c.size;float3 col=deep(.5,f)*.2; | |
| 16 | + for(int k=0;k<6;++k){float y=float(k-3)*.55;float phase=c.t*.9+float(k)*1.2; | |
| 17 | + float bend=sin(p.x*2.4+phase)*(.16+c.b[k%4]*.22)+.08*sin(p.x*6-phase); | |
| 18 | + float d=p.y-y-bend;float ribbon=glow(d,.1), satin=pow(max(0.f,cos(d*15)),10.f)*exp(-abs(d)*8); | |
| 19 | + col+=paint(float(k)*.15+p.x*.03,f)*(ribbon*.7+satin*.7); | |
| 20 | + }return col; | |
| 21 | + } | |
| 22 | + NATIVE_EFFECT(fuchsiaFandango) | |
| 23 | + | |
| 24 | + float3 satinShuffle(Ctx c, constant NativeFrame &f) { | |
| 25 | + | |
| 26 | + float2 p=rot(c.uv/c.size,.22*sin(c.t*.3));float3 col=deep(.5,f)*.15; | |
| 27 | + for(int k=0;k<5;++k){float a=float(k)*PI/5, phase=c.t*.5+float(k)*.8; | |
| 28 | + float2 q=rot(p,a);float d=sin(q.x*3+phase)+q.y*.6+c.b[k%4]*sin(q.x*7-phase)*.3; | |
| 29 | + float weave=glow(d,.09), stitch=line(sin(q.y*13+phase),.055,c.px)*weave; | |
| 30 | + col+=paint(float(k)*.19+q.x*.025,f)*(weave*.85+stitch*.35); | |
| 31 | + }return col; | |
| 32 | + } | |
| 33 | + NATIVE_EFFECT(satinShuffle) | |
| 34 | + | |
| 35 | + float3 chromaticCharleston(Ctx c, constant NativeFrame &f) { | |
| 36 | + | |
| 37 | + float2 q=c.uv*3/c.size;float2 id=floor(q),p=fract(q)-.5;float phase=id.x*1.2+id.y*.8; | |
| 38 | + p=rot(p,.5*sin(c.t+phase));float band=c.b[int(abs(id.x*2+id.y))%4]; | |
| 39 | + float2 radii=float2(.13+.03*sin(c.t*1.8+phase),.29+band*.12); | |
| 40 | + float d=length(p/radii), body=fill(d-1,c.px*4), halo=glow(d-1,.12); | |
| 41 | + float seams=line(sin(p.y*30+c.t),.09,c.px*3)*body; | |
| 42 | + return paint(phase*.12,f)*(.14+body*(.65+band*.5)+halo*.5+seams*.3); | |
| 43 | + } | |
| 44 | + NATIVE_EFFECT(chromaticCharleston) | |
| 45 | + | |
| 46 | + float3 prismaticPolka(Ctx c, constant NativeFrame &f) { | |
| 47 | + | |
| 48 | + float2 q=c.uv*2.4/c.size,id=floor(q),p=fract(q)-.5;float phase=id.x*.8+id.y*1.5; | |
| 49 | + p.y-=.1*sin(c.t*1.5+phase);p=rot(p,c.t*.3+.25*sin(phase)); | |
| 50 | + float a=atan2(p.y,p.x),band=c.b[int(abs(id.x+id.y*2))%4]; | |
| 51 | + float d=length(p)*cos(fmod(a+TAU,TAU/3)-PI/3)-(.2+band*.04); | |
| 52 | + float body=fill(d,c.px*3),facet=.5+.5*cos(a*3),rim=glow(d,.025); | |
| 53 | + return paint(phase*.1+a*.04,f)*(.13+body*(.3+facet*.65)+rim*.6); | |
| 54 | + } | |
| 55 | + NATIVE_EFFECT(prismaticPolka) | |
| 56 | + | |
| 57 | + float3 neonBolero(Ctx c, constant NativeFrame &f) { | |
| 58 | + | |
| 59 | + float2 p=c.uv/c.size;float3 col=deep(.4,f)*.18; | |
| 60 | + for(int k=0;k<5;++k){float2 q=rot(p,c.t*.13+float(k)*.37);q+=float2(sin(c.t*.4+float(k)),cos(c.t*.3+float(k)))*.2; | |
| 61 | + float2 tile=fract(q*(1.3+float(k)*.25))-.5;float d=sdBox2(tile,float2(.32,.22)+c.b[k%4]*.025); | |
| 62 | + float rim=glow(d,.016), cross=line(tile.x+tile.y,.02,c.px)*fill(d,c.px); | |
| 63 | + col+=paint(float(k)*.19+q.x*.02,f)*(rim*.6+cross*.18); | |
| 64 | + }return col; | |
| 65 | + } | |
| 66 | + NATIVE_EFFECT(neonBolero) | |
| 67 | + | |
| 68 | + float3 pearlescentSwing(Ctx c, constant NativeFrame &f) { | |
| 69 | + | |
| 70 | + float2 q=c.uv*2.1/c.size,id=floor(q);float3 col=paint(.6,f)*.12; | |
| 71 | + for(int y=-1;y<=1;++y)for(int x=-1;x<=1;++x){float2 cell=id+float2(x,y);float ph=cell.x*1.1+cell.y*.7; | |
| 72 | + float2 orbit=float2(cos(c.t*.8+ph),sin(c.t*.8+ph))*float2(.28,.16);float2 p=q-cell-.5-orbit; | |
| 73 | + float band=c.b[int(abs(cell.x+cell.y))%4],r=.22+band*.08; | |
| 74 | + float sphere=fill(length(p)-r,c.px*2),normal=sqrt(max(0.f,1-dot(p,p)/(r*r))); | |
| 75 | + float spec=pow(max(0.f,normal*.85-p.x*.5+p.y*.3),18.f); | |
| 76 | + col+=paint(ph*.15,f)*sphere*(.3+normal*.5)+paint(.9,f)*spec*sphere*.7; | |
| 77 | + }return col; | |
| 78 | + } | |
| 79 | + NATIVE_EFFECT(pearlescentSwing) | |
| 80 | + | |
| 81 | + float3 solarSway(Ctx c, constant NativeFrame &f) { | |
| 82 | + | |
| 83 | + float2 p=c.uv/c.size;float sun=sin(p.x*3+sin(p.y*2+c.t*.6)*1.6); | |
| 84 | + sun+=.7*cos(p.y*4-sin(p.x*2-c.t*.4))+c.b.x*sin(p.x*7+p.y*5)*.8; | |
| 85 | + float waves=.5+.5*sin(sun*3), veins=line(sin(sun*6+p.x*2),.09,c.px*6); | |
| 86 | + float gleam=pow(max(0.f,cos(sun*3)),14.f); | |
| 87 | + return paint(sun*.12+p.x*.025,f)*(.2+waves*.6+veins*.4)+paint(.85,f)*gleam*.85; | |
| 88 | + } | |
| 89 | + NATIVE_EFFECT(solarSway) | |
| 90 | + | |
| 91 | + float3 liquidLimbo(Ctx c, constant NativeFrame &f) { | |
| 92 | + | |
| 93 | + float2 p=c.uv*2/c.size;float wave=sin(p.y*1.7+c.t*.7)*(.35+c.b.x*.4); | |
| 94 | + p.x+=wave; p.y+=sin(p.x*1.9-c.t*.5)*(.2+c.b.y*.3); | |
| 95 | + float tile=sin(p.x*PI)*sin(p.y*PI),facet=.5+.5*tanh(tile*4); | |
| 96 | + float seam=glow(tile,.065),glass=pow(.5+.5*cos(p.x*2.5+p.y*1.8),10.f); | |
| 97 | + return paint(facet*.5+p.y*.025,f)*(.2+facet*.55+seam*.7)+paint(.9,f)*glass*.65; | |
| 98 | + } | |
| 99 | + NATIVE_EFFECT(liquidLimbo) | |
| 100 | + | |
| 101 | + float3 violetVogue(Ctx c, constant NativeFrame &f) { | |
| 102 | + | |
| 103 | + float2 p=c.uv/c.size;float3 col=deep(.6,f)*.18; | |
| 104 | + for(int k=0;k<8;++k){float phase=float(k)*.85+c.t*.6;float center=sin(p.y*1.4+phase)*.5+float(k-4)*.35; | |
| 105 | + center+=c.b[k%4]*sin(p.y*4-phase)*.17;float d=p.x-center; | |
| 106 | + float silk=glow(d,.08),pleat=.5+.5*sin(d*18+p.y*3+phase); | |
| 107 | + float stitch=line(sin(p.y*16+phase),.07,c.px)*silk; | |
| 108 | + col+=paint(float(k)*.13+p.y*.03,f)*(silk*(.35+pleat*.5)+stitch*.2); | |
| 109 | + }return col; | |
| 110 | + } | |
| 111 | + NATIVE_EFFECT(violetVogue) | |
| 112 | + | |
| 113 | + float3 discoRipple(Ctx c, constant NativeFrame &f) { | |
| 114 | + | |
| 115 | + float2 p=c.uv/c.size;float3 col=deep(.5,f)*.15; | |
| 116 | + for(int k=0;k<5;++k){float phase=float(k)*TAU/5;float2 origin=float2(cos(phase+c.t*.2),sin(phase-c.t*.15))*.8; | |
| 117 | + float r=length(p-origin);float wave=sin(r*(7+float(k))-c.t*(1.2+float(k)*.2)); | |
| 118 | + wave+=c.b[k%4]*sin(r*18+phase)*.6;float rim=glow(wave,.07), ripple=.5+.5*wave; | |
| 119 | + col+=paint(float(k)*.17+r*.02,f)*(rim*.55+ripple*.12)*exp(-r*.35); | |
| 120 | + }return col; | |
| 121 | + } | |
| 122 | + NATIVE_EFFECT(discoRipple) | |
| 123 | + | |
| 124 | + float3 gildedGroove(Ctx c, constant NativeFrame &f) { | |
| 125 | + | |
| 126 | + float2 p=c.uv/c.size;float3 col=deep(.5,f)*.2; | |
| 127 | + for(int k=0;k<6;++k){float phase=float(k)*PI/3;float center=sin(p.x*2+c.t*.7+phase)*.45+cos(p.x*.9-c.t*.4+phase)*.3; | |
| 128 | + float d=p.y-float(k-3)*.28-center-c.b[k%4]*sin(p.x*5+phase)*.16; | |
| 129 | + float gold=glow(d,.045),filament=glow(d-.09,.012),shadow=glow(d+.06,.1)*.2; | |
| 130 | + col+=paint(float(k)*.15+p.x*.02,f)*(gold*.9+filament*.65+shadow); | |
| 131 | + }return col; | |
| 132 | + } | |
| 133 | + NATIVE_EFFECT(gildedGroove) | |
| 134 | + | |
| 135 | + float3 auroraWaltz(Ctx c, constant NativeFrame &f) { | |
| 136 | + | |
| 137 | + float2 q=c.uv*2.4/c.size;float4 h=hexCell(q);float2 p=rot(h.xy,c.t*.2+h.z*.8); | |
| 138 | + float a=atan2(p.y,p.x),r=length(p), band=c.b[int(abs(h.z+h.w))%4]; | |
| 139 | + float flower=r-(.28+.055*cos(a*3+c.t*.7)+band*.06*sin(a*6)); | |
| 140 | + float petal=fill(flower,c.px*2),vein=line(sin(a*3),.06,c.px*2)*petal; | |
| 141 | + float highlight=pow(max(0.f,1-r*2),6.f); | |
| 142 | + return paint(h.z*.12+h.w*.09+a*.035,f)*(.13+petal*.55+vein*.35)+paint(.85,f)*highlight*.6; | |
| 143 | + } | |
| 144 | + NATIVE_EFFECT(auroraWaltz) | |
| 145 | + | |
| 146 | + float3 elasticAnthem(Ctx c, constant NativeFrame &f) { | |
| 147 | + | |
| 148 | + float2 q=c.uv*2.3/c.size;float4 v=voronoi(q,.85,c.t*.8); | |
| 149 | + float band=c.b[int(abs(v.z*2+v.w))%4],membrane=glow(v.y-v.x,.055+band*.05); | |
| 150 | + float bubble=exp(-v.x*v.x*(5+band*3)),rim=glow(v.x-.25-band*.05,.04); | |
| 151 | + float flow=.5+.5*sin(q.x*3+q.y*2+c.t*.4); | |
| 152 | + return paint(v.z*.16+v.w*.09,f)*(.14+membrane*.9+bubble*.45+rim*.4)+paint(.85,f)*bubble*flow*.2; | |
| 153 | + } | |
| 154 | + NATIVE_EFFECT(elasticAnthem) | |
| 155 | + | |
| 156 | + float3 crimsonCadence(Ctx c, constant NativeFrame &f) { | |
| 157 | + | |
| 158 | + float2 q=c.uv*1.8/c.size,id=floor(q),p=fract(q)-.5;float phase=id.x*.7+id.y*1.4; | |
| 159 | + float a=atan2(p.y,p.x)+c.t*.4+.15*sin(phase),r=length(p),band=c.b[int(abs(id.x+id.y))%4]; | |
| 160 | + float fan=pow(.5+.5*cos(a*9+r*5),3.f);float disc=fill(r-.43,c.px*2); | |
| 161 | + float ribs=line(sin(a*18+r*3+band*sin(a*9)),.075,c.px*3)*disc; | |
| 162 | + return paint(phase*.12+a*.03,f)*(.13+fan*disc*.65+ribs*.5)+paint(.85,f)*glow(r-.43,.025)*.6; | |
| 163 | + } | |
| 164 | + NATIVE_EFFECT(crimsonCadence) | |
| 165 | + | |
| 166 | + float3 sapphireStomp(Ctx c, constant NativeFrame &f) { | |
| 167 | + | |
| 168 | + float2 p=c.uv*2/c.size;float row=floor(p.y),y=fract(p.y)-.5; | |
| 169 | + float phase=c.t*.8+row*1.4,band=c.b[int(abs(row))%4]; | |
| 170 | + float zig=abs(fract(p.x*.8+phase*.15)-.5)*2-.5; | |
| 171 | + float wave=y-zig*(.4+band*.35)-.1*sin(p.x*5-phase); | |
| 172 | + float ridge=glow(wave,.07),face=exp(-abs(wave+.15)*4), seam=line(sin(p.x*PI*1.6+phase*.3),.07,c.px)*face; | |
| 173 | + return paint(row*.16+p.x*.035,f)*(.14+ridge+face*.45+seam*.35); | |
| 174 | + } | |
| 175 | + NATIVE_EFFECT(sapphireStomp) | |
| 176 | + | |
| 177 | + float3 coralCrescendo(Ctx c, constant NativeFrame &f) { | |
| 178 | + | |
| 179 | + float2 q=c.uv*1.7/c.size;float4 h=hexCell(q);float3 col=paint(h.z*.12+h.w*.08,f)*.15; | |
| 180 | + for(int k=0;k<6;++k){float a=float(k)*PI/3+c.t*.35+h.z*.4,band=c.b[k%4]; | |
| 181 | + float orbit=.29+.025*sin(c.t+h.w)+band*.04;float2 center=float2(cos(a),sin(a))*orbit; | |
| 182 | + float r=.115+band*.035,d=length(h.xy-center)-r; | |
| 183 | + float sphere=fill(d,c.px*2),normal=sqrt(max(0.f,1-pow(length(h.xy-center)/r,2.f))); | |
| 184 | + col+=paint(float(k)*.16+h.z*.1,f)*sphere*(.3+normal*.6)+paint(.85,f)*glow(d,.015)*.3; | |
| 185 | + }return col; | |
| 186 | + } | |
| 187 | + NATIVE_EFFECT(coralCrescendo) | |
| 188 | + | |
| 189 | + float3 electricEncore(Ctx c, constant NativeFrame &f) { | |
| 190 | + | |
| 191 | + float2 q=c.uv*2.6/c.size; | |
| 192 | + q+=float2(sin(q.y*1.4+c.t*.6),cos(q.x*1.6-c.t*.5))*(.18+c.b.y*.35); | |
| 193 | + float2 id=floor(q),p=fract(q)-.5;float phase=id.x*.7+id.y*1.1; | |
| 194 | + float wires=line(min(abs(p.x),abs(p.y)),.025,c.px*3),diagonal=line(p.x+p.y,.02,c.px*3); | |
| 195 | + float node=glow(length(p),.1+c.b[int(abs(id.x+id.y))%4]*.04); | |
| 196 | + float charge=.4+.6*pow(.5+.5*sin(phase+c.t*1.1),4.f); | |
| 197 | + return paint(phase*.12,f)*(.14+wires*.6+diagonal*.25+node*charge); | |
| 198 | + } | |
| 199 | + NATIVE_EFFECT(electricEncore) | |
| 200 | + | |
| 201 | + float3 luminousLockstep(Ctx c, constant NativeFrame &f) { | |
| 202 | + | |
| 203 | + float2 q=rot(c.uv*2/c.size,.12*sin(c.t*.3)),id=floor(q),p=fract(q)-.5; | |
| 204 | + float phase=id.x*.8+id.y*1.2,band=c.b[int(abs(id.x*2+id.y))%4]; | |
| 205 | + p=rot(p,.3*sin(c.t*.8+phase));float kite=abs(p.x)*1.3+abs(p.y)-(.42+band*.055); | |
| 206 | + float body=fill(kite,c.px*3),crease=line(p.x,.02,c.px*3)*body; | |
| 207 | + float facet=.3+.6*saturate(.5+p.x*1.7-p.y*.5),rim=glow(kite,.02); | |
| 208 | + return paint(phase*.14+p.x*.08,f)*(.14+body*facet+crease*.4+rim*.55); | |
| 209 | + } | |
| 210 | + NATIVE_EFFECT(luminousLockstep) | |
| 211 | + | |
| 212 | + float3 festivalFinale(Ctx c, constant NativeFrame &f) { | |
| 213 | + | |
| 214 | + float2 p=c.uv/c.size;float3 col=deep(.5,f)*.16; | |
| 215 | + for(int k=0;k<4;++k){float phase=float(k)*PI*.5;float2 q=rot(p,phase+c.t*.1); | |
| 216 | + float wave=sin(q.x*2.5+sin(q.y*1.7+c.t*.5+phase)*1.3)+cos(q.y*3-c.t*.7+phase); | |
| 217 | + wave+=c.b[k]*sin(q.x*7-q.y*4)*.65;float ribbon=glow(wave,.12),core=pow(max(0.f,cos(wave*4)),12.f); | |
| 218 | + col+=paint(float(k)*.23+wave*.05,f)*(ribbon*.65+core*.25); | |
| 219 | + }return col; | |
| 220 | + } | |
| 221 | + NATIVE_EFFECT(festivalFinale) |
Sources/PulseCanvas/Resources/NativeExpansionVoyage.metal added
| 1 | + // Original PulseCanvas forward-motion scenes, authored from geometry and surface math. | |
| 2 | + | |
| 3 | + float3 fuchsiaFlyway(Ctx c, constant NativeFrame &f) { | |
| 4 | + | |
| 5 | + float2 p=c.uv/c.size; float h=.35, d=max(h-p.y,.035f), z=2/d+c.travel*2.4; | |
| 6 | + float x=p.x/d-.6*sin(z*.13+c.t*.2); | |
| 7 | + float road=exp(-pow(x*.3,4.f)), rails=glow(abs(x)-3.2,.11); | |
| 8 | + float cable=glow(abs(x)-3.7-(.6+.5*cos(z*.7)),.08); | |
| 9 | + float posts=line(sin(z*1.4),.08,c.px/d)*smoothstep(2.8f,3.2f,abs(x)); | |
| 10 | + float3 ground=paint(.15+z*.023,f)*(.17*road+rails*1.8+cable+posts*.5); | |
| 11 | + ground+=paint(.85,f)*road*pow(.5+.5*cos(z*3+x*.7+c.b.x*sin(x)*2),6.f)*.3; | |
| 12 | + float sky=.5+.5*sin(p.x*2+sin(p.y*3+c.t*.3)); | |
| 13 | + return mix(paint(.6+sky*.15,f)*(.15+sky*.3),ground,smoothstep(-.03f,.04f,h-p.y)); | |
| 14 | + } | |
| 15 | + NATIVE_EFFECT(fuchsiaFlyway) | |
| 16 | + | |
| 17 | + float3 amberAqueduct(Ctx c, constant NativeFrame &f) { | |
| 18 | + | |
| 19 | + float2 p=c.uv/c.size; float r=max(length(p*float2(1,.6)),.06f), z=2.4/r+c.travel*1.8; | |
| 20 | + float a=atan2(p.y*.6,p.x), wave=sin(z*1.7+a*5+c.t*.6); | |
| 21 | + float channel=pow(.5+.5*cos(a*2),4.f), bricks=line(sin(z*3+cos(a*6)),.13,c.px/r); | |
| 22 | + float water=.5+.5*sin(z*.8+sin(a*4+z*.2)*2+c.b.x*sin(a*9)); | |
| 23 | + float3 col=paint((.5+.3*sin(a))+z*.012,f)*(.25+channel*.45+bricks*.8); | |
| 24 | + col+=paint(.8+water*.1,f)*pow(max(0.f,wave),12.f)*(1+c.b.w)*.8; | |
| 25 | + return col*smoothstep(.025f,.18f,r)+deep(.5,f)*.08; | |
| 26 | + } | |
| 27 | + NATIVE_EFFECT(amberAqueduct) | |
| 28 | + | |
| 29 | + float3 photonOverpass(Ctx c, constant NativeFrame &f) { | |
| 30 | + | |
| 31 | + float3 col=deep(.4,f)*.1; | |
| 32 | + for(int k=0;k<5;++k){float2 s=layerSlot(k,5,c.travel*.15); float sc=layerScale(s.x,3)/c.size; | |
| 33 | + float2 p=rot(c.uv*sc,.5*sin(c.t*.2)+s.y*.38); float arc=p.y-.4*sin(p.x*1.3+s.y); | |
| 34 | + float ribbon=glow(arc,.22), curb=glow(abs(arc)-.3,.025); | |
| 35 | + float dash=pow(.5+.5*cos(p.x*5+s.y+c.t*.7),5.f); | |
| 36 | + col+=paint(s.y*.18+p.x*.025,f)*(ribbon*(.35+dash*.55)+curb*1.7)*(1+c.b[int(s.y-4*floor(s.y/4))]*.5)*layerFade(s.x); | |
| 37 | + }return col; | |
| 38 | + } | |
| 39 | + NATIVE_EFFECT(photonOverpass) | |
| 40 | + | |
| 41 | + float3 indigoEscalator(Ctx c, constant NativeFrame &f) { | |
| 42 | + | |
| 43 | + float2 p=rot(c.uv/c.size,.12*sin(c.t*.2)); float d=max(.4-p.y,.035f), z=2.3/d+c.travel*2; | |
| 44 | + float x=p.x/d, step=fract(z*.8), edge=line(sin(z*.8*PI),.06,c.px/(d*d)); | |
| 45 | + float groove=line(sin(x*4),.035,c.px/d), rail=glow(abs(x)-4,.15); | |
| 46 | + float3 floor=paint(z*.04+x*.035,f)*(.22+step*.4+edge*.8+groove*.3+rail*1.6); | |
| 47 | + floor+=paint(.75,f)*pow(max(0.f,cos(x*2+z*3+c.b.y*sin(x))),12.f)*.45; | |
| 48 | + return mix(paint(.7+sin(p.x+c.t*.2)*.1,f)*.2,floor,smoothstep(-.03f,.04f,.4-p.y)); | |
| 49 | + } | |
| 50 | + NATIVE_EFFECT(indigoEscalator) | |
| 51 | + | |
| 52 | + float3 solarSlalom(Ctx c, constant NativeFrame &f) { | |
| 53 | + | |
| 54 | + float2 p=c.uv/c.size; float d=max(.3-p.y,.04f), z=2/d+c.travel*2.3; | |
| 55 | + float lane=p.x/d-1.5*sin(z*.3+c.t*.3), rip=.5+.5*sin(z*2.4+lane*1.4+c.b.x*sin(lane)*2); | |
| 56 | + float stripe=glow(abs(lane)-2,.18), gates=line(sin(z*2),.08,c.px/d)*glow(abs(lane)-2.6,.35); | |
| 57 | + float chevron=line(sin(z*4-abs(lane)*1.6),.09+c.b.w*.1,c.px/d); | |
| 58 | + float3 floor=paint(lane*.045+z*.019,f)*(.18+rip*.5+stripe+gates+chevron*.5); | |
| 59 | + float3 sky=paint(.7+p.y*.05,f)*(.2+.15*sin(p.x*3+p.y*2+c.t*.2)); | |
| 60 | + return mix(sky,floor,smoothstep(-.03f,.03f,.3-p.y)); | |
| 61 | + } | |
| 62 | + NATIVE_EFFECT(solarSlalom) | |
| 63 | + | |
| 64 | + float3 glacialSprint(Ctx c, constant NativeFrame &f) { | |
| 65 | + | |
| 66 | + float2 p=rot(c.uv/c.size,c.t*.08); float r=max(max(abs(p.x),abs(p.y)),.05f), z=2/r+c.travel*1.7; | |
| 67 | + float wall=(abs(p.x)>abs(p.y)?p.y:p.x)/r; float crevice=abs(sin(wall*6+sin(z*.7)*1.6+c.b.y*sin(wall*9))); | |
| 68 | + float crystal=pow(.5+.5*cos(z*3.5+wall*4),3.f); | |
| 69 | + float joint=line(sin(z*2+floor(wall*3)),.1,c.px/r); | |
| 70 | + float3 col=paint(.55+wall*.12+z*.016,f)*(.25+crystal*.65+joint*.6); | |
| 71 | + col+=paint(.85,f)*glow(crevice,.045)*1.6; | |
| 72 | + return col*smoothstep(.03f,.15f,r)+deep(.6,f)*.08; | |
| 73 | + } | |
| 74 | + NATIVE_EFFECT(glacialSprint) | |
| 75 | + | |
| 76 | + float3 velvetVoyage(Ctx c, constant NativeFrame &f) { | |
| 77 | + | |
| 78 | + float2 p=c.uv/c.size; float r=max(length(p),.05f), a=atan2(p.y,p.x), z=2/r+c.travel*2; | |
| 79 | + float fabric=sin(a*4+z*.65+c.t*.3)+.35*sin(a*11-z*.4+c.b.y*sin(z)*2); | |
| 80 | + float folds=.5+.5*sin(fabric*4+z*.2), fringe=line(sin(a*12+z*.5),.06,c.px/r); | |
| 81 | + float sheen=pow(max(0.f,cos(fabric*4+z*.2)),8.f); | |
| 82 | + float3 col=paint(fabric*.11+z*.012,f)*(.15+folds*.65+fringe*.3); | |
| 83 | + col+=paint(.9,f)*sheen*(.6+c.b.w*.5); | |
| 84 | + return col*smoothstep(.02f,.13f,r)+deep(.4,f)*.1; | |
| 85 | + } | |
| 86 | + NATIVE_EFFECT(velvetVoyage) | |
| 87 | + | |
| 88 | + float3 plasmaRally(Ctx c, constant NativeFrame &f) { | |
| 89 | + | |
| 90 | + float2 p=rot(c.uv/c.size,c.t*.09); float r=max(length(p),.05f), a=atan2(p.y,p.x), z=2.1/r+c.travel*2; | |
| 91 | + float2 tile=float2(a*6/PI+z*.08,z*.7); float4 cell=hexCell(tile); | |
| 92 | + float rim=line(sdHex(cell.xy,.48),.05+c.b.w*.035,c.px/r*1.2); | |
| 93 | + float panel=exp(-dot(cell.xy,cell.xy)*5)*(.5+.5*sin(cell.z*.8+cell.w*.6+c.t)); | |
| 94 | + float ion=glow(sin(a*3+z*.45),.11); | |
| 95 | + float3 col=paint(.3*sin(cell.z*TAU/12)+cell.w*.08,f)*(.14+rim+panel*.6+ion*.7); | |
| 96 | + return col*smoothstep(.03f,.16f,r)+paint(.6,f)*.08; | |
| 97 | + } | |
| 98 | + NATIVE_EFFECT(plasmaRally) | |
| 99 | + | |
| 100 | + float3 crystalCauseway(Ctx c, constant NativeFrame &f) { | |
| 101 | + | |
| 102 | + float2 p=c.uv/c.size; float d=max(.45-p.y,.05f), z=1.8/d+c.travel*1.7; | |
| 103 | + float2 q=float2(p.x/d,z); q.x+=sin(q.y*.2+c.t*.3)*.6; | |
| 104 | + float2 cell=floor(q), l=fract(q); float diagonal=abs(l.x+l.y-1); | |
| 105 | + float facet=l.x+l.y<1 ? l.x : 1-l.y; float linework=line(diagonal,.035,c.px/d); | |
| 106 | + float seams=line(min(min(l.x,1-l.x),min(l.y,1-l.y)),.025,c.px/d); | |
| 107 | + float3 floor=paint(cell.x*.09+cell.y*.05,f)*(.2+facet*.7+linework*.6+seams*.5); | |
| 108 | + floor+=paint(.9,f)*pow(.5+.5*sin(cell.x*1.3+cell.y+c.t*.6),8.f)*c.b.x*.8; | |
| 109 | + return mix(paint(.7+sin(p.x+c.t*.1)*.15,f)*.23,floor,smoothstep(-.03f,.05f,.45-p.y)); | |
| 110 | + } | |
| 111 | + NATIVE_EFFECT(crystalCauseway) | |
| 112 | + | |
| 113 | + float3 luminousLift(Ctx c, constant NativeFrame &f) { | |
| 114 | + | |
| 115 | + float2 p=rot(c.uv/c.size,.18*sin(c.t*.2)); float d=max(abs(p.x),.045f), z=2/d+c.travel*1.8; | |
| 116 | + float vertical=p.y/d, q=z*.6+vertical*.25; float pane=line(sin(q*PI),.07,c.px/d); | |
| 117 | + float beam=glow(sin(vertical*2-c.t*.4),.12), step=.5+.5*cos(q*TAU+sin(vertical*3)*c.b.y); | |
| 118 | + float3 col=paint(z*.025+vertical*.05,f)*(.22+step*.25+pane*.95+beam*.7); | |
| 119 | + float central=exp(-abs(p.x)*5); | |
| 120 | + return col*(1-central*.7)+paint(.8,f)*central*.18; | |
| 121 | + } | |
| 122 | + NATIVE_EFFECT(luminousLift) | |
| 123 | + | |
| 124 | + float3 arcJetstream(Ctx c, constant NativeFrame &f) { | |
| 125 | + | |
| 126 | + float3 col=paint(.4,f)*.12; | |
| 127 | + for(int k=0;k<7;++k){float2 s=layerSlot(k,7,c.travel*.13); float scale=layerScale(s.x,2.8)/c.size; | |
| 128 | + float2 p=rot(c.uv*scale,.18*sin(s.y*.7+c.t*.3)); | |
| 129 | + float wave=p.y-.45*sin(s.y*.83)-.35*sin(p.x*.9+c.t*.8+s.y); | |
| 130 | + float trail=glow(wave,.045+.07*c.b[int(s.y-4*floor(s.y/4))]), broad=glow(wave,.25)*.2; | |
| 131 | + float streak=.3+.7*pow(.5+.5*cos(p.x*3+s.y*1.8),4.f); | |
| 132 | + col+=paint(s.y*.16+p.x*.025,f)*(trail*streak*2+broad)*layerFade(s.x); | |
| 133 | + }return col; | |
| 134 | + } | |
| 135 | + NATIVE_EFFECT(arcJetstream) | |
| 136 | + | |
| 137 | + float3 rubyRollway(Ctx c, constant NativeFrame &f) { | |
| 138 | + | |
| 139 | + float2 p=c.uv/c.size; float d=max(.5-p.y,.04f), z=2/d+c.travel*2; | |
| 140 | + float x=p.x/d+.6*sin(z*.18), row=z*.9; float roller=cos(row*TAU), seam=line(sin(row*PI),.045,c.px/d); | |
| 141 | + float teeth=pow(.5+.5*cos(x*6+c.t*.6),5.f), band=glow(abs(x)-3.5,.13); | |
| 142 | + float3 floor=paint(z*.025+x*.05,f)*(.18+.6*max(0.f,roller)+teeth*.25+band*1.4); | |
| 143 | + floor+=paint(.85,f)*(seam+.3*pow(max(0.f,roller),12.f))*(1+c.b.x*.6); | |
| 144 | + return mix(paint(.7,f)*(.22+.1*sin(p.x*3+c.t*.3)),floor,smoothstep(-.04f,.04f,.5-p.y)); | |
| 145 | + } | |
| 146 | + NATIVE_EFFECT(rubyRollway) | |
| 147 | + | |
| 148 | + float3 neonRegatta(Ctx c, constant NativeFrame &f) { | |
| 149 | + | |
| 150 | + float2 p=c.uv/c.size; float d=max(.15-p.y,.045f), z=1.6/d+c.travel*2; | |
| 151 | + float x=p.x/d; float wake=sin(z*2-abs(x)*2.6+c.b.x*sin(x)*2), wave=sin(x*1.5+z*.9+c.t*.5); | |
| 152 | + float foam=pow(max(0.f,wake),10.f), spec=pow(max(0.f,cos(wave*3)),12.f); | |
| 153 | + float buoys=glow(abs(x)-3,.17)*pow(.5+.5*cos(z*3),7.f); | |
| 154 | + float3 water=paint(z*.016+x*.03,f)*(.2+(.5+.5*wave)*.35+foam*.8+spec*.5+buoys); | |
| 155 | + float3 sky=paint(.65+p.x*.02,f)*(.16+.2*pow(.5+.5*sin(p.x+p.y*3+c.t*.1),3.f)); | |
| 156 | + return mix(sky,water,smoothstep(-.03f,.05f,.15-p.y)); | |
| 157 | + } | |
| 158 | + NATIVE_EFFECT(neonRegatta) | |
| 159 | + | |
| 160 | + float3 radiantRunway(Ctx c, constant NativeFrame &f) { | |
| 161 | + | |
| 162 | + float2 p=c.uv/c.size; float d=max(.2-p.y,.04f), z=2/d+c.travel*3; | |
| 163 | + float x=p.x/d, linework=glow(x,.035)*pow(.5+.5*cos(z*4),6.f); | |
| 164 | + float lamps=glow(abs(x)-3,.13)*pow(.5+.5*cos(z*2.5),12.f); | |
| 165 | + float tarmac=exp(-pow(x*.24,4.f)); | |
| 166 | + float3 floor=paint(z*.013,f)*(.2*tarmac+linework*2+lamps*2.5); | |
| 167 | + floor+=paint(.85,f)*tarmac*pow(.5+.5*sin(z*1.1+x*3+c.b.y),8.f)*.35; | |
| 168 | + float cloud=.5+.5*sin(p.x*2+sin(p.y*3+c.t*.3)); | |
| 169 | + return mix(paint(.65+cloud*.2,f)*(.15+cloud*.3),floor,smoothstep(-.03f,.05f,.2-p.y)); | |
| 170 | + } | |
| 171 | + NATIVE_EFFECT(radiantRunway) | |
| 172 | + | |
| 173 | + float3 electricViaduct(Ctx c, constant NativeFrame &f) { | |
| 174 | + | |
| 175 | + float2 p=c.uv/c.size; float r=max(length(p*float2(.8,1)),.05f), z=2.3/r+c.travel*2.3; | |
| 176 | + float a=atan2(p.y,p.x*.8), ribs=line(sin(z*1.8+.8*cos(a*2)),.085,c.px/r); | |
| 177 | + float span=glow(sin(a*4+z*.16+c.t*.2),.075+c.b.w*.04); | |
| 178 | + float window=pow(.5+.5*cos(a*8),5.f)*pow(.5+.5*cos(z*3.6),4.f); | |
| 179 | + float3 col=paint((.5+.3*sin(a))+z*.02,f)*(.22+ribs+span*.8+window*.6); | |
| 180 | + return col*smoothstep(.025f,.15f,r)+deep(.7,f)*.08; | |
| 181 | + } | |
| 182 | + NATIVE_EFFECT(electricViaduct) | |
| 183 | + | |
| 184 | + float3 orbitExpress(Ctx c, constant NativeFrame &f) { | |
| 185 | + | |
| 186 | + float3 col=deep(.5,f)*.18; | |
| 187 | + for(int k=0;k<8;++k){float2 s=layerSlot(k,8,c.travel*.15); float sc=layerScale(s.x,3.2)/c.size; | |
| 188 | + float2 p=rot(c.uv*sc-float2(sin(s.y*.3),cos(s.y*.5))*.25,s.y*.4+c.t*.15); | |
| 189 | + float orbit=length(p/float2(1.4,.8))-(1.3+.12*c.b[int(s.y-4*floor(s.y/4))]*sin(atan2(p.y,p.x)*5)); | |
| 190 | + float rim=glow(orbit,.06), studs=pow(.5+.5*cos(atan2(p.y,p.x)*16+s.y+c.t*.4),8.f); | |
| 191 | + col+=paint(s.y*.13,f)*(rim*(.8+studs*1.2)+glow(orbit,.25)*.18)*layerFade(s.x); | |
| 192 | + }return col; | |
| 193 | + } | |
| 194 | + NATIVE_EFFECT(orbitExpress) | |
| 195 | + | |
| 196 | + float3 moltenHighway(Ctx c, constant NativeFrame &f) { | |
| 197 | + | |
| 198 | + float2 p=c.uv/c.size; float d=max(.35-p.y,.04f), z=1.9/d+c.travel*2; | |
| 199 | + float2 q=float2(p.x/d,z); float lava=sin(q.x*2+sin(q.y*.9)*2)+cos(q.y*2+sin(q.x)); | |
| 200 | + lava+=c.b.x*sin(q.x*4+q.y)*.65; float crust=smoothstep(.15f,.7f,lava); | |
| 201 | + float crack=glow(lava-.2,.13), heat=pow(.5+.5*sin(q.x*3-q.y*.7+c.t*.4),5.f); | |
| 202 | + float3 floor=paint(.1+q.y*.012,f)*(crack*1.8+(1-crust)*(.4+heat*.4))+deep(.5,f)*crust*.22; | |
| 203 | + float embers=pow(.5+.5*sin(p.x*8+p.y*11+c.t*.8),16.f)*.3; | |
| 204 | + return mix(paint(.65,f)*(.2+embers),floor,smoothstep(-.03f,.05f,.35-p.y)); | |
| 205 | + } | |
| 206 | + NATIVE_EFFECT(moltenHighway) | |
| 207 | + | |
| 208 | + float3 violetFlight(Ctx c, constant NativeFrame &f) { | |
| 209 | + | |
| 210 | + float3 col=paint(.3,f)*.14; | |
| 211 | + for(int k=0;k<7;++k){float2 s=layerSlot(k,7,c.travel*.14); float sc=layerScale(s.x,3)/c.size; | |
| 212 | + float2 p=rot(c.uv*sc,c.t*.15+s.y*.37); p.y-=.3*sin(s.y*.5+c.t*.4); | |
| 213 | + float delta=abs(p.x)*.7+p.y, wing=glow(delta-.8,.06+.06*c.b[int(s.y-4*floor(s.y/4))]); | |
| 214 | + float wingfill=exp(-abs(delta-.8)*4)*exp(-abs(p.x)*.3); | |
| 215 | + float braces=line(sin(p.x*5+s.y),.06,c.px*sc)*wingfill; | |
| 216 | + col+=paint(s.y*.13+p.x*.04,f)*(wing*1.8+wingfill*.5+braces*.4)*layerFade(s.x); | |
| 217 | + }return col; | |
| 218 | + } | |
| 219 | + NATIVE_EFFECT(violetFlight) | |
| 220 | + | |
| 221 | + float3 emeraldLaunch(Ctx c, constant NativeFrame &f) { | |
| 222 | + | |
| 223 | + float2 p=c.uv/c.size; float r=max(length(p),.05f), a=atan2(p.y,p.x), z=2.2/r+c.travel*2.5; | |
| 224 | + float petal=.5+.5*cos(a*7+z*.22+c.t*.15), cut=sin(z*2.4+petal*3); | |
| 225 | + float ribs=line(cut,.08+c.b.z*.04,c.px/r), veins=line(sin(a*28-z*.8),.045,c.px/r); | |
| 226 | + float tissue=petal*(.5+.5*sin(z*1.2+sin(a*7))); | |
| 227 | + float3 col=paint((.5+.3*sin(a))+z*.011,f)*(.16+tissue*.6+ribs*1.3+veins*.35); | |
| 228 | + return col*smoothstep(.03f,.16f,r)+deep(.4,f)*.12; | |
| 229 | + } | |
| 230 | + NATIVE_EFFECT(emeraldLaunch) | |
| 231 | + | |
| 232 | + float3 coralDriftway(Ctx c, constant NativeFrame &f) { | |
| 233 | + | |
| 234 | + float2 p=c.uv/c.size; float r=max(length(p),.06f), a=atan2(p.y,p.x), z=1.6/r+c.travel*1.5; | |
| 235 | + float branch=sin(a*6+z*.18+c.t*.1)+.35*sin(a*17-z*.5); | |
| 236 | + float coral=glow(branch,.16+c.b.y*.08), bubbles=pow(.5+.5*cos(z*4+sin(a*12)),10.f); | |
| 237 | + float water=.5+.5*sin(a*3-z*.7+sin(z*.3)); | |
| 238 | + float3 col=paint(.45+water*.15,f)*(.2+water*.3); | |
| 239 | + col+=paint((.5+.3*sin(a))+z*.02,f)*(coral*(.8+bubbles*.9)+bubbles*.2); | |
| 240 | + return col*smoothstep(.03f,.15f,r)+paint(.65,f)*.1; | |
| 241 | + } | |
| 242 | + NATIVE_EFFECT(coralDriftway) | |
| 243 | + | |
| 244 | + float3 azureAscent(Ctx c, constant NativeFrame &f) { | |
| 245 | + | |
| 246 | + float2 p=rot(c.uv/c.size,-.3); float d=max(.6-p.y,.04f), z=2/d+c.travel*2; | |
| 247 | + float x=p.x/d; float zig=abs(fract(z*.7+x*.15)-.5), stair=line(zig-.4,.06,c.px/d); | |
| 248 | + float tread=.5+.5*cos(z*4.4+x*.9), rail=glow(abs(x)-3,.13); | |
| 249 | + float3 floor=paint(x*.07+z*.018,f)*(.2+tread*.4+stair+rail); | |
| 250 | + floor+=paint(.85,f)*pow(.5+.5*cos(x*3-z+c.b.z*sin(x)),12.f)*.5; | |
| 251 | + return mix(paint(.7,f)*(.2+.12*sin(p.x*2+c.t*.2)),floor,smoothstep(-.02f,.05f,.6-p.y)); | |
| 252 | + } | |
| 253 | + NATIVE_EFFECT(azureAscent) | |
| 254 | + | |
| 255 | + float3 festivalCruise(Ctx c, constant NativeFrame &f) { | |
| 256 | + | |
| 257 | + float2 p=c.uv/c.size; float r=max(length(p),.055f), a=atan2(p.y,p.x), z=2.5/r+c.travel*2; | |
| 258 | + float2 q=float2(a*7/PI+.1*sin(z*.4),z*.8), id=floor(q), l=fract(q)-.5; | |
| 259 | + l.x+=sin(id.y+c.t*.7)*.07; float lantern=length(l/float2(.3,.4)); | |
| 260 | + float light=fill(lantern-.85,c.px/r), cage=line(sin(l.x*23),.08,c.px/r)*light; | |
| 261 | + float cord=glow(l.x,.025), glowlight=glow(lantern,.45); | |
| 262 | + float3 col=paint(.3*sin(id.x*TAU/14)+id.y*.09,f)*(.12+light*(.8-cage*.4)*(1+c.b[int(id.y-4*floor(id.y/4))]*.7)+glowlight*.2); | |
| 263 | + col+=paint(.65,f)*cord*.25; | |
| 264 | + return col*smoothstep(.03f,.15f,r)+deep(.3,f)*.1; | |
| 265 | + } | |
| 266 | + NATIVE_EFFECT(festivalCruise) | |
| 267 | + | |
| 268 | + float3 quantumSled(Ctx c, constant NativeFrame &f) { | |
| 269 | + | |
| 270 | + float2 p=c.uv/c.size; float r=max(length(p*float2(1,.7)),.055f), a=atan2(p.y*.7,p.x), z=2/r+c.travel*2.1; | |
| 271 | + float braid=sin(a*3+z*.55+c.t*.2), companion=sin(a*3-z*.55-c.t*.2); | |
| 272 | + float rails=glow(braid,.09)+glow(companion,.09), ties=line(sin(z*3),.07,c.px/r); | |
| 273 | + float ice=.5+.5*cos(a*6+z*.4+c.b.x*sin(a*11)); | |
| 274 | + float3 col=paint((.5+.3*sin(a))+z*.017,f)*(.15+ice*.35+rails+ties*.3); | |
| 275 | + return col*smoothstep(.03f,.17f,r)+paint(.8,f)*.08; | |
| 276 | + } | |
| 277 | + NATIVE_EFFECT(quantumSled) | |
| 278 | + | |
| 279 | + float3 citrusSurge(Ctx c, constant NativeFrame &f) { | |
| 280 | + | |
| 281 | + float2 p=c.uv/c.size; float r=max(length(p),.055f), a=atan2(p.y,p.x), z=2.6/r+c.travel*2; | |
| 282 | + float juice=sin(a*4+sin(z*.8+a*2)*2+c.t*.3)+cos(z*1.1-a*3); | |
| 283 | + juice+=c.b.y*sin(a*13+z)*.7; float flesh=.5+.5*sin(juice*3); | |
| 284 | + float peel=line(sin(z*2.6+.6*cos(a*8)),.07,c.px/r), gleam=pow(max(0.f,cos(juice*3)),14.f); | |
| 285 | + float3 col=paint(juice*.07+z*.013,f)*(.2+flesh*.6+peel*.7); | |
| 286 | + col+=paint(.85,f)*gleam*(.9+c.b.w*.5); | |
| 287 | + return col*smoothstep(.025f,.14f,r)+deep(.6,f)*.1; | |
| 288 | + } | |
| 289 | + NATIVE_EFFECT(citrusSurge) | |
| 290 | + | |
| 291 | + float3 starlightPursuit(Ctx c, constant NativeFrame &f) { | |
| 292 | + | |
| 293 | + float2 p=c.uv/c.size; float r=max(length(p),.04f), a=atan2(p.y,p.x), z=2.8/r+c.travel*3; | |
| 294 | + float drift=a+z*.12+c.t*.1; float lane=pow(.5+.5*cos(drift*15),8.f); | |
| 295 | + float star=pow(.5+.5*sin(z*4+floor(drift*8)*1.7),14.f)*lane; | |
| 296 | + float streak=lane*pow(.5+.5*cos(z*.9),4.f), canyon=.5+.5*sin(a*4+z*.4); | |
| 297 | + float3 col=paint((.5+.3*sin(drift))+z*.013,f)*(.15+canyon*.25+streak*.65+star*(1.5+c.b.w)); | |
| 298 | + return col*smoothstep(.02f,.12f,r)+paint(.8,f)*.1; | |
| 299 | + } | |
| 300 | + NATIVE_EFFECT(starlightPursuit) |
Sources/PulseCanvas/Resources/NativeGeometry.metal added
| 1 | + // Fractal, tessellation, kaleidoscope and optical designs. Original PulseCanvas code; | |
| 2 | + // classic forms (Mandelbulb power formula, Menger sponge, sphere inversion, Poincare disk) | |
| 3 | + // are implemented from their mathematical definitions. Audio terms are zero at zero Chaos. | |
| 4 | + | |
| 5 | + float3 geometryNormal(float d0, float dx, float dy, float dz) { return normalize(float3(dx - d0, dy - d0, dz - d0) + 1e-6); } | |
| 6 | + | |
| 7 | + // ------------------------------------------------------------------ 35 Glass Mosaic | |
| 8 | + // Three stained-glass screens at different depths drift toward the viewer, a moving light | |
| 9 | + // behind them. Light passes through every screen, so overlapping panes mix colors. Each | |
| 10 | + // pane brightens with its band; attacks flare the light. | |
| 11 | + | |
| 12 | + | |
| 13 | + // ------------------------------------------------------------------ 47 Opal Tessera | |
| 14 | + // An endless zoom into a triangular opal mosaic: each tile subdivides into four as the | |
| 15 | + // view deepens. Tiles tilt to catch the light, flashing play-of-color; bands tilt their | |
| 16 | + // own tiles further and attacks flash the facets. | |
| 17 | + float3 triangleTile(float2 p, thread float2 &id, thread float &edge) { | |
| 18 | + float2 s = float2(p.x - p.y * .57735, p.y * 1.1547); | |
| 19 | + float2 cell = floor(s), local = fract(s); | |
| 20 | + float upper = step(1.f, local.x + local.y); | |
| 21 | + id = cell * 2 + upper; | |
| 22 | + float a = local.x, b = local.y, cc = 1 - a - b; | |
| 23 | + edge = min(min(abs(a), abs(b)), abs(cc)); | |
| 24 | + edge = upper > .5 ? min(min(1 - a, 1 - b), abs(a + b - 1)) : edge; | |
| 25 | + return float3(local, upper); | |
| 26 | + } | |
| 27 | + float3 opalLevel(float2 p, float level, Ctx c, constant NativeFrame &f, thread float &edgeOut) { | |
| 28 | + float2 id; float edge; | |
| 29 | + triangleTile(p, id, edge); | |
| 30 | + edgeOut = edge; | |
| 31 | + float seed = hash21(id + level * 31); | |
| 32 | + float band = c.b[int(seed * 3.99)]; | |
| 33 | + float tilt = sin(c.t * (.3 + seed * .5) + seed * 20 + c.m * .8) * .6 + band * .8; | |
| 34 | + float play = fbm2(p * 3 + id * .37 + tilt, 3); | |
| 35 | + float3 film = filmColor(play * 1.5 + tilt * .4 + seed, f); | |
| 36 | + float flash = pow(max(0.f, sin(play * 12 + tilt * 3)), 12.f) * (.5 + c.hit * 1.5); | |
| 37 | + float milk = .35 + .65 * smoothstep(.0f, .15f, edge); | |
| 38 | + return film * (.35 + .5 * smoothstep(-.4f, .8f, tilt)) * milk + paint(.95, f) * flash * .6; | |
| 39 | + } | |
| 40 | + float3 opalTessera(Ctx c, constant NativeFrame &f) { | |
| 41 | + float3 color = 0.f; | |
| 42 | + float edges = 0; | |
| 43 | + for (int octave = 0; octave < 2; ++octave) { | |
| 44 | + float2 z = octaveZoom(c.travel * .1, octave); | |
| 45 | + float level = floor(c.travel * .1) + float(octave); | |
| 46 | + float edge; | |
| 47 | + float3 layer = opalLevel(c.uv * z.x * 1.8 / c.size, level, c, f, edge); | |
| 48 | + color += layer * z.y; | |
| 49 | + edges += (1 - smoothstep(.0f, .03f, edge)) * z.y; | |
| 50 | + } | |
| 51 | + return color * (1 - edges * .85) + paint(.7, f) * edges * .05; | |
| 52 | + } | |
| 53 | + | |
| 54 | + // ------------------------------------------------------------------ 56 Laser Origami | |
| 55 | + // A Miura-folded paper landscape recedes to the horizon while palette lasers sweep across | |
| 56 | + // it; every beam bends over the folds. Bass deepens the folds, the music clock sweeps the | |
| 57 | + // lasers and attacks flash them. | |
| 58 | + | |
| 59 | + | |
| 60 | + // ------------------------------------------------------------------ 60 Mandel Bloom | |
| 61 | + // A Mandelbulb unfurls and folds through a continuously bending liquid domain. Bass | |
| 62 | + // twists its cross-sections, mids push waves through its lobes and attacks ripple veins. | |
| 63 | + // Continuous domain bending changes the actual folds, rather than only orbiting them. | |
| 64 | + // Integer power preserves the azimuth seam; rotating the domain preserves the poles. | |
| 65 | + float mandelField(float3 p, Ctx c, thread float4 &trap) { | |
| 66 | + float phase = c.t * .72 + c.m * .60; | |
| 67 | + float2 twist = rot(p.xz, sin(p.y * 1.5 + phase * .45) * (.16 + c.b.x * .28)); | |
| 68 | + float3 q = float3(twist.x, p.y, twist.y); | |
| 69 | + float3 wave = sin(q.yzx * 1.9 + float3(phase, -phase * .83, phase * .71)); | |
| 70 | + float3 fine = sin(q.zxy * 3.6 + float3(-phase * 1.2, phase * .92, -phase * .76)); | |
| 71 | + float strength = .10 + c.b.y * .14 + c.hit * .09; | |
| 72 | + q += wave * strength + fine * (.025 + c.b.z * .045); | |
| 73 | + q /= float3(1 + .09 * sin(phase * .63), 1 + .11 * cos(phase * .51), 1 + .08 * sin(phase * .57 + 2)); | |
| 74 | + float3 z = q; | |
| 75 | + float dr = 1, r = 0; | |
| 76 | + const float power = 8; | |
| 77 | + trap = float4(1e3); | |
| 78 | + int iterations = 6 + int(c.detail * 3); | |
| 79 | + for (int i = 0; i < iterations; ++i) { | |
| 80 | + r = max(length(z), 1e-6f); | |
| 81 | + if (r > 2) break; | |
| 82 | + float theta = acos(clamp(z.z / r, -1.f, 1.f)) * power; | |
| 83 | + float phi = atan2(z.y, z.x) * power; | |
| 84 | + dr = pow(r, power - 1) * power * dr + 1; | |
| 85 | + float zr = pow(r, power); | |
| 86 | + z = zr * float3(sin(theta) * cos(phi), sin(phi) * sin(theta), cos(theta)) + q; | |
| 87 | + trap = min(trap, float4(abs(z), dot(z, z))); | |
| 88 | + } | |
| 89 | + // Domain warping stretches distances; conservative steps keep thin folds intact. | |
| 90 | + return .5 * log(r) * r / max(dr, 1e-6f) / 2.1; | |
| 91 | + } | |
| 92 | + float3 mandelBloom(Ctx c, constant NativeFrame &f) { | |
| 93 | + float orbit = c.t * .04 + c.travel * .06; | |
| 94 | + // The bulb stays inside radius ~1.3 for these powers; the camera orbits outside it. | |
| 95 | + float distance = 1.75 + .2 * (.5 + .5 * sin(c.travel * .05 + c.t * .02)); | |
| 96 | + // Normalized, so the orbit keeps its full distance at every phase. | |
| 97 | + float3 direction = normalize(float3(sin(orbit) * cos(orbit * .7), sin(orbit * .5) * .5, cos(orbit) * cos(orbit * .7)) + float3(0, 0, 1e-3)); | |
| 98 | + float3 ro = direction * distance; | |
| 99 | + // Aim at a point on the far flank, so the surface fills most of the frame off-centre. | |
| 100 | + float3 side = normalize(cross(direction, float3(0, 1, 0)) + float3(1e-3, 0, 0)); | |
| 101 | + float3 target = side * (.55 + .1 * sin(c.t * .05)) + float3(0, .25 * cos(c.t * .04), 0); | |
| 102 | + float3 rd = cameraRay(c.uv / c.size, target - ro, float3(0, 1, 0), 1.7); | |
| 103 | + float travel = 0; | |
| 104 | + float4 trap; | |
| 105 | + bool hit = false; | |
| 106 | + int steps = 0; | |
| 107 | + for (int i = 0; i < 180; ++i) { | |
| 108 | + float d = mandelField(ro + rd * travel, c, trap); | |
| 109 | + if (d < max(.0002f, .00045 * travel)) { hit = true; break; } | |
| 110 | + travel += max(d * .75, .0001f); | |
| 111 | + steps = i; | |
| 112 | + if (travel > 6) break; | |
| 113 | + } | |
| 114 | + float3 background = deep(.4 + c.uv.y * .1, f) * .1 + paint(.6 + c.uv.x * .1, f) * .13 * smoothstep(.3f, .8f, fbm2(c.uv * 1.4 + float2(c.t * .02, 0), 4)); | |
| 115 | + if (!hit) return background + paint(.8, f) * pow(float(steps) / 180, 1.5f) * .6; | |
| 116 | + float3 p = ro + rd * travel; | |
| 117 | + float e = .0006 * travel + .0002; | |
| 118 | + float4 t2; | |
| 119 | + float d0 = mandelField(p, c, t2); | |
| 120 | + float3 n = geometryNormal(d0, mandelField(p + float3(e, 0, 0), c, t2), mandelField(p + float3(0, e, 0), c, t2), mandelField(p + float3(0, 0, e), c, t2)); | |
| 121 | + mandelField(p, c, trap); | |
| 122 | + float occlusion = 1 - float(steps) / 180; | |
| 123 | + float3 light = normalize(float3(.6, .7, -.4)); | |
| 124 | + float diffuse = max(dot(n, light), 0.f); | |
| 125 | + float rim = pow(1 - max(dot(-rd, n), 0.f), 2.f); | |
| 126 | + float flow = .5 + .5 * sin(dot(p, float3(3.1, 2.4, 2.8)) - c.t * 1.1 - c.m * 2.0); | |
| 127 | + float veins = (exp(-trap.x * 6) + exp(-trap.y * 6) * .6) * (.35 + flow * .45); | |
| 128 | + float band = c.b[int(clamp(trap.w * 1.4, 0.f, 3.99f))]; | |
| 129 | + float3 albedo = paint(.15 + trap.w * .5 + trap.z * .3, f); | |
| 130 | + float3 color = albedo * (.05 + diffuse * .8) * occlusion + paint(.9, f) * veins * (.4 + band * 1.7 + c.hit * flow) + paint(.6, f) * rim * .35; | |
| 131 | + return mix(background, color, exp(-travel * c.fog * .2)); | |
| 132 | + } | |
| 133 | + | |
| 134 | + // ------------------------------------------------------------------ 61 Menger Nave | |
| 135 | + // A flight through an endless Menger sponge cathedral. Each level of holes breathes with | |
| 136 | + // its own band, so the architecture opens and closes at different scales with the music. | |
| 137 | + float mengerField(float3 p, Ctx c) { | |
| 138 | + // Infinite sponge in units where each solid cube spans 2; the camera rides an open axis. | |
| 139 | + float unit = 1.5; | |
| 140 | + float3 q = p / unit; | |
| 141 | + float d = -1; | |
| 142 | + float s = 1; | |
| 143 | + for (int i = 0; i < 4; ++i) { | |
| 144 | + float band = c.b[min(i, 3)]; | |
| 145 | + float3 a = fmod(q * s + 1000, 2.f) - 1; | |
| 146 | + s *= 3; | |
| 147 | + float3 r = abs(1 - 3 * abs(a)); | |
| 148 | + float da = max(r.x, r.y), db = max(r.y, r.z), dc = max(r.z, r.x); | |
| 149 | + float cross = (min(da, min(db, dc)) - 1 + band * .25) / s; | |
| 150 | + d = max(d, cross); | |
| 151 | + } | |
| 152 | + return d * unit; | |
| 153 | + } | |
| 154 | + float3 mengerNave(Ctx c, constant NativeFrame &f) { | |
| 155 | + float3 ro = float3(sin(c.t * .05) * .12, cos(c.t * .04) * .12, c.travel * 1.6 + 3); | |
| 156 | + float3 rd = cameraRay(c.uv, float3(sin(c.t * .09) * .25, sin(c.t * .07) * .2, 1), float3(sin(c.t * .05) * .2, 1, 0), 1.3 * c.size); | |
| 157 | + float travel = 0; | |
| 158 | + bool hit = false; | |
| 159 | + int steps = 0; | |
| 160 | + for (int i = 0; i < 110; ++i) { | |
| 161 | + float d = mengerField(ro + rd * travel, c); | |
| 162 | + if (d < .0008 * (1 + travel)) { hit = true; break; } | |
| 163 | + travel += d; | |
| 164 | + steps = i; | |
| 165 | + if (travel > 30) break; | |
| 166 | + } | |
| 167 | + float3 fogColor = paint(.75, f) * .2; | |
| 168 | + if (!hit) return fogColor; | |
| 169 | + float3 p = ro + rd * travel; | |
| 170 | + float e = .001, d0 = mengerField(p, c); | |
| 171 | + float3 n = geometryNormal(d0, mengerField(p + float3(e, 0, 0), c), mengerField(p + float3(0, e, 0), c), mengerField(p + float3(0, 0, e), c)); | |
| 172 | + float occlusion = pow(1 - float(steps) / 110, 2.f); | |
| 173 | + float3 light = normalize(float3(.3, .8, .5)); | |
| 174 | + float diffuse = max(dot(n, light), 0.f); | |
| 175 | + float pulse = pow(.5 + .5 * sin(p.z * .8 - c.t * 1.5 - c.m * 3), 12.f) * (.3 + c.hit * 1.5); | |
| 176 | + float3 albedo = paint(.25 + dot(abs(n), float3(.1, .2, .3)) + p.z * .01, f); | |
| 177 | + float3 color = albedo * (.1 + diffuse * .9) * occlusion + paint(.9, f) * pulse * occlusion; | |
| 178 | + return mix(fogColor, color, exp(-travel * (.06 + c.fog * .08))); | |
| 179 | + } | |
| 180 | + | |
| 181 | + // ------------------------------------------------------------------ 62 Apollonian Foam | |
| 182 | + // A flight through an Apollonian sphere-inversion foam. Bubble walls glow by their orbit | |
| 183 | + // depth; each depth listens to its own band, and attacks shimmer across the foam. | |
| 184 | + | |
| 185 | + | |
| 186 | + // ------------------------------------------------------------------ 63 Hyperbolic Rosette | |
| 187 | + // An {8,3} tiling of the Poincare disk, scaled so the disk overfills the canvas. A | |
| 188 | + // continuous hyperbolic translation carries the viewer through the tiling forever. Tile | |
| 189 | + // walls glow; bands light the tiles in their screen sector and attacks pulse the walls. | |
| 190 | + | |
| 191 | + | |
| 192 | + // ------------------------------------------------------------------ 64 Quasicrystal Bloom | |
| 193 | + // Seven plane waves at equal angles interfere into a quasicrystal that never repeats. As | |
| 194 | + // the phases advance the pattern seems to bloom outward forever. Each wave's strength | |
| 195 | + // follows a band and attacks kick its phase. | |
| 196 | + float3 quasicrystalBloom(Ctx c, constant NativeFrame &f) { | |
| 197 | + float2 p = c.uv * 9 / c.size; | |
| 198 | + float sum = 0, gradientX = 0, gradientY = 0; | |
| 199 | + const int waves = 7; | |
| 200 | + for (int i = 0; i < waves; ++i) { | |
| 201 | + float angle = PI * float(i) / float(waves); | |
| 202 | + float2 d = float2(cos(angle), sin(angle)); | |
| 203 | + float band = c.b[i % 4]; | |
| 204 | + float phase = c.travel * .9 + c.t * .25 + c.m * (.3 + .1 * float(i)); | |
| 205 | + float amplitude = 1 + band * .8 + c.hit * .5 * float(i % 2); | |
| 206 | + float w = dot(p, d) + phase; | |
| 207 | + sum += cos(w) * amplitude; | |
| 208 | + gradientX -= sin(w) * amplitude * d.x; | |
| 209 | + gradientY -= sin(w) * amplitude * d.y; | |
| 210 | + } | |
| 211 | + sum /= float(waves); | |
| 212 | + float contour = fract(sum * 3 + c.t * .05); | |
| 213 | + float lines = exp(-abs(contour - .5) * 18); | |
| 214 | + float3 n = normalize(float3(-gradientX * .08, -gradientY * .08, 1)); | |
| 215 | + float light = max(dot(n, normalize(float3(-.4, .6, .7))), 0.f); | |
| 216 | + float3 color = paint(.5 + sum * .9, f) * (.12 + .5 * light) * smoothstep(-.4f, .8f, sum + .3); | |
| 217 | + color += paint(.9 + sum * .2, f) * lines * .6 + paint(.95, f) * pow(max(sum, 0.f), 4.f) * 1.4; | |
| 218 | + return color; | |
| 219 | + } | |
| 220 | + | |
| 221 | + // ------------------------------------------------------------------ 65 Tesseract Garden | |
| 222 | + // Layers of rotating tesseracts drift toward the viewer, each turning through four | |
| 223 | + // dimensions so its cubes fold through one another. Bands spin individual tesseracts | |
| 224 | + // faster; attacks flare their edges. | |
| 225 | + | |
| 226 | + | |
| 227 | + // ------------------------------------------------------------------ 66 Harmonograph | |
| 228 | + // Three decaying pendulum traces sweep across the canvas like ink from a harmonograph. | |
| 229 | + // The visible window of each trace rolls continuously inward; bands tug individual | |
| 230 | + // pendulum phases, so the loops shear and re-form with the music. | |
| 231 | + | |
| 232 | + | |
| 233 | + // ------------------------------------------------------------------ 67 Moire Engine | |
| 234 | + // Three fine gratings (rings, rays and lines) overlap; their interference throws huge | |
| 235 | + // moving fringes across the canvas. Zoom speed scales one grating against the others; | |
| 236 | + // bands swing the gratings and attacks shift their frequency. | |
| 237 | + | |
| 238 | + | |
| 239 | + // ------------------------------------------------------------------ 68 Riley Undulation | |
| 240 | + // Op-art stripes whose widths and phases swell into an illusion of a rolling surface. | |
| 241 | + // Bass sends a travelling bulge through the stripes; highs add a fine shimmer. | |
| 242 | + | |
| 243 | + | |
| 244 | + // ------------------------------------------------------------------ 69 Kaleido Chamber | |
| 245 | + // A three-mirror kaleidoscope: a chamber of tumbling glass shards reflected across an | |
| 246 | + // endless triangular lattice. The music clock tumbles the shards, bands brighten their | |
| 247 | + // colors and attacks rotate the chamber. | |
| 248 | + | |
| 249 | + | |
| 250 | + // ------------------------------------------------------------------ 70 Girih Lattice | |
| 251 | + // An eight-fold star-and-cross pattern of interlaced gilded straps, mapped through a | |
| 252 | + // log-polar Droste projection centred off-canvas, so zoom flows endlessly. Star tiles | |
| 253 | + // light with their bands; attacks run light along the straps. | |
| 254 | + | |
| 255 | + | |
| 256 | + #define GEOMETRY_EFFECTS(X) X(opalTessera) X(mandelBloom) X(mengerNave) X(quasicrystalBloom) | |
| 257 | + GEOMETRY_EFFECTS(NATIVE_EFFECT) |
Sources/PulseCanvas/Resources/NativeParticles.metal added
| 1 | + // Particle, orbital and constellation designs. Original PulseCanvas procedural code. | |
| 2 | + // Every effect receives Ctx from NativeCommon.metal; audio terms are zero at zero Chaos. | |
| 3 | + | |
| 4 | + // ------------------------------------------------------------------ 41 Photon Rapids | |
| 5 | + // Light rushes past from an off-centre vanishing point that drifts and curves, so the | |
| 6 | + // streaks swirl like rapids. The music clock speeds the current, bands light their own | |
| 7 | + // streak families and attacks stretch every streak. | |
| 8 | + | |
| 9 | + | |
| 10 | + // ------------------------------------------------------------------ 50 Magnetic Ballet | |
| 11 | + // Field lines of four magnetic poles waltzing across the canvas, drawn as glowing lines | |
| 12 | + // over an iron-filing texture. Each pole's strength follows a band, so the lines bend and | |
| 13 | + // gather with the music; attacks brighten the filings. | |
| 14 | + float3 magneticBallet(Ctx c, constant NativeFrame &f) { | |
| 15 | + float2 p = c.uv / c.size; | |
| 16 | + float stream = 0, potential = 0; | |
| 17 | + float2 field = 0.f; | |
| 18 | + for (int i = 0; i < 5; ++i) { | |
| 19 | + float fi = float(i); | |
| 20 | + float2 pole = float2(sin(c.t * (.13 + fi * .03) + fi * 2.4 + c.m * .1) * c.extent.x * .85, cos(c.t * (.11 + fi * .025) + fi * 1.7) * c.extent.y * .8); | |
| 21 | + // Whole-number charges keep every field line continuous; bands move the poles. | |
| 22 | + float charge = fmod(fi, 2.f) < 1 ? 1. : -1.; | |
| 23 | + pole += float2(sin(c.m * .7 + fi * 2), cos(c.m * .6 + fi)) * c.b[i % 4] * .25; | |
| 24 | + float2 d = p - pole; | |
| 25 | + float r2 = dot(d, d) + .002; | |
| 26 | + stream += charge * atan2(d.y, d.x); | |
| 27 | + potential += charge * .5 * log(r2); | |
| 28 | + field += charge * d / r2; | |
| 29 | + } | |
| 30 | + float lines = stream * 3 / PI + c.travel * .2; | |
| 31 | + float strength = length(field); | |
| 32 | + // |grad stream| = |field|; using it avoids derivative spikes at the atan2 branch cuts. | |
| 33 | + float w = 3 / PI * strength * c.px / c.size; | |
| 34 | + float fieldLine = 1 - smoothstep(.0f, max(w * 1.5, .06f), abs(fract(lines) - .5) - .02); | |
| 35 | + float equipotential = 1 - smoothstep(.0f, max(2 * strength * c.px * 1.5, .04f), abs(fract(potential * 2) - .5) - .45); | |
| 36 | + float2 direction = field / max(strength, 1e-4f); | |
| 37 | + // Iron filings: short dashes aligned with the local field. | |
| 38 | + float2 grid = p * 60; | |
| 39 | + float2 cell = floor(grid), local = fract(grid) - .5; | |
| 40 | + float2 jitter = hash22(cell) - .5; | |
| 41 | + float2 q = local - jitter * .3; | |
| 42 | + float along = dot(q, direction), across = dot(q, float2(-direction.y, direction.x)); | |
| 43 | + float filing = (1 - smoothstep(.05f, .09f, abs(across))) * (1 - smoothstep(.28f, .36f, abs(along))) * step(.25, hash21(cell + 3)); | |
| 44 | + float3 color = deep(.4, f) * .06; | |
| 45 | + color += paint(.2 + potential * .05, f) * filing * clamp(strength * .15, 0.f, 1.f) * (.5 + c.hit * 1.5); | |
| 46 | + color += paint(.55 + stream * .02, f) * fieldLine * clamp(strength * .2, .25f, 1.f) * 1.1; | |
| 47 | + color += paint(.85, f) * equipotential * .12; | |
| 48 | + color += paint(.95, f) * exp(-1 / max(strength * .02, 1e-3f)) * .4; | |
| 49 | + return color; | |
| 50 | + } | |
| 51 | + | |
| 52 | + // ------------------------------------------------------------------ 52 Diamond Undertow | |
| 53 | + // Schools of faceted diamond shards ride a curling undertow in several depth layers. | |
| 54 | + // Each shard aligns with the current; bands tumble their own shards and attacks make | |
| 55 | + // the facets flash. | |
| 56 | + | |
| 57 | + | |
| 58 | + // ------------------------------------------------------------------ 54 Gyroscopic Garden | |
| 59 | + // A low glide over a garden of brass gyroscopes on pedestals. Each has three nested | |
| 60 | + // gimbals spinning on different axes; bands spin their own gyroscopes faster and attacks | |
| 61 | + // glint across the rings. | |
| 62 | + | |
| 63 | + | |
| 64 | + // ------------------------------------------------------------------ 55 Bubble Choir | |
| 65 | + // Clouds of soap bubbles float toward the viewer in layers. Thin-film colors swirl over | |
| 66 | + // every skin; each bubble swells with its own band and attacks make the skins wobble. | |
| 67 | + | |
| 68 | + | |
| 69 | + // ------------------------------------------------------------------ 57 Echo Lanterns | |
| 70 | + // Hundreds of paper sky lanterns rise over a still lake; the water mirrors them. Each | |
| 71 | + // flame flickers with its own band, attacks flare nearby lanterns, and Zoom speed lifts | |
| 72 | + // the camera through the swarm. | |
| 73 | + | |
| 74 | + | |
| 75 | + // ------------------------------------------------------------------ 86 Plexus Constellations | |
| 76 | + // Stars drifting in deep layers join into constellations whenever they come close. Loud | |
| 77 | + // passages raise the joining distance so the web grows; stars twinkle on their bands. | |
| 78 | + float2 plexusPoint(float2 cell, float layer, Ctx c) { | |
| 79 | + float2 seed = hash22(cell + layer * 17); | |
| 80 | + return cell + .5 + .4 * float2(sin(c.t * (.2 + seed.x * .3) + seed.y * 9), cos(c.t * (.17 + seed.y * .3) + seed.x * 9)); | |
| 81 | + } | |
| 82 | + float3 plexusConstellations(Ctx c, constant NativeFrame &f) { | |
| 83 | + float3 color = deep(.45 + c.uv.y * .1, f) * .06 + paint(.4, f) * .04 * fbm2(c.uv * 1.2 + c.t * .01, 4); | |
| 84 | + const int count = 3; | |
| 85 | + for (int k = 0; k < count; ++k) { | |
| 86 | + float2 slot = layerSlot(k, count, c.travel * 0.1); | |
| 87 | + float phase = slot.x, id = slot.y, fade = layerFade(phase); | |
| 88 | + float scale = layerScale(phase, 1.8) * 3.2 / c.size; | |
| 89 | + float2 p = c.uv * scale + id * 9.1; | |
| 90 | + float2 base = floor(p); | |
| 91 | + float2 points[9]; | |
| 92 | + int n = 0; | |
| 93 | + for (int y = -1; y <= 1; ++y) for (int x = -1; x <= 1; ++x) points[n++] = plexusPoint(base + float2(x, y), id, c); | |
| 94 | + float reach = 1.05 + c.e * .35 + c.b.x * .2; | |
| 95 | + float lines = 0, stars = 0; | |
| 96 | + for (int i = 0; i < 9; ++i) { | |
| 97 | + float2 a = points[i]; | |
| 98 | + float band = c.b[int(hash21(floor(a) + id) * 3.99)]; | |
| 99 | + stars += exp(-length(p - a) / (.035 * (1 + band * .8 + c.hit * .7))) * (.6 + band + c.hit * 1.2); | |
| 100 | + for (int j = i + 1; j < 9; ++j) { | |
| 101 | + float2 b = points[j]; | |
| 102 | + float span = length(a - b); | |
| 103 | + if (span > reach) continue; | |
| 104 | + float strength = pow(1 - span / reach, 1.2f); | |
| 105 | + float d = sdSegment(p, a, b); | |
| 106 | + lines += (exp(-d / (.01 + c.px * scale)) + exp(-d / .06) * .15) * strength; | |
| 107 | + } | |
| 108 | + } | |
| 109 | + float tone = mix(.25, 1., phase) * fade; | |
| 110 | + color += paint(.35 + id * .07, f) * lines * 1.1 * tone + paint(.9, f) * stars * 1.3 * tone; | |
| 111 | + } | |
| 112 | + return color; | |
| 113 | + } | |
| 114 | + | |
| 115 | + // ------------------------------------------------------------------ 87 Murmuration | |
| 116 | + // A starling murmuration rolls across a dusk sky: thousands of birds forming one folding | |
| 117 | + // cloud. Bass thickens the flock, attacks snap it into a turn, highs scatter the edges. | |
| 118 | + | |
| 119 | + | |
| 120 | + // ------------------------------------------------------------------ 88 Ring Shepherds | |
| 121 | + // Skimming a planetary ring at a grazing angle. Thousands of ringlets, gaps and spiral | |
| 122 | + // density waves sweep past, with the planet's limb filling the sky. Ringlets brighten on | |
| 123 | + // their bands; attacks launch wakes from the shepherd moons. | |
| 124 | + float3 ringShepherds(Ctx c, constant NativeFrame &f) { | |
| 125 | + float2 planetCenter = float2(-c.extent.x * .35, c.extent.y * .25 + 2.75); | |
| 126 | + float planetRadius = 2.2; | |
| 127 | + float3 color = deep(.4, f) * .03 + paint(.9, f) * pow(hash21(floor(c.uv * 140)), 70.f); | |
| 128 | + float planetDistance = length(c.uv - planetCenter); | |
| 129 | + if (planetDistance < planetRadius) { | |
| 130 | + float2 n2 = (c.uv - planetCenter) / planetRadius; | |
| 131 | + float3 n = float3(n2, sqrt(max(0.f, 1 - dot(n2, n2)))); | |
| 132 | + float light = max(dot(n, normalize(float3(.6, -.3, .7))), 0.f); | |
| 133 | + float bands = fbm2(float2(n.y * 6, c.t * .02), 4); | |
| 134 | + color = paint(.3 + bands * .5, f) * (.04 + light * .9) + paint(.7, f) * pow(1 - n.z, 4.f) * .3; | |
| 135 | + } | |
| 136 | + if (c.uv.y < .25 * c.extent.y) { | |
| 137 | + float3 g = groundView(c.uv, c.extent, 1., -.75 * c.extent.y); | |
| 138 | + // The camera orbits the planet, so ring structure streams past along the azimuth. | |
| 139 | + float2 fromPlanet = rot(float2(g.x * 4 + 60, g.y * 4 - 120), c.travel * .03 + c.t * .006); | |
| 140 | + float radius = length(fromPlanet) - 85; | |
| 141 | + float azimuth = atan2(fromPlanet.y, fromPlanet.x) * 60; | |
| 142 | + float ringlets = fbm2(float2(radius * 1.3, 0), 5); | |
| 143 | + ringlets = mix(ringlets, .5 + .5 * sin(radius * 9), .25); | |
| 144 | + float gap = 1 - smoothstep(.01f, .035f, abs(fract(radius * .07) - .5)); | |
| 145 | + float band = c.b[int(fract(radius * .11) * 3.99)]; | |
| 146 | + float wake = 0; | |
| 147 | + for (int i = 0; i < 2; ++i) { | |
| 148 | + float moonRadius = 46 + float(i) * 9; | |
| 149 | + float moonAzimuth = c.t * (.01 + float(i) * .004) + float(i) * 3; | |
| 150 | + float dr = radius - moonRadius; | |
| 151 | + float phase = dr * 6 - (azimuth - moonAzimuth) * 60 * sign(dr); | |
| 152 | + wake += sin(phase - c.m * 3) * exp(-abs(dr) * .35) * (.4 + c.hit * 1.2); | |
| 153 | + } | |
| 154 | + float density = clamp(ringlets * (1 - gap) + wake * .15, 0.f, 1.f); | |
| 155 | + float grain = .75 + .25 * noise2(float2(radius * 6, azimuth * 3)); | |
| 156 | + float clumps = .7 + .3 * smoothstep(.3f, .8f, noise2(float2(radius * .8, azimuth * .6))); | |
| 157 | + float spokes = 1 - .35 * smoothstep(.55f, .8f, noise2(float2(azimuth * .9, radius * .05))); | |
| 158 | + grain *= clumps * spokes; | |
| 159 | + float3 ring = paint(.2 + ringlets * .6, f) * density * grain * (.6 + band * 1.4); | |
| 160 | + ring += paint(.95, f) * pow(density, 6.f) * .3; | |
| 161 | + float coverage = smoothstep(.25f * c.extent.y, .15f * c.extent.y, c.uv.y); | |
| 162 | + float fade = exp(-g.z * .03) * smoothstep(0.f, .2f, .25f * c.extent.y - c.uv.y); | |
| 163 | + color = mix(color, ring * fade + color * (1 - density) * .4, coverage); | |
| 164 | + } | |
| 165 | + return color; | |
| 166 | + } | |
| 167 | + | |
| 168 | + // ------------------------------------------------------------------ 89 Pendulum Wave | |
| 169 | + // Rows of pendulums with slowly increasing periods swing in and out of phase, forming | |
| 170 | + // snakes, standing waves and chaos. Bass widens the swings, each row's bobs glow on | |
| 171 | + // their band and the music clock advances the pattern. | |
| 172 | + | |
| 173 | + | |
| 174 | + // ------------------------------------------------------------------ 90 Firework Garden | |
| 175 | + // Fireworks bloom over a dark garden and mirror in a pond. Shells launch on a steady | |
| 176 | + // schedule; louder music launches more and larger shells, bands color their bursts and | |
| 177 | + // attacks crackle the sparks. | |
| 178 | + | |
| 179 | + | |
| 180 | + // ------------------------------------------------------------------ 91 Event Horizon | |
| 181 | + // A black hole bends a starfield and its own accretion disk into the classic lensed | |
| 182 | + // halo. The disk spins faster inside; bands heat their own radii, attacks launch flares | |
| 183 | + // that orbit, and Zoom speed slowly circles the camera. | |
| 184 | + float3 eventHorizon(Ctx c, constant NativeFrame &f) { | |
| 185 | + float orbit = c.travel * .12 + c.t * .015; | |
| 186 | + float3 ro = float3(sin(orbit) * 9, 1.1 + sin(c.t * .03) * .4, -cos(orbit) * 9); | |
| 187 | + float3 target = float3(1.6, 0, 0); | |
| 188 | + target.xz = rot(target.xz, -orbit); | |
| 189 | + float3 rd = cameraRay(c.uv / c.size, target - ro, float3(0, 1, 0), 1.4); | |
| 190 | + float3 p = ro, v = rd; | |
| 191 | + float3 color = 0.f; | |
| 192 | + float transmission = 1; | |
| 193 | + float h2 = dot(cross(p, v), cross(p, v)); | |
| 194 | + for (int i = 0; i < 90; ++i) { | |
| 195 | + float r = length(p); | |
| 196 | + if (r < 1) { transmission = 0; break; } | |
| 197 | + float stepSize = .06 * r; | |
| 198 | + float3 previous = p; | |
| 199 | + float3 acceleration = -1.5 * h2 * p / pow(r, 5.f); | |
| 200 | + v += acceleration * stepSize; | |
| 201 | + p += v * stepSize; | |
| 202 | + if (previous.y * p.y < 0) { | |
| 203 | + float3 crossing = mix(previous, p, previous.y / (previous.y - p.y)); | |
| 204 | + float radius = length(crossing.xz); | |
| 205 | + if (radius > 2.4 && radius < 9) { | |
| 206 | + float angle = atan2(crossing.z, crossing.x); | |
| 207 | + float spin = c.t * 2.2 / pow(radius, 1.5f) * 3 + c.m * .8 / radius; | |
| 208 | + float swirl = fbm2(float2(angle * 3 + spin * 3 + log(radius) * 4, radius * 1.5), 4); | |
| 209 | + float band = c.b[int(clamp((9 - radius) / 6.6 * 3.99, 0.f, 3.99f))]; | |
| 210 | + float heat = pow(2.4 / radius, 1.6f); | |
| 211 | + float flare = c.hit * exp(-pow(fract((angle - spin * 4) / TAU) - .5, 2.f) * 80) * step(3.f, radius) * step(radius, 5.f); | |
| 212 | + float density = smoothstep(2.4f, 3.f, radius) * smoothstep(9.f, 6.f, radius) * (.35 + .9 * swirl) * (1 + band * 1.3); | |
| 213 | + float doppler = 1 + .5 * sin(angle - orbit); | |
| 214 | + float3 emission = mix(paint(.4, f), paint(.95, f), heat) * (heat * 2.5 + .3) * doppler + paint(.98, f) * flare * 3; | |
| 215 | + color += emission * density * transmission; | |
| 216 | + transmission *= 1 - clamp(density * .85, 0.f, .95f); | |
| 217 | + } | |
| 218 | + } | |
| 219 | + if (r > 30) break; | |
| 220 | + } | |
| 221 | + float3 direction = normalize(v); | |
| 222 | + float2 sky = float2(atan2(direction.z, direction.x), asin(clamp(direction.y, -1.f, 1.f))); | |
| 223 | + float stars = pow(hash21(floor(sky * 180)), 60.f) * 2 + pow(hash21(floor(sky * 90 + 3)), 40.f); | |
| 224 | + float3 background = paint(.9, f) * stars + deep(.4, f) * .05 * fbm2(sky * 3, 4); | |
| 225 | + color += background * transmission; | |
| 226 | + return color; | |
| 227 | + } | |
| 228 | + | |
| 229 | + // ------------------------------------------------------------------ 99 Neon Calligraphy | |
| 230 | + // Neon tubes write sweeping calligraphic strokes across the canvas, layered at different | |
| 231 | + // depths over a wet floor that reflects them. Each tube draws on, lingers and fades; | |
| 232 | + // bands brighten their tubes and attacks make them buzz. | |
| 233 | + | |
| 234 | + | |
| 235 | + #define PARTICLE_EFFECTS(X) X(magneticBallet) X(plexusConstellations) X(ringShepherds) X(eventHorizon) | |
| 236 | + PARTICLE_EFFECTS(NATIVE_EFFECT) |
Sources/PulseCanvas/Resources/ProjectM/Preset-README.md added
| 1 | + Milkdrop "Cream of the Crop" Presets | |
| 2 | + ==================================== | |
| 3 | + | |
| 4 | + Milkdrop "Cream of the Crop" Presets | |
| 5 | + This is a huge collection of 9,795 Milkdrop presets, curated and sorted by ISOSCELES. | |
| 6 | + | |
| 7 | + This set of presets has become the new default package for projectM releases, starting in 2022. All presets are sorted into folders to make is possible to easily select a specific theme of visualizations. | |
| 8 | + | |
| 9 | + This repository only contains the presets, not the preview images and install instructions and is meant to be included in any projectM-based applications as a preset pack. But if you want the full original package then please download it directly from ISOSCELES: | |
| 10 | + https://www.patreon.com/posts/pack-nestdrop-91682111 | |
| 11 | + | |
| 12 | + And for posterity, here's the original blog post containing some backstory about this release: | |
| 13 | + https://web.archive.org/web/20240609162724/https://thefulldomeblog.com/2020/02/21/nestdrop-presets-collection-cream-of-the-crop/ |
Sources/PulseCanvas/Resources/ProjectM/Preset-notice.md added
| 1 | + Milkdrop presets were, in almost all cases, not released under any specific license. Theoretically, each preset author | |
| 2 | + holds the full copyright on any released presets. Since the presets were freely released and have been used in so many | |
| 3 | + packages and applications in the past two decades, it is safe to assume them to be in the public domain. | |
| 4 | + | |
| 5 | + If any preset author doesn't want their own creation in this repository, please contact the projectM team and we will | |
| 6 | + remove the preset(s) from future releases. |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Aurora/$$$ Royal - Mashup (257).milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=2 | |
| 3 | + PSVERSION_WARP=0 | |
| 4 | + PSVERSION_COMP=2 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.000 | |
| 8 | + fDecay=0.900 | |
| 9 | + fVideoEchoZoom=1.104 | |
| 10 | + fVideoEchoAlpha=0.500 | |
| 11 | + nVideoEchoOrientation=0 | |
| 12 | + nWaveMode=7 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=0 | |
| 16 | + bModWaveAlphaByVolume=1 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=1 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=1 | |
| 22 | + bDarken=1 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=0.001 | |
| 26 | + fWaveScale=1.286 | |
| 27 | + fWaveSmoothing=0.630 | |
| 28 | + fWaveParam=0.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=1.331 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=0.99951 | |
| 36 | + rot=0.25990 | |
| 37 | + cx=0.320 | |
| 38 | + cy=0.290 | |
| 39 | + dx=0.00000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.01105 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.500 | |
| 50 | + ob_r=0.010 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.000 | |
| 54 | + ib_size=0.260 | |
| 55 | + ib_r=0.250 | |
| 56 | + ib_g=0.250 | |
| 57 | + ib_b=0.250 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=1 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=1 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=0.000 | |
| 85 | + wavecode_0_g=0.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=0.050 | |
| 88 | + wave_0_init1=t1 = .2 + .6*rand(1001)*.001; | |
| 89 | + wave_0_init2=t2 = .2 + .6*rand(1001)*.001; | |
| 90 | + wave_0_init3=t3 = .2 + .6*rand(1001)*.001; | |
| 91 | + wave_0_init4=t4 = .2 + .6*rand(1001)*.001; | |
| 92 | + wave_0_init5=t5 = .2 + .6*rand(1001)*.001; | |
| 93 | + wave_0_init6=t6 = .2 + .6*rand(1001)*.001; | |
| 94 | + wave_0_init7=t7 = .2 + .6*rand(1001)*.001; | |
| 95 | + wave_0_init8=t8 = .2 + .6*rand(1001)*.001; | |
| 96 | + wave_0_per_point1=ti = q1; | |
| 97 | + wave_0_per_point2= | |
| 98 | + wave_0_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 99 | + wave_0_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 100 | + wave_0_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 101 | + wave_0_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 102 | + wave_0_per_point7= | |
| 103 | + wave_0_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 104 | + wave_0_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 105 | + wave_0_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 106 | + wave_0_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 107 | + wave_0_per_point12= | |
| 108 | + wave_0_per_point13= | |
| 109 | + wave_0_per_point14=it = (it + 1)*above(sample,0); | |
| 110 | + wave_0_per_point15=sw = (1-sw)*above(sample,0); | |
| 111 | + wave_0_per_point16= | |
| 112 | + wave_0_per_point17=sa = 1-sample; | |
| 113 | + wave_0_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 114 | + wave_0_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 115 | + wave_0_per_point20= | |
| 116 | + wave_0_per_point21=y = .5 - y*(.5-x)*2; | |
| 117 | + wave_0_per_point22= | |
| 118 | + wave_0_per_point23= | |
| 119 | + wave_0_per_point24=ti = q4; | |
| 120 | + wave_0_per_point25=r = .5 + .5*sin(ti); | |
| 121 | + wave_0_per_point26=g = .5 + .5*sin(ti + 2.0944); | |
| 122 | + wave_0_per_point27=b = .5 + .5*sin(ti + 4.1888); | |
| 123 | + wave_0_per_point28= | |
| 124 | + wave_0_per_point29=a = q5; | |
| 125 | + wavecode_1_enabled=1 | |
| 126 | + wavecode_1_samples=512 | |
| 127 | + wavecode_1_sep=0 | |
| 128 | + wavecode_1_bSpectrum=0 | |
| 129 | + wavecode_1_bUseDots=0 | |
| 130 | + wavecode_1_bDrawThick=0 | |
| 131 | + wavecode_1_bAdditive=1 | |
| 132 | + wavecode_1_scaling=1.00000 | |
| 133 | + wavecode_1_smoothing=0.50000 | |
| 134 | + wavecode_1_r=0.000 | |
| 135 | + wavecode_1_g=1.000 | |
| 136 | + wavecode_1_b=0.000 | |
| 137 | + wavecode_1_a=0.050 | |
| 138 | + wave_1_init1=t1 = .2 + .6*rand(1001)*.001; | |
| 139 | + wave_1_init2=t2 = .2 + .6*rand(1001)*.001; | |
| 140 | + wave_1_init3=t3 = .2 + .6*rand(1001)*.001; | |
| 141 | + wave_1_init4=t4 = .2 + .6*rand(1001)*.001; | |
| 142 | + wave_1_init5=t5 = .2 + .6*rand(1001)*.001; | |
| 143 | + wave_1_init6=t6 = .2 + .6*rand(1001)*.001; | |
| 144 | + wave_1_init7=t7 = .2 + .6*rand(1001)*.001; | |
| 145 | + wave_1_init8=t8 = .2 + .6*rand(1001)*.001; | |
| 146 | + wave_1_per_point1=ti = q2; | |
| 147 | + wave_1_per_point2= | |
| 148 | + wave_1_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 149 | + wave_1_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 150 | + wave_1_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 151 | + wave_1_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 152 | + wave_1_per_point7= | |
| 153 | + wave_1_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 154 | + wave_1_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 155 | + wave_1_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 156 | + wave_1_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 157 | + wave_1_per_point12= | |
| 158 | + wave_1_per_point13= | |
| 159 | + wave_1_per_point14=it = (it + 1)*above(sample,0); | |
| 160 | + wave_1_per_point15=sw = (1-sw)*above(sample,0); | |
| 161 | + wave_1_per_point16= | |
| 162 | + wave_1_per_point17=sa = 1-sample; | |
| 163 | + wave_1_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 164 | + wave_1_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 165 | + wave_1_per_point20= | |
| 166 | + wave_1_per_point21=y = .5 - y*(.5-x)*2; | |
| 167 | + wave_1_per_point22= | |
| 168 | + wave_1_per_point23=ti = q4 + 2.0944; | |
| 169 | + wave_1_per_point24=r = .5 + .5*sin(ti); | |
| 170 | + wave_1_per_point25=g = .5 + .5*sin(ti + 2.0944); | |
| 171 | + wave_1_per_point26=b = .5 + .5*sin(ti + 4.1888); | |
| 172 | + wave_1_per_point27= | |
| 173 | + wave_1_per_point28=a = q6; | |
| 174 | + wavecode_2_enabled=1 | |
| 175 | + wavecode_2_samples=512 | |
| 176 | + wavecode_2_sep=0 | |
| 177 | + wavecode_2_bSpectrum=0 | |
| 178 | + wavecode_2_bUseDots=0 | |
| 179 | + wavecode_2_bDrawThick=0 | |
| 180 | + wavecode_2_bAdditive=1 | |
| 181 | + wavecode_2_scaling=1.00000 | |
| 182 | + wavecode_2_smoothing=0.50000 | |
| 183 | + wavecode_2_r=1.000 | |
| 184 | + wavecode_2_g=0.000 | |
| 185 | + wavecode_2_b=0.000 | |
| 186 | + wavecode_2_a=0.050 | |
| 187 | + wave_2_init1=t1 = .2 + .6*rand(1001)*.001; | |
| 188 | + wave_2_init2=t2 = .2 + .6*rand(1001)*.001; | |
| 189 | + wave_2_init3=t3 = .2 + .6*rand(1001)*.001; | |
| 190 | + wave_2_init4=t4 = .2 + .6*rand(1001)*.001; | |
| 191 | + wave_2_init5=t5 = .2 + .6*rand(1001)*.001; | |
| 192 | + wave_2_init6=t6 = .2 + .6*rand(1001)*.001; | |
| 193 | + wave_2_init7=t7 = .2 + .6*rand(1001)*.001; | |
| 194 | + wave_2_init8=t8 = .2 + .6*rand(1001)*.001; | |
| 195 | + wave_2_per_point1=ti = q3; | |
| 196 | + wave_2_per_point2= | |
| 197 | + wave_2_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 198 | + wave_2_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 199 | + wave_2_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 200 | + wave_2_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 201 | + wave_2_per_point7= | |
| 202 | + wave_2_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 203 | + wave_2_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 204 | + wave_2_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 205 | + wave_2_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 206 | + wave_2_per_point12= | |
| 207 | + wave_2_per_point13= | |
| 208 | + wave_2_per_point14=it = (it + 1)*above(sample,0); | |
| 209 | + wave_2_per_point15=sw = (1-sw)*above(sample,0); | |
| 210 | + wave_2_per_point16= | |
| 211 | + wave_2_per_point17=sa = 1-sample; | |
| 212 | + wave_2_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 213 | + wave_2_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 214 | + wave_2_per_point20= | |
| 215 | + wave_2_per_point21=y = .5 - y*(.5-x)*2; | |
| 216 | + wave_2_per_point22= | |
| 217 | + wave_2_per_point23=ti = q4 + 4.1888; | |
| 218 | + wave_2_per_point24=r = .5 + .5*sin(ti); | |
| 219 | + wave_2_per_point25=g = .5 + .5*sin(ti + 2.0944); | |
| 220 | + wave_2_per_point26=b = .5 + .5*sin(ti + 4.1888); | |
| 221 | + wave_2_per_point27=a = q7; | |
| 222 | + wavecode_3_enabled=0 | |
| 223 | + wavecode_3_samples=512 | |
| 224 | + wavecode_3_sep=0 | |
| 225 | + wavecode_3_bSpectrum=0 | |
| 226 | + wavecode_3_bUseDots=0 | |
| 227 | + wavecode_3_bDrawThick=0 | |
| 228 | + wavecode_3_bAdditive=0 | |
| 229 | + wavecode_3_scaling=1.00000 | |
| 230 | + wavecode_3_smoothing=0.50000 | |
| 231 | + wavecode_3_r=1.000 | |
| 232 | + wavecode_3_g=1.000 | |
| 233 | + wavecode_3_b=1.000 | |
| 234 | + wavecode_3_a=1.000 | |
| 235 | + shapecode_0_enabled=1 | |
| 236 | + shapecode_0_sides=4 | |
| 237 | + shapecode_0_additive=0 | |
| 238 | + shapecode_0_thickOutline=0 | |
| 239 | + shapecode_0_textured=1 | |
| 240 | + shapecode_0_num_inst=1 | |
| 241 | + shapecode_0_x=0.500 | |
| 242 | + shapecode_0_y=0.500 | |
| 243 | + shapecode_0_rad=1.97883 | |
| 244 | + shapecode_0_ang=0.00000 | |
| 245 | + shapecode_0_tex_ang=0.00000 | |
| 246 | + shapecode_0_tex_zoom=1.00000 | |
| 247 | + shapecode_0_r=1.000 | |
| 248 | + shapecode_0_g=1.000 | |
| 249 | + shapecode_0_b=1.000 | |
| 250 | + shapecode_0_a=1.000 | |
| 251 | + shapecode_0_r2=1.000 | |
| 252 | + shapecode_0_g2=1.000 | |
| 253 | + shapecode_0_b2=1.000 | |
| 254 | + shapecode_0_a2=1.000 | |
| 255 | + shapecode_0_border_r=1.000 | |
| 256 | + shapecode_0_border_g=1.000 | |
| 257 | + shapecode_0_border_b=1.000 | |
| 258 | + shapecode_0_border_a=0.000 | |
| 259 | + shape_0_per_frame1=tex_zoom = 1/rad; | |
| 260 | + shape_0_per_frame2= | |
| 261 | + shape_0_per_frame3=a = .7; | |
| 262 | + shape_0_per_frame4=a2 = a; | |
| 263 | + shapecode_1_enabled=0 | |
| 264 | + shapecode_1_sides=54 | |
| 265 | + shapecode_1_additive=0 | |
| 266 | + shapecode_1_thickOutline=0 | |
| 267 | + shapecode_1_textured=0 | |
| 268 | + shapecode_1_num_inst=1 | |
| 269 | + shapecode_1_x=0.150 | |
| 270 | + shapecode_1_y=0.390 | |
| 271 | + shapecode_1_rad=0.04084 | |
| 272 | + shapecode_1_ang=0.00000 | |
| 273 | + shapecode_1_tex_ang=0.00000 | |
| 274 | + shapecode_1_tex_zoom=1.00000 | |
| 275 | + shapecode_1_r=0.000 | |
| 276 | + shapecode_1_g=0.000 | |
| 277 | + shapecode_1_b=1.000 | |
| 278 | + shapecode_1_a=1.000 | |
| 279 | + shapecode_1_r2=1.000 | |
| 280 | + shapecode_1_g2=0.000 | |
| 281 | + shapecode_1_b2=0.000 | |
| 282 | + shapecode_1_a2=0.000 | |
| 283 | + shapecode_1_border_r=1.000 | |
| 284 | + shapecode_1_border_g=1.000 | |
| 285 | + shapecode_1_border_b=1.000 | |
| 286 | + shapecode_1_border_a=0.100 | |
| 287 | + shapecode_2_enabled=0 | |
| 288 | + shapecode_2_sides=4 | |
| 289 | + shapecode_2_additive=0 | |
| 290 | + shapecode_2_thickOutline=0 | |
| 291 | + shapecode_2_textured=0 | |
| 292 | + shapecode_2_num_inst=1 | |
| 293 | + shapecode_2_x=0.500 | |
| 294 | + shapecode_2_y=0.500 | |
| 295 | + shapecode_2_rad=0.10000 | |
| 296 | + shapecode_2_ang=0.00000 | |
| 297 | + shapecode_2_tex_ang=0.00000 | |
| 298 | + shapecode_2_tex_zoom=1.00000 | |
| 299 | + shapecode_2_r=1.000 | |
| 300 | + shapecode_2_g=0.000 | |
| 301 | + shapecode_2_b=0.000 | |
| 302 | + shapecode_2_a=1.000 | |
| 303 | + shapecode_2_r2=0.000 | |
| 304 | + shapecode_2_g2=1.000 | |
| 305 | + shapecode_2_b2=0.000 | |
| 306 | + shapecode_2_a2=0.000 | |
| 307 | + shapecode_2_border_r=1.000 | |
| 308 | + shapecode_2_border_g=1.000 | |
| 309 | + shapecode_2_border_b=1.000 | |
| 310 | + shapecode_2_border_a=0.100 | |
| 311 | + shapecode_3_enabled=0 | |
| 312 | + shapecode_3_sides=4 | |
| 313 | + shapecode_3_additive=0 | |
| 314 | + shapecode_3_thickOutline=0 | |
| 315 | + shapecode_3_textured=0 | |
| 316 | + shapecode_3_num_inst=1 | |
| 317 | + shapecode_3_x=0.500 | |
| 318 | + shapecode_3_y=0.500 | |
| 319 | + shapecode_3_rad=0.10000 | |
| 320 | + shapecode_3_ang=0.00000 | |
| 321 | + shapecode_3_tex_ang=0.00000 | |
| 322 | + shapecode_3_tex_zoom=1.00000 | |
| 323 | + shapecode_3_r=1.000 | |
| 324 | + shapecode_3_g=0.000 | |
| 325 | + shapecode_3_b=0.000 | |
| 326 | + shapecode_3_a=1.000 | |
| 327 | + shapecode_3_r2=0.000 | |
| 328 | + shapecode_3_g2=1.000 | |
| 329 | + shapecode_3_b2=0.000 | |
| 330 | + shapecode_3_a2=0.000 | |
| 331 | + shapecode_3_border_r=1.000 | |
| 332 | + shapecode_3_border_g=1.000 | |
| 333 | + shapecode_3_border_b=1.000 | |
| 334 | + shapecode_3_border_a=0.100 | |
| 335 | + per_frame_1=warp = 0; | |
| 336 | + per_frame_2=//zoom = 1; | |
| 337 | + per_frame_3= | |
| 338 | + per_frame_4=tic = min(time-tin,.1); | |
| 339 | + per_frame_5=tin = time; | |
| 340 | + per_frame_6= | |
| 341 | + per_frame_7=vol = (bass_att + treb_att + mid_att)*.333333; | |
| 342 | + per_frame_8= | |
| 343 | + per_frame_9=ra = 1/tic*.25; | |
| 344 | + per_frame_10= | |
| 345 | + per_frame_11=treb_avg = tic*(treb_avg*(1/tic - ra) + ra*treb); | |
| 346 | + per_frame_12=mid_avg = tic*(mid_avg*(1/tic - ra) + ra*mid); | |
| 347 | + per_frame_13=bass_avg = tic*(bass_avg*(1/tic - ra) + ra*bass); | |
| 348 | + per_frame_14=vav = tic*(vav*(1/tic - ra) + ra*(bass+treb+mid)*.33333); | |
| 349 | + per_frame_15= | |
| 350 | + per_frame_16=tt = tt + tic*treb; | |
| 351 | + per_frame_17=mt = mt + tic*mid; | |
| 352 | + per_frame_18=bt = bt + tic*bass; | |
| 353 | + per_frame_19=vt = vt + tic*vav; | |
| 354 | + per_frame_20= | |
| 355 | + per_frame_21=q1 = tt*3;// wave morph speeds | |
| 356 | + per_frame_22=q2 = mt*3; | |
| 357 | + per_frame_23=q3 = bt*3; | |
| 358 | + per_frame_24= | |
| 359 | + per_frame_25=q4 = vt; // wave colour cycle | |
| 360 | + per_frame_26= | |
| 361 | + per_frame_27=rb = if(rb,rb,.2 + rand(1001)*.001*.6); | |
| 362 | + per_frame_28=rc = if(rc,rc,.2 + rand(1001)*.001*.6); | |
| 363 | + per_frame_29=rd = if(rd,rd,.2 + rand(1001)*.001*.6); | |
| 364 | + per_frame_30=re = if(re,re,.2 + rand(1001)*.001*.6); | |
| 365 | + per_frame_31= | |
| 366 | + per_frame_32=rot = .26; | |
| 367 | + per_frame_33=cx = .3 + .1*sin(vt*re) + .1*cos(vt*rc); | |
| 368 | + per_frame_34=cy = .5 + .2*sin(vt*rb) + .1*cos(vt*rd); | |
| 369 | + per_frame_35= | |
| 370 | + per_frame_36= | |
| 371 | + per_frame_37=q5 = min(1,.5*treb_avg)*.035; | |
| 372 | + per_frame_38=q6 = min(1,.5*mid_avg)*.035; | |
| 373 | + per_frame_39=q7 = min(1,.5*bass_avg)*.035; | |
| 374 | + per_frame_40= | |
| 375 | + per_frame_41= | |
| 376 | + per_pixel_1=num = 8; | |
| 377 | + per_pixel_2=pi = 3.141592654; | |
| 378 | + per_pixel_3=radi = (y-.5)*.75; | |
| 379 | + per_pixel_4=radi = (y-.5); | |
| 380 | + per_pixel_5=radi = pow(radi*radi + (x-.5)*(x-.5),.5); | |
| 381 | + per_pixel_6= | |
| 382 | + per_pixel_7=an = ang + pi + time; | |
| 383 | + per_pixel_8=an = an - pi*2*int(an/(pi*2)); | |
| 384 | + per_pixel_9= | |
| 385 | + per_pixel_10=mod = .1; | |
| 386 | + per_pixel_11= | |
| 387 | + per_pixel_12=seg = ang + pi; | |
| 388 | + per_pixel_13=seg = seg/(pi*2)*num; | |
| 389 | + per_pixel_14=seg = int(seg); | |
| 390 | + per_pixel_15=seg = seg - equal(seg,num); | |
| 391 | + per_pixel_16= | |
| 392 | + per_pixel_17=anga = (ang + pi) - (pi*2/num)*seg; | |
| 393 | + per_pixel_18=anga = if(equal(seg%2,0),(pi*2/num) - anga,anga); | |
| 394 | + per_pixel_19=//anga = anga + pi/6; // num = 6 | |
| 395 | + per_pixel_20=anga = anga + pi/4; // num = 8 | |
| 396 | + per_pixel_21=//anga = anga + .85; // num = 10 | |
| 397 | + per_pixel_22= | |
| 398 | + per_pixel_23= | |
| 399 | + per_pixel_24=ox = .5 - radi*sin(anga); | |
| 400 | + per_pixel_25=oy = .5 + radi*cos(anga); | |
| 401 | + per_pixel_26= | |
| 402 | + per_pixel_27=//rot = if(equal(seg,0),rot,0); | |
| 403 | + per_pixel_28= | |
| 404 | + per_pixel_29=dx = equal(seg,3)*(x-ox); | |
| 405 | + per_pixel_30=dy = equal(seg,3)*(y-oy); | |
| 406 | + per_pixel_31= | |
| 407 | + per_pixel_32=dx = above(seg,0)*(x-ox); | |
| 408 | + per_pixel_33=dy = above(seg,0)*(y-oy); | |
| 409 | + per_pixel_34= | |
| 410 | + per_pixel_35=//dx = equal(seg,1)*(x - .5)*2; | |
| 411 | + comp_1=`shader_body | |
| 412 | + comp_2=`{ | |
| 413 | + comp_3=`float2 uvm=0; | |
| 414 | + comp_4=` | |
| 415 | + comp_5=`uvm.x=uv.x-.05*tex2D(sampler_noise_hq, uv.x*1.5).x; | |
| 416 | + comp_6=`uvm.y=uv.y-.05*tex2D(sampler_noise_hq, uv.y*1.5).x; | |
| 417 | + comp_7=` | |
| 418 | + comp_8=`float3 blur = GetBlur1(uvm); | |
| 419 | + comp_9=`float3 sharp = tex2D(sampler_main, uvm); | |
| 420 | + comp_10=`float3 fix = GetPixel(frac(uvm)); | |
| 421 | + comp_11=` | |
| 422 | + comp_12=`float lum = dot(blur, float3(.3,.5,.2)); | |
| 423 | + comp_13=`float mod = (.75*fix+sin(rad*8-time*2)); | |
| 424 | + comp_14=` | |
| 425 | + comp_15=`float3 fret = (5*fix-blur*rad)*mod; | |
| 426 | + comp_16=`float3 inv = .48-fret; | |
| 427 | + comp_17=` | |
| 428 | + comp_18=`float3 aret=tex2D(sampler_main, float2(uv.x, uv.y*.75))*inv-.01*fret; | |
| 429 | + comp_19=`ret=tex2D(sampler_main, float2(uv.x, uv.y*.75))*inv+.58*fret; | |
| 430 | + comp_20=` | |
| 431 | + comp_21=`ret *= max(aret+ret, ret); | |
| 432 | + comp_22=`ret*=1.2; | |
| 433 | + comp_23=`} | |
| 434 | + comp_24=` | |
| 435 | + comp_25=` |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Aurora/$$$ Royal - Mashup (259).milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=2 | |
| 3 | + PSVERSION_WARP=0 | |
| 4 | + PSVERSION_COMP=2 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.000 | |
| 8 | + fDecay=0.900 | |
| 9 | + fVideoEchoZoom=1.104 | |
| 10 | + fVideoEchoAlpha=0.500 | |
| 11 | + nVideoEchoOrientation=0 | |
| 12 | + nWaveMode=7 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=0 | |
| 16 | + bModWaveAlphaByVolume=1 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=1 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=1 | |
| 22 | + bDarken=1 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=0.001 | |
| 26 | + fWaveScale=1.286 | |
| 27 | + fWaveSmoothing=0.630 | |
| 28 | + fWaveParam=0.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=1.331 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=0.99951 | |
| 36 | + rot=0.25990 | |
| 37 | + cx=0.320 | |
| 38 | + cy=0.290 | |
| 39 | + dx=0.00000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.01105 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.500 | |
| 50 | + ob_r=0.010 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.000 | |
| 54 | + ib_size=0.260 | |
| 55 | + ib_r=0.250 | |
| 56 | + ib_g=0.250 | |
| 57 | + ib_b=0.250 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=1 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=1 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=0.000 | |
| 85 | + wavecode_0_g=0.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=0.050 | |
| 88 | + wave_0_init1=t1 = .2 + .6*rand(1001)*.001; | |
| 89 | + wave_0_init2=t2 = .2 + .6*rand(1001)*.001; | |
| 90 | + wave_0_init3=t3 = .2 + .6*rand(1001)*.001; | |
| 91 | + wave_0_init4=t4 = .2 + .6*rand(1001)*.001; | |
| 92 | + wave_0_init5=t5 = .2 + .6*rand(1001)*.001; | |
| 93 | + wave_0_init6=t6 = .2 + .6*rand(1001)*.001; | |
| 94 | + wave_0_init7=t7 = .2 + .6*rand(1001)*.001; | |
| 95 | + wave_0_init8=t8 = .2 + .6*rand(1001)*.001; | |
| 96 | + wave_0_per_point1=ti = q1; | |
| 97 | + wave_0_per_point2= | |
| 98 | + wave_0_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 99 | + wave_0_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 100 | + wave_0_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 101 | + wave_0_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 102 | + wave_0_per_point7= | |
| 103 | + wave_0_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 104 | + wave_0_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 105 | + wave_0_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 106 | + wave_0_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 107 | + wave_0_per_point12= | |
| 108 | + wave_0_per_point13= | |
| 109 | + wave_0_per_point14=it = (it + 1)*above(sample,0); | |
| 110 | + wave_0_per_point15=sw = (1-sw)*above(sample,0); | |
| 111 | + wave_0_per_point16= | |
| 112 | + wave_0_per_point17=sa = 1-sample; | |
| 113 | + wave_0_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 114 | + wave_0_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 115 | + wave_0_per_point20= | |
| 116 | + wave_0_per_point21=y = .5 - y*(.5-x)*2; | |
| 117 | + wave_0_per_point22= | |
| 118 | + wave_0_per_point23= | |
| 119 | + wave_0_per_point24=ti = q4; | |
| 120 | + wave_0_per_point25=r = .5 + .5*sin(ti); | |
| 121 | + wave_0_per_point26=g = .5 + .5*sin(ti + 2.0944); | |
| 122 | + wave_0_per_point27=b = .5 + .5*sin(ti + 4.1888); | |
| 123 | + wave_0_per_point28= | |
| 124 | + wave_0_per_point29=a = q5; | |
| 125 | + wavecode_1_enabled=1 | |
| 126 | + wavecode_1_samples=512 | |
| 127 | + wavecode_1_sep=0 | |
| 128 | + wavecode_1_bSpectrum=0 | |
| 129 | + wavecode_1_bUseDots=0 | |
| 130 | + wavecode_1_bDrawThick=0 | |
| 131 | + wavecode_1_bAdditive=1 | |
| 132 | + wavecode_1_scaling=1.00000 | |
| 133 | + wavecode_1_smoothing=0.50000 | |
| 134 | + wavecode_1_r=0.000 | |
| 135 | + wavecode_1_g=1.000 | |
| 136 | + wavecode_1_b=0.000 | |
| 137 | + wavecode_1_a=0.050 | |
| 138 | + wave_1_init1=t1 = .2 + .6*rand(1001)*.001; | |
| 139 | + wave_1_init2=t2 = .2 + .6*rand(1001)*.001; | |
| 140 | + wave_1_init3=t3 = .2 + .6*rand(1001)*.001; | |
| 141 | + wave_1_init4=t4 = .2 + .6*rand(1001)*.001; | |
| 142 | + wave_1_init5=t5 = .2 + .6*rand(1001)*.001; | |
| 143 | + wave_1_init6=t6 = .2 + .6*rand(1001)*.001; | |
| 144 | + wave_1_init7=t7 = .2 + .6*rand(1001)*.001; | |
| 145 | + wave_1_init8=t8 = .2 + .6*rand(1001)*.001; | |
| 146 | + wave_1_per_point1=ti = q2; | |
| 147 | + wave_1_per_point2= | |
| 148 | + wave_1_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 149 | + wave_1_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 150 | + wave_1_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 151 | + wave_1_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 152 | + wave_1_per_point7= | |
| 153 | + wave_1_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 154 | + wave_1_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 155 | + wave_1_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 156 | + wave_1_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 157 | + wave_1_per_point12= | |
| 158 | + wave_1_per_point13= | |
| 159 | + wave_1_per_point14=it = (it + 1)*above(sample,0); | |
| 160 | + wave_1_per_point15=sw = (1-sw)*above(sample,0); | |
| 161 | + wave_1_per_point16= | |
| 162 | + wave_1_per_point17=sa = 1-sample; | |
| 163 | + wave_1_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 164 | + wave_1_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 165 | + wave_1_per_point20= | |
| 166 | + wave_1_per_point21=y = .5 - y*(.5-x)*2; | |
| 167 | + wave_1_per_point22= | |
| 168 | + wave_1_per_point23=ti = q4 + 2.0944; | |
| 169 | + wave_1_per_point24=r = .5 + .5*sin(ti); | |
| 170 | + wave_1_per_point25=g = .5 + .5*sin(ti + 2.0944); | |
| 171 | + wave_1_per_point26=b = .5 + .5*sin(ti + 4.1888); | |
| 172 | + wave_1_per_point27= | |
| 173 | + wave_1_per_point28=a = q6; | |
| 174 | + wavecode_2_enabled=1 | |
| 175 | + wavecode_2_samples=512 | |
| 176 | + wavecode_2_sep=0 | |
| 177 | + wavecode_2_bSpectrum=0 | |
| 178 | + wavecode_2_bUseDots=0 | |
| 179 | + wavecode_2_bDrawThick=0 | |
| 180 | + wavecode_2_bAdditive=1 | |
| 181 | + wavecode_2_scaling=1.00000 | |
| 182 | + wavecode_2_smoothing=0.50000 | |
| 183 | + wavecode_2_r=1.000 | |
| 184 | + wavecode_2_g=0.000 | |
| 185 | + wavecode_2_b=0.000 | |
| 186 | + wavecode_2_a=0.050 | |
| 187 | + wave_2_init1=t1 = .2 + .6*rand(1001)*.001; | |
| 188 | + wave_2_init2=t2 = .2 + .6*rand(1001)*.001; | |
| 189 | + wave_2_init3=t3 = .2 + .6*rand(1001)*.001; | |
| 190 | + wave_2_init4=t4 = .2 + .6*rand(1001)*.001; | |
| 191 | + wave_2_init5=t5 = .2 + .6*rand(1001)*.001; | |
| 192 | + wave_2_init6=t6 = .2 + .6*rand(1001)*.001; | |
| 193 | + wave_2_init7=t7 = .2 + .6*rand(1001)*.001; | |
| 194 | + wave_2_init8=t8 = .2 + .6*rand(1001)*.001; | |
| 195 | + wave_2_per_point1=ti = q3; | |
| 196 | + wave_2_per_point2= | |
| 197 | + wave_2_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 198 | + wave_2_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 199 | + wave_2_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 200 | + wave_2_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 201 | + wave_2_per_point7= | |
| 202 | + wave_2_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 203 | + wave_2_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 204 | + wave_2_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 205 | + wave_2_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 206 | + wave_2_per_point12= | |
| 207 | + wave_2_per_point13= | |
| 208 | + wave_2_per_point14=it = (it + 1)*above(sample,0); | |
| 209 | + wave_2_per_point15=sw = (1-sw)*above(sample,0); | |
| 210 | + wave_2_per_point16= | |
| 211 | + wave_2_per_point17=sa = 1-sample; | |
| 212 | + wave_2_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 213 | + wave_2_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 214 | + wave_2_per_point20= | |
| 215 | + wave_2_per_point21=y = .5 - y*(.5-x)*2; | |
| 216 | + wave_2_per_point22= | |
| 217 | + wave_2_per_point23=ti = q4 + 4.1888; | |
| 218 | + wave_2_per_point24=r = .5 + .5*sin(ti); | |
| 219 | + wave_2_per_point25=g = .5 + .5*sin(ti + 2.0944); | |
| 220 | + wave_2_per_point26=b = .5 + .5*sin(ti + 4.1888); | |
| 221 | + wave_2_per_point27=a = q7; | |
| 222 | + wavecode_3_enabled=0 | |
| 223 | + wavecode_3_samples=512 | |
| 224 | + wavecode_3_sep=0 | |
| 225 | + wavecode_3_bSpectrum=0 | |
| 226 | + wavecode_3_bUseDots=0 | |
| 227 | + wavecode_3_bDrawThick=0 | |
| 228 | + wavecode_3_bAdditive=0 | |
| 229 | + wavecode_3_scaling=1.00000 | |
| 230 | + wavecode_3_smoothing=0.50000 | |
| 231 | + wavecode_3_r=1.000 | |
| 232 | + wavecode_3_g=1.000 | |
| 233 | + wavecode_3_b=1.000 | |
| 234 | + wavecode_3_a=1.000 | |
| 235 | + shapecode_0_enabled=1 | |
| 236 | + shapecode_0_sides=4 | |
| 237 | + shapecode_0_additive=0 | |
| 238 | + shapecode_0_thickOutline=0 | |
| 239 | + shapecode_0_textured=1 | |
| 240 | + shapecode_0_num_inst=1 | |
| 241 | + shapecode_0_x=0.500 | |
| 242 | + shapecode_0_y=0.500 | |
| 243 | + shapecode_0_rad=1.97883 | |
| 244 | + shapecode_0_ang=0.00000 | |
| 245 | + shapecode_0_tex_ang=0.00000 | |
| 246 | + shapecode_0_tex_zoom=1.00000 | |
| 247 | + shapecode_0_r=1.000 | |
| 248 | + shapecode_0_g=1.000 | |
| 249 | + shapecode_0_b=1.000 | |
| 250 | + shapecode_0_a=1.000 | |
| 251 | + shapecode_0_r2=1.000 | |
| 252 | + shapecode_0_g2=1.000 | |
| 253 | + shapecode_0_b2=1.000 | |
| 254 | + shapecode_0_a2=1.000 | |
| 255 | + shapecode_0_border_r=1.000 | |
| 256 | + shapecode_0_border_g=1.000 | |
| 257 | + shapecode_0_border_b=1.000 | |
| 258 | + shapecode_0_border_a=0.000 | |
| 259 | + shape_0_per_frame1=tex_zoom = 1/rad; | |
| 260 | + shape_0_per_frame2= | |
| 261 | + shape_0_per_frame3=a = .7; | |
| 262 | + shape_0_per_frame4=a2 = a; | |
| 263 | + shapecode_1_enabled=0 | |
| 264 | + shapecode_1_sides=54 | |
| 265 | + shapecode_1_additive=0 | |
| 266 | + shapecode_1_thickOutline=0 | |
| 267 | + shapecode_1_textured=0 | |
| 268 | + shapecode_1_num_inst=1 | |
| 269 | + shapecode_1_x=0.150 | |
| 270 | + shapecode_1_y=0.390 | |
| 271 | + shapecode_1_rad=0.04084 | |
| 272 | + shapecode_1_ang=0.00000 | |
| 273 | + shapecode_1_tex_ang=0.00000 | |
| 274 | + shapecode_1_tex_zoom=1.00000 | |
| 275 | + shapecode_1_r=0.000 | |
| 276 | + shapecode_1_g=0.000 | |
| 277 | + shapecode_1_b=1.000 | |
| 278 | + shapecode_1_a=1.000 | |
| 279 | + shapecode_1_r2=1.000 | |
| 280 | + shapecode_1_g2=0.000 | |
| 281 | + shapecode_1_b2=0.000 | |
| 282 | + shapecode_1_a2=0.000 | |
| 283 | + shapecode_1_border_r=1.000 | |
| 284 | + shapecode_1_border_g=1.000 | |
| 285 | + shapecode_1_border_b=1.000 | |
| 286 | + shapecode_1_border_a=0.100 | |
| 287 | + shapecode_2_enabled=0 | |
| 288 | + shapecode_2_sides=4 | |
| 289 | + shapecode_2_additive=0 | |
| 290 | + shapecode_2_thickOutline=0 | |
| 291 | + shapecode_2_textured=0 | |
| 292 | + shapecode_2_num_inst=1 | |
| 293 | + shapecode_2_x=0.500 | |
| 294 | + shapecode_2_y=0.500 | |
| 295 | + shapecode_2_rad=0.10000 | |
| 296 | + shapecode_2_ang=0.00000 | |
| 297 | + shapecode_2_tex_ang=0.00000 | |
| 298 | + shapecode_2_tex_zoom=1.00000 | |
| 299 | + shapecode_2_r=1.000 | |
| 300 | + shapecode_2_g=0.000 | |
| 301 | + shapecode_2_b=0.000 | |
| 302 | + shapecode_2_a=1.000 | |
| 303 | + shapecode_2_r2=0.000 | |
| 304 | + shapecode_2_g2=1.000 | |
| 305 | + shapecode_2_b2=0.000 | |
| 306 | + shapecode_2_a2=0.000 | |
| 307 | + shapecode_2_border_r=1.000 | |
| 308 | + shapecode_2_border_g=1.000 | |
| 309 | + shapecode_2_border_b=1.000 | |
| 310 | + shapecode_2_border_a=0.100 | |
| 311 | + shapecode_3_enabled=0 | |
| 312 | + shapecode_3_sides=4 | |
| 313 | + shapecode_3_additive=0 | |
| 314 | + shapecode_3_thickOutline=0 | |
| 315 | + shapecode_3_textured=0 | |
| 316 | + shapecode_3_num_inst=1 | |
| 317 | + shapecode_3_x=0.500 | |
| 318 | + shapecode_3_y=0.500 | |
| 319 | + shapecode_3_rad=0.10000 | |
| 320 | + shapecode_3_ang=0.00000 | |
| 321 | + shapecode_3_tex_ang=0.00000 | |
| 322 | + shapecode_3_tex_zoom=1.00000 | |
| 323 | + shapecode_3_r=1.000 | |
| 324 | + shapecode_3_g=0.000 | |
| 325 | + shapecode_3_b=0.000 | |
| 326 | + shapecode_3_a=1.000 | |
| 327 | + shapecode_3_r2=0.000 | |
| 328 | + shapecode_3_g2=1.000 | |
| 329 | + shapecode_3_b2=0.000 | |
| 330 | + shapecode_3_a2=0.000 | |
| 331 | + shapecode_3_border_r=1.000 | |
| 332 | + shapecode_3_border_g=1.000 | |
| 333 | + shapecode_3_border_b=1.000 | |
| 334 | + shapecode_3_border_a=0.100 | |
| 335 | + per_frame_1=warp = 0; | |
| 336 | + per_frame_2=//zoom = 1; | |
| 337 | + per_frame_3= | |
| 338 | + per_frame_4=tic = min(time-tin,.1); | |
| 339 | + per_frame_5=tin = time; | |
| 340 | + per_frame_6= | |
| 341 | + per_frame_7=vol = (bass_att + treb_att + mid_att)*.333333; | |
| 342 | + per_frame_8= | |
| 343 | + per_frame_9=ra = 1/tic*.25; | |
| 344 | + per_frame_10= | |
| 345 | + per_frame_11=treb_avg = tic*(treb_avg*(1/tic - ra) + ra*treb); | |
| 346 | + per_frame_12=mid_avg = tic*(mid_avg*(1/tic - ra) + ra*mid); | |
| 347 | + per_frame_13=bass_avg = tic*(bass_avg*(1/tic - ra) + ra*bass); | |
| 348 | + per_frame_14=vav = tic*(vav*(1/tic - ra) + ra*(bass+treb+mid)*.33333); | |
| 349 | + per_frame_15= | |
| 350 | + per_frame_16=tt = tt + tic*treb; | |
| 351 | + per_frame_17=mt = mt + tic*mid; | |
| 352 | + per_frame_18=bt = bt + tic*bass; | |
| 353 | + per_frame_19=vt = vt + tic*vav; | |
| 354 | + per_frame_20= | |
| 355 | + per_frame_21=q1 = tt*3;// wave morph speeds | |
| 356 | + per_frame_22=q2 = mt*3; | |
| 357 | + per_frame_23=q3 = bt*3; | |
| 358 | + per_frame_24= | |
| 359 | + per_frame_25=q4 = vt; // wave colour cycle | |
| 360 | + per_frame_26= | |
| 361 | + per_frame_27=rb = if(rb,rb,.2 + rand(1001)*.001*.6); | |
| 362 | + per_frame_28=rc = if(rc,rc,.2 + rand(1001)*.001*.6); | |
| 363 | + per_frame_29=rd = if(rd,rd,.2 + rand(1001)*.001*.6); | |
| 364 | + per_frame_30=re = if(re,re,.2 + rand(1001)*.001*.6); | |
| 365 | + per_frame_31= | |
| 366 | + per_frame_32=rot = .26; | |
| 367 | + per_frame_33=cx = .3 + .1*sin(vt*re) + .1*cos(vt*rc); | |
| 368 | + per_frame_34=cy = .5 + .2*sin(vt*rb) + .1*cos(vt*rd); | |
| 369 | + per_frame_35= | |
| 370 | + per_frame_36= | |
| 371 | + per_frame_37=q5 = min(1,.5*treb_avg)*.035; | |
| 372 | + per_frame_38=q6 = min(1,.5*mid_avg)*.035; | |
| 373 | + per_frame_39=q7 = min(1,.5*bass_avg)*.035; | |
| 374 | + per_frame_40= | |
| 375 | + per_frame_41= | |
| 376 | + per_pixel_1=num = 8; | |
| 377 | + per_pixel_2=pi = 3.141592654; | |
| 378 | + per_pixel_3=radi = (y-.5)*.75; | |
| 379 | + per_pixel_4=radi = (y-.5); | |
| 380 | + per_pixel_5=radi = pow(radi*radi + (x-.5)*(x-.5),.5); | |
| 381 | + per_pixel_6= | |
| 382 | + per_pixel_7=an = ang + pi + time; | |
| 383 | + per_pixel_8=an = an - pi*2*int(an/(pi*2)); | |
| 384 | + per_pixel_9= | |
| 385 | + per_pixel_10=mod = .1; | |
| 386 | + per_pixel_11= | |
| 387 | + per_pixel_12=seg = ang + pi; | |
| 388 | + per_pixel_13=seg = seg/(pi*2)*num; | |
| 389 | + per_pixel_14=seg = int(seg); | |
| 390 | + per_pixel_15=seg = seg - equal(seg,num); | |
| 391 | + per_pixel_16= | |
| 392 | + per_pixel_17=anga = (ang + pi) - (pi*2/num)*seg; | |
| 393 | + per_pixel_18=anga = if(equal(seg%2,0),(pi*2/num) - anga,anga); | |
| 394 | + per_pixel_19=//anga = anga + pi/6; // num = 6 | |
| 395 | + per_pixel_20=anga = anga + pi/4; // num = 8 | |
| 396 | + per_pixel_21=//anga = anga + .85; // num = 10 | |
| 397 | + per_pixel_22= | |
| 398 | + per_pixel_23= | |
| 399 | + per_pixel_24=ox = .5 - radi*sin(anga); | |
| 400 | + per_pixel_25=oy = .5 + radi*cos(anga); | |
| 401 | + per_pixel_26= | |
| 402 | + per_pixel_27=//rot = if(equal(seg,0),rot,0); | |
| 403 | + per_pixel_28= | |
| 404 | + per_pixel_29=dx = equal(seg,3)*(x-ox); | |
| 405 | + per_pixel_30=dy = equal(seg,3)*(y-oy); | |
| 406 | + per_pixel_31= | |
| 407 | + per_pixel_32=dx = above(seg,0)*(x-ox); | |
| 408 | + per_pixel_33=dy = above(seg,0)*(y-oy); | |
| 409 | + per_pixel_34= | |
| 410 | + per_pixel_35=//dx = equal(seg,1)*(x - .5)*2; | |
| 411 | + comp_1=`shader_body | |
| 412 | + comp_2=`{ | |
| 413 | + comp_3=` float rad_lq = rad * length(texsize.xy)*0.5; | |
| 414 | + comp_4=` float ang_lq = ang; | |
| 415 | + comp_5=` float2 uv_temp1 = (uv - 0.5) * texsize.xy; | |
| 416 | + comp_6=` float rad_hq = length(uv_temp1); | |
| 417 | + comp_7=` float ang_hq = atan2(-uv_temp1.y, uv_temp1.x); | |
| 418 | + comp_8=` | |
| 419 | + comp_9=` float2 uv2 = (uv - 0.5); | |
| 420 | + comp_10=` float rad2 = rad_lq*0.8; | |
| 421 | + comp_11=` float ang2 = ang_lq * M_INV_PI_2 + rad_lq*0.000 + time*0.00; | |
| 422 | + comp_12=` | |
| 423 | + comp_13=` | |
| 424 | + comp_14=` // FIN TYPE | |
| 425 | + comp_15=` float fins = 6; | |
| 426 | + comp_16=` ang2 = frac(ang2*fins)/fins; | |
| 427 | + comp_17=` // ENABLE THIS TO MAKE THE FINS ALTERNATE: (seamless!) | |
| 428 | + comp_18=` ang2 = abs(ang2 - 0.5/fins); | |
| 429 | + comp_19=` | |
| 430 | + comp_20=` | |
| 431 | + comp_21=` ang2 *= M_PI_2; | |
| 432 | + comp_22=` uv = 0.5 + rad2*float2(cos(ang2),sin(ang2))*texsize.zw; | |
| 433 | + comp_23=` | |
| 434 | + comp_24=` ret = 1.4*pow(saturate(GetBlur1(uv))*((tex2D(sampler_pc_main,uv)-GetBlur3(uv))),0.5); //invert | |
| 435 | + comp_25=`} |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Aurora/Jc - Crystal Shards.milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=2 | |
| 3 | + PSVERSION_WARP=0 | |
| 4 | + PSVERSION_COMP=2 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.000 | |
| 8 | + fDecay=0.900 | |
| 9 | + fVideoEchoZoom=1.104 | |
| 10 | + fVideoEchoAlpha=0.500 | |
| 11 | + nVideoEchoOrientation=0 | |
| 12 | + nWaveMode=7 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=0 | |
| 16 | + bModWaveAlphaByVolume=1 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=1 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=1 | |
| 22 | + bDarken=1 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=0.001 | |
| 26 | + fWaveScale=1.286 | |
| 27 | + fWaveSmoothing=0.630 | |
| 28 | + fWaveParam=0.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=1.331 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=0.99951 | |
| 36 | + rot=0.25990 | |
| 37 | + cx=0.320 | |
| 38 | + cy=0.290 | |
| 39 | + dx=0.00000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.01105 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.500 | |
| 50 | + ob_r=0.010 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.000 | |
| 54 | + ib_size=0.260 | |
| 55 | + ib_r=0.250 | |
| 56 | + ib_g=0.250 | |
| 57 | + ib_b=0.250 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=1 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=1 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=0.000 | |
| 85 | + wavecode_0_g=0.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=0.050 | |
| 88 | + wave_0_init1=t1 = .2 + .6*int(rand(1001))*.001; | |
| 89 | + wave_0_init2=t2 = .2 + .6*int(rand(1001))*.001; | |
| 90 | + wave_0_init3=t3 = .2 + .6*int(rand(1001))*.001; | |
| 91 | + wave_0_init4=t4 = .2 + .6*int(rand(1001))*.001; | |
| 92 | + wave_0_init5=t5 = .2 + .6*int(rand(1001))*.001; | |
| 93 | + wave_0_init6=t6 = .2 + .6*int(rand(1001))*.001; | |
| 94 | + wave_0_init7=t7 = .2 + .6*int(rand(1001))*.001; | |
| 95 | + wave_0_init8=t8 = .2 + .6*int(rand(1001))*.001; | |
| 96 | + wave_0_per_point1=ti = q1; | |
| 97 | + wave_0_per_point2= | |
| 98 | + wave_0_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 99 | + wave_0_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 100 | + wave_0_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 101 | + wave_0_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 102 | + wave_0_per_point7= | |
| 103 | + wave_0_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 104 | + wave_0_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 105 | + wave_0_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 106 | + wave_0_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 107 | + wave_0_per_point12= | |
| 108 | + wave_0_per_point13= | |
| 109 | + wave_0_per_point14=it = (it + 1)*above(sample,0); | |
| 110 | + wave_0_per_point15=sw = (1-sw)*above(sample,0); | |
| 111 | + wave_0_per_point16= | |
| 112 | + wave_0_per_point17=sa = 1-sample; | |
| 113 | + wave_0_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 114 | + wave_0_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 115 | + wave_0_per_point20= | |
| 116 | + wave_0_per_point21=y = .5 - y*(.5-x)*2; | |
| 117 | + wave_0_per_point22= | |
| 118 | + wave_0_per_point23= | |
| 119 | + wave_0_per_point24=ti = q4; | |
| 120 | + wave_0_per_point25=r = .5 + .5*sin(ti); | |
| 121 | + wave_0_per_point26=g = .5 + .5*sin(ti + 2.0944); | |
| 122 | + wave_0_per_point27=b = .5 + .5*sin(ti + 4.1888); | |
| 123 | + wave_0_per_point28= | |
| 124 | + wave_0_per_point29=a = q5; | |
| 125 | + wavecode_1_enabled=1 | |
| 126 | + wavecode_1_samples=512 | |
| 127 | + wavecode_1_sep=0 | |
| 128 | + wavecode_1_bSpectrum=0 | |
| 129 | + wavecode_1_bUseDots=0 | |
| 130 | + wavecode_1_bDrawThick=0 | |
| 131 | + wavecode_1_bAdditive=1 | |
| 132 | + wavecode_1_scaling=1.00000 | |
| 133 | + wavecode_1_smoothing=0.50000 | |
| 134 | + wavecode_1_r=0.000 | |
| 135 | + wavecode_1_g=1.000 | |
| 136 | + wavecode_1_b=0.000 | |
| 137 | + wavecode_1_a=0.050 | |
| 138 | + wave_1_init1=t1 = .2 + .6*int(rand(1001))*.001; | |
| 139 | + wave_1_init2=t2 = .2 + .6*int(rand(1001))*.001; | |
| 140 | + wave_1_init3=t3 = .2 + .6*int(rand(1001))*.001; | |
| 141 | + wave_1_init4=t4 = .2 + .6*int(rand(1001))*.001; | |
| 142 | + wave_1_init5=t5 = .2 + .6*int(rand(1001))*.001; | |
| 143 | + wave_1_init6=t6 = .2 + .6*int(rand(1001))*.001; | |
| 144 | + wave_1_init7=t7 = .2 + .6*int(rand(1001))*.001; | |
| 145 | + wave_1_init8=t8 = .2 + .6*int(rand(1001))*.001; | |
| 146 | + wave_1_per_point1=ti = q2; | |
| 147 | + wave_1_per_point2= | |
| 148 | + wave_1_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 149 | + wave_1_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 150 | + wave_1_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 151 | + wave_1_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 152 | + wave_1_per_point7= | |
| 153 | + wave_1_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 154 | + wave_1_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 155 | + wave_1_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 156 | + wave_1_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 157 | + wave_1_per_point12= | |
| 158 | + wave_1_per_point13= | |
| 159 | + wave_1_per_point14=it = (it + 1)*above(sample,0); | |
| 160 | + wave_1_per_point15=sw = (1-sw)*above(sample,0); | |
| 161 | + wave_1_per_point16= | |
| 162 | + wave_1_per_point17=sa = 1-sample; | |
| 163 | + wave_1_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 164 | + wave_1_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 165 | + wave_1_per_point20= | |
| 166 | + wave_1_per_point21=y = .5 - y*(.5-x)*2; | |
| 167 | + wave_1_per_point22= | |
| 168 | + wave_1_per_point23=ti = q4 + 2.0944; | |
| 169 | + wave_1_per_point24=r = .5 + .5*sin(ti); | |
| 170 | + wave_1_per_point25=g = .5 + .5*sin(ti + 2.0944); | |
| 171 | + wave_1_per_point26=b = .5 + .5*sin(ti + 4.1888); | |
| 172 | + wave_1_per_point27= | |
| 173 | + wave_1_per_point28=a = q6; | |
| 174 | + wavecode_2_enabled=1 | |
| 175 | + wavecode_2_samples=512 | |
| 176 | + wavecode_2_sep=0 | |
| 177 | + wavecode_2_bSpectrum=0 | |
| 178 | + wavecode_2_bUseDots=0 | |
| 179 | + wavecode_2_bDrawThick=0 | |
| 180 | + wavecode_2_bAdditive=1 | |
| 181 | + wavecode_2_scaling=1.00000 | |
| 182 | + wavecode_2_smoothing=0.50000 | |
| 183 | + wavecode_2_r=1.000 | |
| 184 | + wavecode_2_g=0.000 | |
| 185 | + wavecode_2_b=0.000 | |
| 186 | + wavecode_2_a=0.050 | |
| 187 | + wave_2_init1=t1 = .2 + .6*int(rand(1001))*.001; | |
| 188 | + wave_2_init2=t2 = .2 + .6*int(rand(1001))*.001; | |
| 189 | + wave_2_init3=t3 = .2 + .6*int(rand(1001))*.001; | |
| 190 | + wave_2_init4=t4 = .2 + .6*int(rand(1001))*.001; | |
| 191 | + wave_2_init5=t5 = .2 + .6*int(rand(1001))*.001; | |
| 192 | + wave_2_init6=t6 = .2 + .6*int(rand(1001))*.001; | |
| 193 | + wave_2_init7=t7 = .2 + .6*int(rand(1001))*.001; | |
| 194 | + wave_2_init8=t8 = .2 + .6*int(rand(1001))*.001; | |
| 195 | + wave_2_per_point1=ti = q3; | |
| 196 | + wave_2_per_point2= | |
| 197 | + wave_2_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 198 | + wave_2_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 199 | + wave_2_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 200 | + wave_2_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 201 | + wave_2_per_point7= | |
| 202 | + wave_2_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 203 | + wave_2_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 204 | + wave_2_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 205 | + wave_2_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 206 | + wave_2_per_point12= | |
| 207 | + wave_2_per_point13= | |
| 208 | + wave_2_per_point14=it = (it + 1)*above(sample,0); | |
| 209 | + wave_2_per_point15=sw = (1-sw)*above(sample,0); | |
| 210 | + wave_2_per_point16= | |
| 211 | + wave_2_per_point17=sa = 1-sample; | |
| 212 | + wave_2_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 213 | + wave_2_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 214 | + wave_2_per_point20= | |
| 215 | + wave_2_per_point21=y = .5 - y*(.5-x)*2; | |
| 216 | + wave_2_per_point22= | |
| 217 | + wave_2_per_point23=ti = q4 + 4.1888; | |
| 218 | + wave_2_per_point24=r = .5 + .5*sin(ti); | |
| 219 | + wave_2_per_point25=g = .5 + .5*sin(ti + 2.0944); | |
| 220 | + wave_2_per_point26=b = .5 + .5*sin(ti + 4.1888); | |
| 221 | + wave_2_per_point27=a = q7; | |
| 222 | + wavecode_3_enabled=0 | |
| 223 | + wavecode_3_samples=512 | |
| 224 | + wavecode_3_sep=0 | |
| 225 | + wavecode_3_bSpectrum=0 | |
| 226 | + wavecode_3_bUseDots=0 | |
| 227 | + wavecode_3_bDrawThick=0 | |
| 228 | + wavecode_3_bAdditive=0 | |
| 229 | + wavecode_3_scaling=1.00000 | |
| 230 | + wavecode_3_smoothing=0.50000 | |
| 231 | + wavecode_3_r=1.000 | |
| 232 | + wavecode_3_g=1.000 | |
| 233 | + wavecode_3_b=1.000 | |
| 234 | + wavecode_3_a=1.000 | |
| 235 | + shapecode_0_enabled=1 | |
| 236 | + shapecode_0_sides=4 | |
| 237 | + shapecode_0_additive=0 | |
| 238 | + shapecode_0_thickOutline=0 | |
| 239 | + shapecode_0_textured=1 | |
| 240 | + shapecode_0_num_inst=1 | |
| 241 | + shapecode_0_x=0.500 | |
| 242 | + shapecode_0_y=0.500 | |
| 243 | + shapecode_0_rad=1.97883 | |
| 244 | + shapecode_0_ang=0.00000 | |
| 245 | + shapecode_0_tex_ang=0.00000 | |
| 246 | + shapecode_0_tex_zoom=1.00000 | |
| 247 | + shapecode_0_r=1.000 | |
| 248 | + shapecode_0_g=1.000 | |
| 249 | + shapecode_0_b=1.000 | |
| 250 | + shapecode_0_a=1.000 | |
| 251 | + shapecode_0_r2=1.000 | |
| 252 | + shapecode_0_g2=1.000 | |
| 253 | + shapecode_0_b2=1.000 | |
| 254 | + shapecode_0_a2=1.000 | |
| 255 | + shapecode_0_border_r=1.000 | |
| 256 | + shapecode_0_border_g=1.000 | |
| 257 | + shapecode_0_border_b=1.000 | |
| 258 | + shapecode_0_border_a=0.000 | |
| 259 | + shape_0_per_frame1=tex_zoom = 1/rad; | |
| 260 | + shape_0_per_frame2= | |
| 261 | + shape_0_per_frame3=a = .7; | |
| 262 | + shape_0_per_frame4=a2 = a; | |
| 263 | + shapecode_1_enabled=0 | |
| 264 | + shapecode_1_sides=54 | |
| 265 | + shapecode_1_additive=0 | |
| 266 | + shapecode_1_thickOutline=0 | |
| 267 | + shapecode_1_textured=0 | |
| 268 | + shapecode_1_num_inst=1 | |
| 269 | + shapecode_1_x=0.150 | |
| 270 | + shapecode_1_y=0.390 | |
| 271 | + shapecode_1_rad=0.04084 | |
| 272 | + shapecode_1_ang=0.00000 | |
| 273 | + shapecode_1_tex_ang=0.00000 | |
| 274 | + shapecode_1_tex_zoom=1.00000 | |
| 275 | + shapecode_1_r=0.000 | |
| 276 | + shapecode_1_g=0.000 | |
| 277 | + shapecode_1_b=1.000 | |
| 278 | + shapecode_1_a=1.000 | |
| 279 | + shapecode_1_r2=1.000 | |
| 280 | + shapecode_1_g2=0.000 | |
| 281 | + shapecode_1_b2=0.000 | |
| 282 | + shapecode_1_a2=0.000 | |
| 283 | + shapecode_1_border_r=1.000 | |
| 284 | + shapecode_1_border_g=1.000 | |
| 285 | + shapecode_1_border_b=1.000 | |
| 286 | + shapecode_1_border_a=0.100 | |
| 287 | + shapecode_2_enabled=0 | |
| 288 | + shapecode_2_sides=4 | |
| 289 | + shapecode_2_additive=0 | |
| 290 | + shapecode_2_thickOutline=0 | |
| 291 | + shapecode_2_textured=0 | |
| 292 | + shapecode_2_num_inst=1 | |
| 293 | + shapecode_2_x=0.500 | |
| 294 | + shapecode_2_y=0.500 | |
| 295 | + shapecode_2_rad=0.10000 | |
| 296 | + shapecode_2_ang=0.00000 | |
| 297 | + shapecode_2_tex_ang=0.00000 | |
| 298 | + shapecode_2_tex_zoom=1.00000 | |
| 299 | + shapecode_2_r=1.000 | |
| 300 | + shapecode_2_g=0.000 | |
| 301 | + shapecode_2_b=0.000 | |
| 302 | + shapecode_2_a=1.000 | |
| 303 | + shapecode_2_r2=0.000 | |
| 304 | + shapecode_2_g2=1.000 | |
| 305 | + shapecode_2_b2=0.000 | |
| 306 | + shapecode_2_a2=0.000 | |
| 307 | + shapecode_2_border_r=1.000 | |
| 308 | + shapecode_2_border_g=1.000 | |
| 309 | + shapecode_2_border_b=1.000 | |
| 310 | + shapecode_2_border_a=0.100 | |
| 311 | + shapecode_3_enabled=0 | |
| 312 | + shapecode_3_sides=4 | |
| 313 | + shapecode_3_additive=0 | |
| 314 | + shapecode_3_thickOutline=0 | |
| 315 | + shapecode_3_textured=0 | |
| 316 | + shapecode_3_num_inst=1 | |
| 317 | + shapecode_3_x=0.500 | |
| 318 | + shapecode_3_y=0.500 | |
| 319 | + shapecode_3_rad=0.10000 | |
| 320 | + shapecode_3_ang=0.00000 | |
| 321 | + shapecode_3_tex_ang=0.00000 | |
| 322 | + shapecode_3_tex_zoom=1.00000 | |
| 323 | + shapecode_3_r=1.000 | |
| 324 | + shapecode_3_g=0.000 | |
| 325 | + shapecode_3_b=0.000 | |
| 326 | + shapecode_3_a=1.000 | |
| 327 | + shapecode_3_r2=0.000 | |
| 328 | + shapecode_3_g2=1.000 | |
| 329 | + shapecode_3_b2=0.000 | |
| 330 | + shapecode_3_a2=0.000 | |
| 331 | + shapecode_3_border_r=1.000 | |
| 332 | + shapecode_3_border_g=1.000 | |
| 333 | + shapecode_3_border_b=1.000 | |
| 334 | + shapecode_3_border_a=0.100 | |
| 335 | + per_frame_1=warp = 0; | |
| 336 | + per_frame_2=//zoom = 1; | |
| 337 | + per_frame_3= | |
| 338 | + per_frame_4=tic = min(time-tin,.1); | |
| 339 | + per_frame_5=tin = time; | |
| 340 | + per_frame_6= | |
| 341 | + per_frame_7=vol = (bass_att + treb_att + mid_att)*.333333; | |
| 342 | + per_frame_8= | |
| 343 | + per_frame_9=ra = 1/tic*.25; | |
| 344 | + per_frame_10= | |
| 345 | + per_frame_11=treb_avg = tic*(treb_avg*(1/tic - ra) + ra*treb); | |
| 346 | + per_frame_12=mid_avg = tic*(mid_avg*(1/tic - ra) + ra*mid); | |
| 347 | + per_frame_13=bass_avg = tic*(bass_avg*(1/tic - ra) + ra*bass); | |
| 348 | + per_frame_14=vav = tic*(vav*(1/tic - ra) + ra*(bass+treb+mid)*.33333); | |
| 349 | + per_frame_15= | |
| 350 | + per_frame_16=tt = tt + tic*treb; | |
| 351 | + per_frame_17=mt = mt + tic*mid; | |
| 352 | + per_frame_18=bt = bt + tic*bass; | |
| 353 | + per_frame_19=vt = vt + tic*vav; | |
| 354 | + per_frame_20= | |
| 355 | + per_frame_21=q1 = tt*3;// wave morph speeds | |
| 356 | + per_frame_22=q2 = mt*3; | |
| 357 | + per_frame_23=q3 = bt*3; | |
| 358 | + per_frame_24= | |
| 359 | + per_frame_25=q4 = vt; // wave colour cycle | |
| 360 | + per_frame_26= | |
| 361 | + per_frame_27=rb = if(rb,rb,.2 + int(rand(1001))*.001*.6); | |
| 362 | + per_frame_28=rc = if(rc,rc,.2 + int(rand(1001))*.001*.6); | |
| 363 | + per_frame_29=rd = if(rd,rd,.2 + int(rand(1001))*.001*.6); | |
| 364 | + per_frame_30=re = if(re,re,.2 + int(rand(1001))*.001*.6); | |
| 365 | + per_frame_31= | |
| 366 | + per_frame_32=rot = .26; | |
| 367 | + per_frame_33=cx = .3 + .1*sin(vt*re) + .1*cos(vt*rc); | |
| 368 | + per_frame_34=cy = .5 + .2*sin(vt*rb) + .1*cos(vt*rd); | |
| 369 | + per_frame_35= | |
| 370 | + per_frame_36= | |
| 371 | + per_frame_37=q5 = min(1,.5*treb_avg)*.035; | |
| 372 | + per_frame_38=q6 = min(1,.5*mid_avg)*.035; | |
| 373 | + per_frame_39=q7 = min(1,.5*bass_avg)*.035; | |
| 374 | + per_frame_40= | |
| 375 | + per_frame_41= | |
| 376 | + per_pixel_1=num = 8; | |
| 377 | + per_pixel_2=pi = 3.141592654; | |
| 378 | + per_pixel_3=radi = (y-.5)*.75; | |
| 379 | + per_pixel_4=radi = (y-.5); | |
| 380 | + per_pixel_5=radi = pow(radi*radi + (x-.5)*(x-.5),.5); | |
| 381 | + per_pixel_6= | |
| 382 | + per_pixel_7=an = ang + pi + time; | |
| 383 | + per_pixel_8=an = an - pi*2*int(an/(pi*2)); | |
| 384 | + per_pixel_9= | |
| 385 | + per_pixel_10=mod = .1; | |
| 386 | + per_pixel_11= | |
| 387 | + per_pixel_12=seg = ang + pi; | |
| 388 | + per_pixel_13=seg = seg/(pi*2)*num; | |
| 389 | + per_pixel_14=seg = int(seg); | |
| 390 | + per_pixel_15=seg = seg - equal(seg,num); | |
| 391 | + per_pixel_16= | |
| 392 | + per_pixel_17=anga = (ang + pi) - (pi*2/num)*seg; | |
| 393 | + per_pixel_18=anga = if(equal(seg%2,0),(pi*2/num) - anga,anga); | |
| 394 | + per_pixel_19=//anga = anga + pi/6; // num = 6 | |
| 395 | + per_pixel_20=anga = anga + pi/4; // num = 8 | |
| 396 | + per_pixel_21=//anga = anga + .85; // num = 10 | |
| 397 | + per_pixel_22= | |
| 398 | + per_pixel_23= | |
| 399 | + per_pixel_24=ox = .5 - radi*sin(anga); | |
| 400 | + per_pixel_25=oy = .5 + radi*cos(anga); | |
| 401 | + per_pixel_26= | |
| 402 | + per_pixel_27=//rot = if(equal(seg,0),rot,0); | |
| 403 | + per_pixel_28= | |
| 404 | + per_pixel_29=dx = equal(seg,3)*(x-ox); | |
| 405 | + per_pixel_30=dy = equal(seg,3)*(y-oy); | |
| 406 | + per_pixel_31= | |
| 407 | + per_pixel_32=dx = above(seg,0)*(x-ox); | |
| 408 | + per_pixel_33=dy = above(seg,0)*(y-oy); | |
| 409 | + per_pixel_34= | |
| 410 | + per_pixel_35=//dx = equal(seg,1)*(x - .5)*2; | |
| 411 | + comp_1=`float3 ret1, neu, blur; | |
| 412 | + comp_2=` | |
| 413 | + comp_3=`shader_body | |
| 414 | + comp_4=`{ | |
| 415 | + comp_5=`float2 uv2; | |
| 416 | + comp_6=`float ang2, c, s; | |
| 417 | + comp_7=`uv -= 0.5; | |
| 418 | + comp_8=`uv *= aspect.xy; | |
| 419 | + comp_9=` | |
| 420 | + comp_10=`float2 tmp = uv; | |
| 421 | + comp_11=`ret1 = 0; | |
| 422 | + comp_12=`int anz = 5; | |
| 423 | + comp_13=`int n = 0; | |
| 424 | + comp_14=`while (n <= anz) { | |
| 425 | + comp_15=` ang2 = 6.28*n/anz; | |
| 426 | + comp_16=` c = cos(ang2); | |
| 427 | + comp_17=` s = sin(ang2); | |
| 428 | + comp_18=` uv2.x = uv.x*c - uv.y*s; | |
| 429 | + comp_19=` uv2.y = uv.x*s + uv.y*c; | |
| 430 | + comp_20=` neu = GetPixel (uv2 + 0.4 + .02*q27 ); | |
| 431 | + comp_21=` blur= GetBlur1 (uv2 + 0.4 + .02*q27 ); | |
| 432 | + comp_22=` ret1 = max(ret1, neu+blur*2); | |
| 433 | + comp_23=`n++; | |
| 434 | + comp_24=`} | |
| 435 | + comp_25=` | |
| 436 | + comp_26=` | |
| 437 | + comp_27=`// I think this bit's from ORB | |
| 438 | + comp_28=`ret = (ret1-0.0125)*0.7; | |
| 439 | + comp_29=` float3 retish = 1 - ret*(1-ret)*4; //solarize | |
| 440 | + comp_30=` ret = float3(retish[0]*0.5,retish[1]*0.5,retish[2]); | |
| 441 | + comp_31=` ret *= 0.5; | |
| 442 | + comp_32=` | |
| 443 | + comp_33=` | |
| 444 | + comp_34=`} |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Aurora/Jc - Flower.milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=3 | |
| 3 | + PSVERSION_WARP=3 | |
| 4 | + PSVERSION_COMP=2 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.000 | |
| 8 | + fDecay=0.900 | |
| 9 | + fVideoEchoZoom=1.104 | |
| 10 | + fVideoEchoAlpha=0.500 | |
| 11 | + nVideoEchoOrientation=0 | |
| 12 | + nWaveMode=7 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=0 | |
| 16 | + bModWaveAlphaByVolume=1 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=1 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=1 | |
| 22 | + bDarken=1 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=0.001 | |
| 26 | + fWaveScale=1.286 | |
| 27 | + fWaveSmoothing=0.630 | |
| 28 | + fWaveParam=0.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=1.331 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=0.99951 | |
| 36 | + rot=0.25990 | |
| 37 | + cx=0.320 | |
| 38 | + cy=0.290 | |
| 39 | + dx=0.00000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.01105 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.500 | |
| 50 | + ob_r=0.010 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.000 | |
| 54 | + ib_size=0.260 | |
| 55 | + ib_r=0.250 | |
| 56 | + ib_g=0.250 | |
| 57 | + ib_b=0.250 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=1 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=1 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=0.000 | |
| 85 | + wavecode_0_g=0.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=0.050 | |
| 88 | + wave_0_init1=t1 = .2 + .6*rand(1001)*.001; | |
| 89 | + wave_0_init2=t2 = .2 + .6*rand(1001)*.001; | |
| 90 | + wave_0_init3=t3 = .2 + .6*rand(1001)*.001; | |
| 91 | + wave_0_init4=t4 = .2 + .6*rand(1001)*.001; | |
| 92 | + wave_0_init5=t5 = .2 + .6*rand(1001)*.001; | |
| 93 | + wave_0_init6=t6 = .2 + .6*rand(1001)*.001; | |
| 94 | + wave_0_init7=t7 = .2 + .6*rand(1001)*.001; | |
| 95 | + wave_0_init8=t8 = .2 + .6*rand(1001)*.001; | |
| 96 | + wave_0_per_point1=ti = q1; | |
| 97 | + wave_0_per_point2= | |
| 98 | + wave_0_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 99 | + wave_0_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 100 | + wave_0_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 101 | + wave_0_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 102 | + wave_0_per_point7= | |
| 103 | + wave_0_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 104 | + wave_0_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 105 | + wave_0_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 106 | + wave_0_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 107 | + wave_0_per_point12= | |
| 108 | + wave_0_per_point13= | |
| 109 | + wave_0_per_point14=it = (it + 1)*above(sample,0); | |
| 110 | + wave_0_per_point15=sw = (1-sw)*above(sample,0); | |
| 111 | + wave_0_per_point16= | |
| 112 | + wave_0_per_point17=sa = 1-sample; | |
| 113 | + wave_0_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 114 | + wave_0_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 115 | + wave_0_per_point20= | |
| 116 | + wave_0_per_point21=y = .5 - y*(.5-x)*2; | |
| 117 | + wave_0_per_point22= | |
| 118 | + wave_0_per_point23= | |
| 119 | + wave_0_per_point24=ti = q4; | |
| 120 | + wave_0_per_point25=r = .5 + .5*sin(ti); | |
| 121 | + wave_0_per_point26=g = .5 + .5*sin(ti + 2.0944); | |
| 122 | + wave_0_per_point27=b = .5 + .5*sin(ti + 4.1888); | |
| 123 | + wave_0_per_point28= | |
| 124 | + wave_0_per_point29=a = q5; | |
| 125 | + wavecode_1_enabled=1 | |
| 126 | + wavecode_1_samples=512 | |
| 127 | + wavecode_1_sep=0 | |
| 128 | + wavecode_1_bSpectrum=0 | |
| 129 | + wavecode_1_bUseDots=0 | |
| 130 | + wavecode_1_bDrawThick=0 | |
| 131 | + wavecode_1_bAdditive=1 | |
| 132 | + wavecode_1_scaling=1.00000 | |
| 133 | + wavecode_1_smoothing=0.50000 | |
| 134 | + wavecode_1_r=0.000 | |
| 135 | + wavecode_1_g=1.000 | |
| 136 | + wavecode_1_b=0.000 | |
| 137 | + wavecode_1_a=0.050 | |
| 138 | + wave_1_init1=t1 = .2 + .6*rand(1001)*.001; | |
| 139 | + wave_1_init2=t2 = .2 + .6*rand(1001)*.001; | |
| 140 | + wave_1_init3=t3 = .2 + .6*rand(1001)*.001; | |
| 141 | + wave_1_init4=t4 = .2 + .6*rand(1001)*.001; | |
| 142 | + wave_1_init5=t5 = .2 + .6*rand(1001)*.001; | |
| 143 | + wave_1_init6=t6 = .2 + .6*rand(1001)*.001; | |
| 144 | + wave_1_init7=t7 = .2 + .6*rand(1001)*.001; | |
| 145 | + wave_1_init8=t8 = .2 + .6*rand(1001)*.001; | |
| 146 | + wave_1_per_point1=ti = q2; | |
| 147 | + wave_1_per_point2= | |
| 148 | + wave_1_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 149 | + wave_1_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 150 | + wave_1_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 151 | + wave_1_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 152 | + wave_1_per_point7= | |
| 153 | + wave_1_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 154 | + wave_1_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 155 | + wave_1_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 156 | + wave_1_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 157 | + wave_1_per_point12= | |
| 158 | + wave_1_per_point13= | |
| 159 | + wave_1_per_point14=it = (it + 1)*above(sample,0); | |
| 160 | + wave_1_per_point15=sw = (1-sw)*above(sample,0); | |
| 161 | + wave_1_per_point16= | |
| 162 | + wave_1_per_point17=sa = 1-sample; | |
| 163 | + wave_1_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 164 | + wave_1_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 165 | + wave_1_per_point20= | |
| 166 | + wave_1_per_point21=y = .5 - y*(.5-x)*2; | |
| 167 | + wave_1_per_point22= | |
| 168 | + wave_1_per_point23=ti = q4 + 2.0944; | |
| 169 | + wave_1_per_point24=r = .5 + .5*sin(ti); | |
| 170 | + wave_1_per_point25=g = .5 + .5*sin(ti + 2.0944); | |
| 171 | + wave_1_per_point26=b = .5 + .5*sin(ti + 4.1888); | |
| 172 | + wave_1_per_point27= | |
| 173 | + wave_1_per_point28=a = q6; | |
| 174 | + wavecode_2_enabled=1 | |
| 175 | + wavecode_2_samples=512 | |
| 176 | + wavecode_2_sep=0 | |
| 177 | + wavecode_2_bSpectrum=0 | |
| 178 | + wavecode_2_bUseDots=0 | |
| 179 | + wavecode_2_bDrawThick=0 | |
| 180 | + wavecode_2_bAdditive=1 | |
| 181 | + wavecode_2_scaling=1.00000 | |
| 182 | + wavecode_2_smoothing=0.50000 | |
| 183 | + wavecode_2_r=1.000 | |
| 184 | + wavecode_2_g=0.000 | |
| 185 | + wavecode_2_b=0.000 | |
| 186 | + wavecode_2_a=0.050 | |
| 187 | + wave_2_init1=t1 = .2 + .6*rand(1001)*.001; | |
| 188 | + wave_2_init2=t2 = .2 + .6*rand(1001)*.001; | |
| 189 | + wave_2_init3=t3 = .2 + .6*rand(1001)*.001; | |
| 190 | + wave_2_init4=t4 = .2 + .6*rand(1001)*.001; | |
| 191 | + wave_2_init5=t5 = .2 + .6*rand(1001)*.001; | |
| 192 | + wave_2_init6=t6 = .2 + .6*rand(1001)*.001; | |
| 193 | + wave_2_init7=t7 = .2 + .6*rand(1001)*.001; | |
| 194 | + wave_2_init8=t8 = .2 + .6*rand(1001)*.001; | |
| 195 | + wave_2_per_point1=ti = q3; | |
| 196 | + wave_2_per_point2= | |
| 197 | + wave_2_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 198 | + wave_2_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 199 | + wave_2_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 200 | + wave_2_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 201 | + wave_2_per_point7= | |
| 202 | + wave_2_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 203 | + wave_2_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 204 | + wave_2_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 205 | + wave_2_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 206 | + wave_2_per_point12= | |
| 207 | + wave_2_per_point13= | |
| 208 | + wave_2_per_point14=it = (it + 1)*above(sample,0); | |
| 209 | + wave_2_per_point15=sw = (1-sw)*above(sample,0); | |
| 210 | + wave_2_per_point16= | |
| 211 | + wave_2_per_point17=sa = 1-sample; | |
| 212 | + wave_2_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 213 | + wave_2_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 214 | + wave_2_per_point20= | |
| 215 | + wave_2_per_point21=y = .5 - y*(.5-x)*2; | |
| 216 | + wave_2_per_point22= | |
| 217 | + wave_2_per_point23=ti = q4 + 4.1888; | |
| 218 | + wave_2_per_point24=r = .5 + .5*sin(ti); | |
| 219 | + wave_2_per_point25=g = .5 + .5*sin(ti + 2.0944); | |
| 220 | + wave_2_per_point26=b = .5 + .5*sin(ti + 4.1888); | |
| 221 | + wave_2_per_point27=a = q7; | |
| 222 | + wavecode_3_enabled=0 | |
| 223 | + wavecode_3_samples=512 | |
| 224 | + wavecode_3_sep=0 | |
| 225 | + wavecode_3_bSpectrum=0 | |
| 226 | + wavecode_3_bUseDots=0 | |
| 227 | + wavecode_3_bDrawThick=0 | |
| 228 | + wavecode_3_bAdditive=0 | |
| 229 | + wavecode_3_scaling=1.00000 | |
| 230 | + wavecode_3_smoothing=0.50000 | |
| 231 | + wavecode_3_r=1.000 | |
| 232 | + wavecode_3_g=1.000 | |
| 233 | + wavecode_3_b=1.000 | |
| 234 | + wavecode_3_a=1.000 | |
| 235 | + shapecode_0_enabled=1 | |
| 236 | + shapecode_0_sides=4 | |
| 237 | + shapecode_0_additive=0 | |
| 238 | + shapecode_0_thickOutline=0 | |
| 239 | + shapecode_0_textured=1 | |
| 240 | + shapecode_0_num_inst=1 | |
| 241 | + shapecode_0_x=0.500 | |
| 242 | + shapecode_0_y=0.500 | |
| 243 | + shapecode_0_rad=1.97883 | |
| 244 | + shapecode_0_ang=0.00000 | |
| 245 | + shapecode_0_tex_ang=0.00000 | |
| 246 | + shapecode_0_tex_zoom=1.00000 | |
| 247 | + shapecode_0_r=1.000 | |
| 248 | + shapecode_0_g=1.000 | |
| 249 | + shapecode_0_b=1.000 | |
| 250 | + shapecode_0_a=1.000 | |
| 251 | + shapecode_0_r2=1.000 | |
| 252 | + shapecode_0_g2=1.000 | |
| 253 | + shapecode_0_b2=1.000 | |
| 254 | + shapecode_0_a2=1.000 | |
| 255 | + shapecode_0_border_r=1.000 | |
| 256 | + shapecode_0_border_g=1.000 | |
| 257 | + shapecode_0_border_b=1.000 | |
| 258 | + shapecode_0_border_a=0.000 | |
| 259 | + shape_0_per_frame1=tex_zoom = 1/rad; | |
| 260 | + shape_0_per_frame2= | |
| 261 | + shape_0_per_frame3=a = .7; | |
| 262 | + shape_0_per_frame4=a2 = a; | |
| 263 | + shapecode_1_enabled=0 | |
| 264 | + shapecode_1_sides=54 | |
| 265 | + shapecode_1_additive=0 | |
| 266 | + shapecode_1_thickOutline=0 | |
| 267 | + shapecode_1_textured=0 | |
| 268 | + shapecode_1_num_inst=1 | |
| 269 | + shapecode_1_x=0.150 | |
| 270 | + shapecode_1_y=0.390 | |
| 271 | + shapecode_1_rad=0.04084 | |
| 272 | + shapecode_1_ang=0.00000 | |
| 273 | + shapecode_1_tex_ang=0.00000 | |
| 274 | + shapecode_1_tex_zoom=1.00000 | |
| 275 | + shapecode_1_r=0.000 | |
| 276 | + shapecode_1_g=0.000 | |
| 277 | + shapecode_1_b=1.000 | |
| 278 | + shapecode_1_a=1.000 | |
| 279 | + shapecode_1_r2=1.000 | |
| 280 | + shapecode_1_g2=0.000 | |
| 281 | + shapecode_1_b2=0.000 | |
| 282 | + shapecode_1_a2=0.000 | |
| 283 | + shapecode_1_border_r=1.000 | |
| 284 | + shapecode_1_border_g=1.000 | |
| 285 | + shapecode_1_border_b=1.000 | |
| 286 | + shapecode_1_border_a=0.100 | |
| 287 | + shapecode_2_enabled=0 | |
| 288 | + shapecode_2_sides=4 | |
| 289 | + shapecode_2_additive=0 | |
| 290 | + shapecode_2_thickOutline=0 | |
| 291 | + shapecode_2_textured=0 | |
| 292 | + shapecode_2_num_inst=1 | |
| 293 | + shapecode_2_x=0.500 | |
| 294 | + shapecode_2_y=0.500 | |
| 295 | + shapecode_2_rad=0.10000 | |
| 296 | + shapecode_2_ang=0.00000 | |
| 297 | + shapecode_2_tex_ang=0.00000 | |
| 298 | + shapecode_2_tex_zoom=1.00000 | |
| 299 | + shapecode_2_r=1.000 | |
| 300 | + shapecode_2_g=0.000 | |
| 301 | + shapecode_2_b=0.000 | |
| 302 | + shapecode_2_a=1.000 | |
| 303 | + shapecode_2_r2=0.000 | |
| 304 | + shapecode_2_g2=1.000 | |
| 305 | + shapecode_2_b2=0.000 | |
| 306 | + shapecode_2_a2=0.000 | |
| 307 | + shapecode_2_border_r=1.000 | |
| 308 | + shapecode_2_border_g=1.000 | |
| 309 | + shapecode_2_border_b=1.000 | |
| 310 | + shapecode_2_border_a=0.100 | |
| 311 | + shapecode_3_enabled=0 | |
| 312 | + shapecode_3_sides=4 | |
| 313 | + shapecode_3_additive=0 | |
| 314 | + shapecode_3_thickOutline=0 | |
| 315 | + shapecode_3_textured=0 | |
| 316 | + shapecode_3_num_inst=1 | |
| 317 | + shapecode_3_x=0.500 | |
| 318 | + shapecode_3_y=0.500 | |
| 319 | + shapecode_3_rad=0.10000 | |
| 320 | + shapecode_3_ang=0.00000 | |
| 321 | + shapecode_3_tex_ang=0.00000 | |
| 322 | + shapecode_3_tex_zoom=1.00000 | |
| 323 | + shapecode_3_r=1.000 | |
| 324 | + shapecode_3_g=0.000 | |
| 325 | + shapecode_3_b=0.000 | |
| 326 | + shapecode_3_a=1.000 | |
| 327 | + shapecode_3_r2=0.000 | |
| 328 | + shapecode_3_g2=1.000 | |
| 329 | + shapecode_3_b2=0.000 | |
| 330 | + shapecode_3_a2=0.000 | |
| 331 | + shapecode_3_border_r=1.000 | |
| 332 | + shapecode_3_border_g=1.000 | |
| 333 | + shapecode_3_border_b=1.000 | |
| 334 | + shapecode_3_border_a=0.100 | |
| 335 | + per_frame_1=warp = 0; | |
| 336 | + per_frame_2=//zoom = 1; | |
| 337 | + per_frame_3= | |
| 338 | + per_frame_4=tic = min(time-tin,.1); | |
| 339 | + per_frame_5=tin = time; | |
| 340 | + per_frame_6= | |
| 341 | + per_frame_7=vol = (bass_att + treb_att + mid_att)*.333333; | |
| 342 | + per_frame_8= | |
| 343 | + per_frame_9=ra = 1/tic*.25; | |
| 344 | + per_frame_10= | |
| 345 | + per_frame_11=treb_avg = tic*(treb_avg*(1/tic - ra) + ra*treb); | |
| 346 | + per_frame_12=mid_avg = tic*(mid_avg*(1/tic - ra) + ra*mid); | |
| 347 | + per_frame_13=bass_avg = tic*(bass_avg*(1/tic - ra) + ra*bass); | |
| 348 | + per_frame_14=vav = tic*(vav*(1/tic - ra) + ra*(bass+treb+mid)*.33333); | |
| 349 | + per_frame_15= | |
| 350 | + per_frame_16=tt = tt + tic*treb; | |
| 351 | + per_frame_17=mt = mt + tic*mid; | |
| 352 | + per_frame_18=bt = bt + tic*bass; | |
| 353 | + per_frame_19=vt = vt + tic*vav; | |
| 354 | + per_frame_20= | |
| 355 | + per_frame_21=q1 = tt*3;// wave morph speeds | |
| 356 | + per_frame_22=q2 = mt*3; | |
| 357 | + per_frame_23=q3 = bt*3; | |
| 358 | + per_frame_24= | |
| 359 | + per_frame_25=q4 = vt; // wave colour cycle | |
| 360 | + per_frame_26= | |
| 361 | + per_frame_27=rb = if(rb,rb,.2 + rand(1001)*.001*.6); | |
| 362 | + per_frame_28=rc = if(rc,rc,.2 + rand(1001)*.001*.6); | |
| 363 | + per_frame_29=rd = if(rd,rd,.2 + rand(1001)*.001*.6); | |
| 364 | + per_frame_30=re = if(re,re,.2 + rand(1001)*.001*.6); | |
| 365 | + per_frame_31= | |
| 366 | + per_frame_32=rot = .26; | |
| 367 | + per_frame_33=cx = .3 + .1*sin(vt*re) + .1*cos(vt*rc); | |
| 368 | + per_frame_34=cy = .5 + .2*sin(vt*rb) + .1*cos(vt*rd); | |
| 369 | + per_frame_35= | |
| 370 | + per_frame_36= | |
| 371 | + per_frame_37=q5 = min(1,.5*treb_avg)*.035; | |
| 372 | + per_frame_38=q6 = min(1,.5*mid_avg)*.035; | |
| 373 | + per_frame_39=q7 = min(1,.5*bass_avg)*.035; | |
| 374 | + per_frame_40= | |
| 375 | + per_frame_41= | |
| 376 | + per_pixel_1=num = 8; | |
| 377 | + per_pixel_2=pi = 3.141592654; | |
| 378 | + per_pixel_3=radi = (y-.5)*.75; | |
| 379 | + per_pixel_4=radi = (y-.5); | |
| 380 | + per_pixel_5=radi = pow(radi*radi + (x-.5)*(x-.5),.5); | |
| 381 | + per_pixel_6= | |
| 382 | + per_pixel_7=an = ang + pi + time; | |
| 383 | + per_pixel_8=an = an - pi*2*int(an/(pi*2)); | |
| 384 | + per_pixel_9= | |
| 385 | + per_pixel_10=mod = .1; | |
| 386 | + per_pixel_11= | |
| 387 | + per_pixel_12=seg = ang + pi; | |
| 388 | + per_pixel_13=seg = seg/(pi*2)*num; | |
| 389 | + per_pixel_14=seg = int(seg); | |
| 390 | + per_pixel_15=seg = seg - equal(seg,num); | |
| 391 | + per_pixel_16= | |
| 392 | + per_pixel_17=anga = (ang + pi) - (pi*2/num)*seg; | |
| 393 | + per_pixel_18=anga = if(equal(seg%2,0),(pi*2/num) - anga,anga); | |
| 394 | + per_pixel_19=//anga = anga + pi/6; // num = 6 | |
| 395 | + per_pixel_20=anga = anga + pi/4; // num = 8 | |
| 396 | + per_pixel_21=//anga = anga + .85; // num = 10 | |
| 397 | + per_pixel_22= | |
| 398 | + per_pixel_23= | |
| 399 | + per_pixel_24=ox = .5 - radi*sin(anga); | |
| 400 | + per_pixel_25=oy = .5 + radi*cos(anga); | |
| 401 | + per_pixel_26= | |
| 402 | + per_pixel_27=//rot = if(equal(seg,0),rot,0); | |
| 403 | + per_pixel_28= | |
| 404 | + per_pixel_29=dx = equal(seg,3)*(x-ox); | |
| 405 | + per_pixel_30=dy = equal(seg,3)*(y-oy); | |
| 406 | + per_pixel_31= | |
| 407 | + per_pixel_32=dx = above(seg,0)*(x-ox); | |
| 408 | + per_pixel_33=dy = above(seg,0)*(y-oy); | |
| 409 | + per_pixel_34= | |
| 410 | + per_pixel_35=//dx = equal(seg,1)*(x - .5)*2; | |
| 411 | + warp_1=`shader_body { | |
| 412 | + warp_2=` | |
| 413 | + warp_3=`float2 uv1 = float2(uv.x-0.5,uv.y-0.5);//*aspect.xy; | |
| 414 | + warp_4=` | |
| 415 | + warp_5=`float3 noiseVal =.016*(tex2D(sampler_noise_lq, uv*.3+.01*rand_frame)); | |
| 416 | + warp_6=`float3 Feedback = GetBlur1(1-uv); | |
| 417 | + warp_7=` | |
| 418 | + warp_8=`float2 uv2 = .8*sin((uv1)*8);; | |
| 419 | + warp_9=`float dots = saturate(.01/length(uv2)); | |
| 420 | + warp_10=` | |
| 421 | + warp_11=`float2 zz = -uv1 *texsize.xy *q26; | |
| 422 | + warp_12=` | |
| 423 | + warp_13=`if (q25 ==1) {zz *= (abs(uv1.y)/abs(uv1.x));} | |
| 424 | + warp_14=`else if (q25==2) {zz *= (abs(uv1.y)-abs(uv1.x));} | |
| 425 | + warp_15=` | |
| 426 | + warp_16=` | |
| 427 | + warp_17=`float2 h1 = clamp(tan(zz),-20,20); | |
| 428 | + warp_18=` | |
| 429 | + warp_19=`uv.xy += h1*texsize.zw * 4; | |
| 430 | + warp_20=` | |
| 431 | + warp_21=`float3 crisp1 = tex2D(sampler_main,uv) + dots; | |
| 432 | + warp_22=`float blur = GetBlur2 (uv); | |
| 433 | + warp_23=`ret = .95*crisp1+noiseVal-.02 - .06*blur; | |
| 434 | + warp_24=` | |
| 435 | + warp_25=` | |
| 436 | + warp_26=`} | |
| 437 | + comp_1=`shader_body | |
| 438 | + comp_2=`{ | |
| 439 | + comp_3=` float rad_lq = rad * length(texsize.xy)*0.5; | |
| 440 | + comp_4=` float ang_lq = ang; | |
| 441 | + comp_5=` float2 uv_temp1 = (uv - 0.5) * texsize.xy; | |
| 442 | + comp_6=` float rad_hq = length(uv_temp1); | |
| 443 | + comp_7=` float ang_hq = atan2(-uv_temp1.y, uv_temp1.x); | |
| 444 | + comp_8=` | |
| 445 | + comp_9=` float2 uv2 = (uv - 0.5); | |
| 446 | + comp_10=` float rad2 = rad_lq*0.8; | |
| 447 | + comp_11=` float ang2 = ang_lq * M_INV_PI_2; | |
| 448 | + comp_12=` | |
| 449 | + comp_13=` // ROTATION OVER TIME | |
| 450 | + comp_14=` #if 1 | |
| 451 | + comp_15=` ang2 += time*0.025; //rotate over time | |
| 452 | + comp_16=` #endif | |
| 453 | + comp_17=` | |
| 454 | + comp_18=` // FIN TYPE | |
| 455 | + comp_19=` float fins = 3 + floor(rand_preset.z*5.95); | |
| 456 | + comp_20=` #if 1 // SHARP FINS | |
| 457 | + comp_21=` ang2 = frac(ang2*fins)/fins; | |
| 458 | + comp_22=` // ENABLE THIS TO MAKE THE FINS ALTERNATE: (seamless!) | |
| 459 | + comp_23=` ang2 = abs(ang2 - 0.5/fins); | |
| 460 | + comp_24=` #else // COSINE FINS - a bit slow | |
| 461 | + comp_25=` ang2 = cos(ang2*M_PI_2*fins) * 0.023; | |
| 462 | + comp_26=` #endif | |
| 463 | + comp_27=` | |
| 464 | + comp_28=` // RADIAL KALEIDOSCOPING? | |
| 465 | + comp_29=` #if 0 | |
| 466 | + comp_30=` rad2 *= g_fTexSize.z; | |
| 467 | + comp_31=` // choose one: | |
| 468 | + comp_32=` //rad2 = lerp(rad2, frac(rad2*3)/3.0, 0.5); | |
| 469 | + comp_33=` rad2 = cos(rad2*5); | |
| 470 | + comp_34=` //rad2 = sqrt(rad2)*0.5; | |
| 471 | + comp_35=` //rad2 += abs(frac(rad2*7)-0.5)/7.0 * 1.15; // stepifier | |
| 472 | + comp_36=` //rad2 += cos(rad2*61)*0.02; | |
| 473 | + comp_37=` rad2 *= g_fTexSize.x; | |
| 474 | + comp_38=` #endif | |
| 475 | + comp_39=` | |
| 476 | + comp_40=` ang2 *= M_PI_2; | |
| 477 | + comp_41=` uv2 = 0.5 + rad2*float2(cos(ang2),sin(ang2))*texsize.zw; | |
| 478 | + comp_42=` | |
| 479 | + comp_43=` ret = tex2D(sampler_main,uv2).y*float3(0.6,0.2,1.5) + tex2D(sampler_fw_main,uv2).x*float3(1,0.66,0) - tex2D(sampler_main,uv2).z*float3(-0.6,1,2); | |
| 480 | + comp_44=`} |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Aurora/shifter - urchin kali b.milk added
| 1 | + [preset00] | |
| 2 | + fRating=5.000000 | |
| 3 | + fGammaAdj=1.000000 | |
| 4 | + fDecay=0.910000 | |
| 5 | + fVideoEchoZoom=1.104100 | |
| 6 | + fVideoEchoAlpha=0.500000 | |
| 7 | + nVideoEchoOrientation=0 | |
| 8 | + nWaveMode=7 | |
| 9 | + bAdditiveWaves=1 | |
| 10 | + bWaveDots=0 | |
| 11 | + bWaveThick=0 | |
| 12 | + bModWaveAlphaByVolume=1 | |
| 13 | + bMaximizeWaveColor=0 | |
| 14 | + bTexWrap=1 | |
| 15 | + bDarkenCenter=0 | |
| 16 | + bRedBlueStereo=0 | |
| 17 | + bBrighten=1 | |
| 18 | + bDarken=1 | |
| 19 | + bSolarize=0 | |
| 20 | + bInvert=0 | |
| 21 | + fWaveAlpha=0.001000 | |
| 22 | + fWaveScale=1.285751 | |
| 23 | + fWaveSmoothing=0.630000 | |
| 24 | + fWaveParam=0.000000 | |
| 25 | + fModWaveAlphaStart=0.710000 | |
| 26 | + fModWaveAlphaEnd=1.300000 | |
| 27 | + fWarpAnimSpeed=1.000000 | |
| 28 | + fWarpScale=1.331000 | |
| 29 | + fZoomExponent=1.000000 | |
| 30 | + fShader=0.000000 | |
| 31 | + zoom=0.999514 | |
| 32 | + rot=0.260000 | |
| 33 | + cx=0.320000 | |
| 34 | + cy=0.289900 | |
| 35 | + dx=0.000000 | |
| 36 | + dy=0.000000 | |
| 37 | + warp=0.011046 | |
| 38 | + sx=1.000000 | |
| 39 | + sy=1.000000 | |
| 40 | + wave_r=0.650000 | |
| 41 | + wave_g=0.650000 | |
| 42 | + wave_b=0.650000 | |
| 43 | + wave_x=0.500000 | |
| 44 | + wave_y=0.500000 | |
| 45 | + ob_size=0.500000 | |
| 46 | + ob_r=0.010000 | |
| 47 | + ob_g=0.000000 | |
| 48 | + ob_b=0.000000 | |
| 49 | + ob_a=0.000000 | |
| 50 | + ib_size=0.260000 | |
| 51 | + ib_r=0.250000 | |
| 52 | + ib_g=0.250000 | |
| 53 | + ib_b=0.250000 | |
| 54 | + ib_a=0.000000 | |
| 55 | + nMotionVectorsX=12.000000 | |
| 56 | + nMotionVectorsY=9.000000 | |
| 57 | + mv_dx=0.000000 | |
| 58 | + mv_dy=0.000000 | |
| 59 | + mv_l=0.900000 | |
| 60 | + mv_r=1.000000 | |
| 61 | + mv_g=1.000000 | |
| 62 | + mv_b=1.000000 | |
| 63 | + mv_a=0.000000 | |
| 64 | + wavecode_0_enabled=1 | |
| 65 | + wavecode_0_samples=512 | |
| 66 | + wavecode_0_sep=0 | |
| 67 | + wavecode_0_bSpectrum=0 | |
| 68 | + wavecode_0_bUseDots=0 | |
| 69 | + wavecode_0_bDrawThick=0 | |
| 70 | + wavecode_0_bAdditive=1 | |
| 71 | + wavecode_0_scaling=1.000000 | |
| 72 | + wavecode_0_smoothing=0.500000 | |
| 73 | + wavecode_0_r=0.000000 | |
| 74 | + wavecode_0_g=0.000000 | |
| 75 | + wavecode_0_b=1.000000 | |
| 76 | + wavecode_0_a=0.050000 | |
| 77 | + wave_0_init1=t1 = .2 + .6*int(rand(1001))*.001; | |
| 78 | + wave_0_init2=t2 = .2 + .6*int(rand(1001))*.001; | |
| 79 | + wave_0_init3=t3 = .2 + .6*int(rand(1001))*.001; | |
| 80 | + wave_0_init4=t4 = .2 + .6*int(rand(1001))*.001; | |
| 81 | + wave_0_init5=t5 = .2 + .6*int(rand(1001))*.001; | |
| 82 | + wave_0_init6=t6 = .2 + .6*int(rand(1001))*.001; | |
| 83 | + wave_0_init7=t7 = .2 + .6*int(rand(1001))*.001; | |
| 84 | + wave_0_init8=t8 = .2 + .6*int(rand(1001))*.001; | |
| 85 | + wave_0_per_frame1=ti = q4; | |
| 86 | + wave_0_per_frame2=r = .5 + .5*sin(ti); | |
| 87 | + wave_0_per_frame3=g = .5 + .5*sin(ti + 2.0944); | |
| 88 | + wave_0_per_frame4=b = .5 + .5*sin(ti + 4.1888); | |
| 89 | + wave_0_per_frame5=a = q5; | |
| 90 | + wave_0_per_point1=ti = q1; | |
| 91 | + wave_0_per_point2= | |
| 92 | + wave_0_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 93 | + wave_0_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 94 | + wave_0_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 95 | + wave_0_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 96 | + wave_0_per_point7= | |
| 97 | + wave_0_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 98 | + wave_0_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 99 | + wave_0_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 100 | + wave_0_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 101 | + wave_0_per_point12= | |
| 102 | + wave_0_per_point13= | |
| 103 | + wave_0_per_point14=it = (it + 1)*above(sample,0); | |
| 104 | + wave_0_per_point15=sw = (1-sw)*above(sample,0); | |
| 105 | + wave_0_per_point16= | |
| 106 | + wave_0_per_point17=sa = 1-sample; | |
| 107 | + wave_0_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 108 | + wave_0_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 109 | + wave_0_per_point20= | |
| 110 | + wave_0_per_point21=y = .5 - y*(.5-x)*2; | |
| 111 | + wave_0_per_point22= | |
| 112 | + wave_0_per_point23= | |
| 113 | + wavecode_1_enabled=1 | |
| 114 | + wavecode_1_samples=512 | |
| 115 | + wavecode_1_sep=0 | |
| 116 | + wavecode_1_bSpectrum=0 | |
| 117 | + wavecode_1_bUseDots=0 | |
| 118 | + wavecode_1_bDrawThick=0 | |
| 119 | + wavecode_1_bAdditive=1 | |
| 120 | + wavecode_1_scaling=1.000000 | |
| 121 | + wavecode_1_smoothing=0.500000 | |
| 122 | + wavecode_1_r=0.000000 | |
| 123 | + wavecode_1_g=1.000000 | |
| 124 | + wavecode_1_b=0.000000 | |
| 125 | + wavecode_1_a=0.050000 | |
| 126 | + wave_1_init1=t1 = .2 + .6*int(rand(1001))*.001; | |
| 127 | + wave_1_init2=t2 = .2 + .6*int(rand(1001))*.001; | |
| 128 | + wave_1_init3=t3 = .2 + .6*int(rand(1001))*.001; | |
| 129 | + wave_1_init4=t4 = .2 + .6*int(rand(1001))*.001; | |
| 130 | + wave_1_init5=t5 = .2 + .6*int(rand(1001))*.001; | |
| 131 | + wave_1_init6=t6 = .2 + .6*int(rand(1001))*.001; | |
| 132 | + wave_1_init7=t7 = .2 + .6*int(rand(1001))*.001; | |
| 133 | + wave_1_init8=t8 = .2 + .6*int(rand(1001))*.001; | |
| 134 | + wave_1_per_frame1=a = q6; | |
| 135 | + wave_1_per_frame2=ti = q4 + 2.0944; | |
| 136 | + wave_1_per_frame3=r = .5 + .5*sin(ti); | |
| 137 | + wave_1_per_frame4=g = .5 + .5*sin(ti + 2.0944); | |
| 138 | + wave_1_per_frame5=b = .5 + .5*sin(ti + 4.1888); | |
| 139 | + wave_1_per_point1=ti = q2; | |
| 140 | + wave_1_per_point2= | |
| 141 | + wave_1_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 142 | + wave_1_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 143 | + wave_1_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 144 | + wave_1_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 145 | + wave_1_per_point7= | |
| 146 | + wave_1_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 147 | + wave_1_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 148 | + wave_1_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 149 | + wave_1_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 150 | + wave_1_per_point12= | |
| 151 | + wave_1_per_point13= | |
| 152 | + wave_1_per_point14=it = (it + 1)*above(sample,0); | |
| 153 | + wave_1_per_point15=sw = (1-sw)*above(sample,0); | |
| 154 | + wave_1_per_point16= | |
| 155 | + wave_1_per_point17=sa = 1-sample; | |
| 156 | + wave_1_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 157 | + wave_1_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 158 | + wave_1_per_point20= | |
| 159 | + wave_1_per_point21=y = .5 - y*(.5-x)*2; | |
| 160 | + wavecode_2_enabled=1 | |
| 161 | + wavecode_2_samples=512 | |
| 162 | + wavecode_2_sep=0 | |
| 163 | + wavecode_2_bSpectrum=0 | |
| 164 | + wavecode_2_bUseDots=0 | |
| 165 | + wavecode_2_bDrawThick=0 | |
| 166 | + wavecode_2_bAdditive=1 | |
| 167 | + wavecode_2_scaling=1.000000 | |
| 168 | + wavecode_2_smoothing=0.500000 | |
| 169 | + wavecode_2_r=1.000000 | |
| 170 | + wavecode_2_g=0.000000 | |
| 171 | + wavecode_2_b=0.000000 | |
| 172 | + wavecode_2_a=0.050000 | |
| 173 | + wave_2_init1=t1 = .2 + .6*int(rand(1001))*.001; | |
| 174 | + wave_2_init2=t2 = .2 + .6*int(rand(1001))*.001; | |
| 175 | + wave_2_init3=t3 = .2 + .6*int(rand(1001))*.001; | |
| 176 | + wave_2_init4=t4 = .2 + .6*int(rand(1001))*.001; | |
| 177 | + wave_2_init5=t5 = .2 + .6*int(rand(1001))*.001; | |
| 178 | + wave_2_init6=t6 = .2 + .6*int(rand(1001))*.001; | |
| 179 | + wave_2_init7=t7 = .2 + .6*int(rand(1001))*.001; | |
| 180 | + wave_2_init8=t8 = .2 + .6*int(rand(1001))*.001; | |
| 181 | + wave_2_per_frame1=ti = q4 + 4.1888; | |
| 182 | + wave_2_per_frame2=r = .5 + .5*sin(ti); | |
| 183 | + wave_2_per_frame3=g = .5 + .5*sin(ti + 2.0944); | |
| 184 | + wave_2_per_frame4=b = .5 + .5*sin(ti + 4.1888); | |
| 185 | + wave_2_per_frame5=a = q7; | |
| 186 | + wave_2_per_point1=ti = q3; | |
| 187 | + wave_2_per_point2= | |
| 188 | + wave_2_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 189 | + wave_2_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 190 | + wave_2_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 191 | + wave_2_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 192 | + wave_2_per_point7= | |
| 193 | + wave_2_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 194 | + wave_2_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 195 | + wave_2_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 196 | + wave_2_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 197 | + wave_2_per_point12= | |
| 198 | + wave_2_per_point13= | |
| 199 | + wave_2_per_point14=it = (it + 1)*above(sample,0); | |
| 200 | + wave_2_per_point15=sw = (1-sw)*above(sample,0); | |
| 201 | + wave_2_per_point16= | |
| 202 | + wave_2_per_point17=sa = 1-sample; | |
| 203 | + wave_2_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 204 | + wave_2_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 205 | + wave_2_per_point20= | |
| 206 | + wave_2_per_point21=y = .5 - y*(.5-x)*2; | |
| 207 | + wave_2_per_point22= | |
| 208 | + wavecode_3_enabled=0 | |
| 209 | + wavecode_3_samples=512 | |
| 210 | + wavecode_3_sep=0 | |
| 211 | + wavecode_3_bSpectrum=0 | |
| 212 | + wavecode_3_bUseDots=0 | |
| 213 | + wavecode_3_bDrawThick=0 | |
| 214 | + wavecode_3_bAdditive=0 | |
| 215 | + wavecode_3_scaling=1.000000 | |
| 216 | + wavecode_3_smoothing=0.500000 | |
| 217 | + wavecode_3_r=1.000000 | |
| 218 | + wavecode_3_g=1.000000 | |
| 219 | + wavecode_3_b=1.000000 | |
| 220 | + wavecode_3_a=1.000000 | |
| 221 | + shapecode_0_enabled=0 | |
| 222 | + shapecode_0_sides=54 | |
| 223 | + shapecode_0_additive=0 | |
| 224 | + shapecode_0_thickOutline=0 | |
| 225 | + shapecode_0_textured=1 | |
| 226 | + shapecode_0_x=0.500000 | |
| 227 | + shapecode_0_y=0.500000 | |
| 228 | + shapecode_0_rad=1.203207 | |
| 229 | + shapecode_0_ang=0.000000 | |
| 230 | + shapecode_0_tex_ang=0.000000 | |
| 231 | + shapecode_0_tex_zoom=1.000000 | |
| 232 | + shapecode_0_r=1.000000 | |
| 233 | + shapecode_0_g=1.000000 | |
| 234 | + shapecode_0_b=1.000000 | |
| 235 | + shapecode_0_a=1.000000 | |
| 236 | + shapecode_0_r2=1.000000 | |
| 237 | + shapecode_0_g2=1.000000 | |
| 238 | + shapecode_0_b2=1.000000 | |
| 239 | + shapecode_0_a2=0.000000 | |
| 240 | + shapecode_0_border_r=1.000000 | |
| 241 | + shapecode_0_border_g=1.000000 | |
| 242 | + shapecode_0_border_b=1.000000 | |
| 243 | + shapecode_0_border_a=0.100000 | |
| 244 | + shape_0_per_frame1=tex_zoom = 1/rad*.9; | |
| 245 | + shapecode_1_enabled=0 | |
| 246 | + shapecode_1_sides=54 | |
| 247 | + shapecode_1_additive=0 | |
| 248 | + shapecode_1_thickOutline=0 | |
| 249 | + shapecode_1_textured=0 | |
| 250 | + shapecode_1_x=0.150000 | |
| 251 | + shapecode_1_y=0.390000 | |
| 252 | + shapecode_1_rad=0.040839 | |
| 253 | + shapecode_1_ang=0.000000 | |
| 254 | + shapecode_1_tex_ang=0.000000 | |
| 255 | + shapecode_1_tex_zoom=1.000000 | |
| 256 | + shapecode_1_r=0.000000 | |
| 257 | + shapecode_1_g=0.000000 | |
| 258 | + shapecode_1_b=1.000000 | |
| 259 | + shapecode_1_a=1.000000 | |
| 260 | + shapecode_1_r2=1.000000 | |
| 261 | + shapecode_1_g2=0.000000 | |
| 262 | + shapecode_1_b2=0.000000 | |
| 263 | + shapecode_1_a2=0.000000 | |
| 264 | + shapecode_1_border_r=1.000000 | |
| 265 | + shapecode_1_border_g=1.000000 | |
| 266 | + shapecode_1_border_b=1.000000 | |
| 267 | + shapecode_1_border_a=0.100000 | |
| 268 | + shapecode_2_enabled=0 | |
| 269 | + shapecode_2_sides=4 | |
| 270 | + shapecode_2_additive=0 | |
| 271 | + shapecode_2_thickOutline=0 | |
| 272 | + shapecode_2_textured=0 | |
| 273 | + shapecode_2_x=0.500000 | |
| 274 | + shapecode_2_y=0.500000 | |
| 275 | + shapecode_2_rad=0.100000 | |
| 276 | + shapecode_2_ang=0.000000 | |
| 277 | + shapecode_2_tex_ang=0.000000 | |
| 278 | + shapecode_2_tex_zoom=1.000000 | |
| 279 | + shapecode_2_r=1.000000 | |
| 280 | + shapecode_2_g=0.000000 | |
| 281 | + shapecode_2_b=0.000000 | |
| 282 | + shapecode_2_a=1.000000 | |
| 283 | + shapecode_2_r2=0.000000 | |
| 284 | + shapecode_2_g2=1.000000 | |
| 285 | + shapecode_2_b2=0.000000 | |
| 286 | + shapecode_2_a2=0.000000 | |
| 287 | + shapecode_2_border_r=1.000000 | |
| 288 | + shapecode_2_border_g=1.000000 | |
| 289 | + shapecode_2_border_b=1.000000 | |
| 290 | + shapecode_2_border_a=0.100000 | |
| 291 | + shapecode_3_enabled=0 | |
| 292 | + shapecode_3_sides=4 | |
| 293 | + shapecode_3_additive=0 | |
| 294 | + shapecode_3_thickOutline=0 | |
| 295 | + shapecode_3_textured=0 | |
| 296 | + shapecode_3_x=0.500000 | |
| 297 | + shapecode_3_y=0.500000 | |
| 298 | + shapecode_3_rad=0.100000 | |
| 299 | + shapecode_3_ang=0.000000 | |
| 300 | + shapecode_3_tex_ang=0.000000 | |
| 301 | + shapecode_3_tex_zoom=1.000000 | |
| 302 | + shapecode_3_r=1.000000 | |
| 303 | + shapecode_3_g=0.000000 | |
| 304 | + shapecode_3_b=0.000000 | |
| 305 | + shapecode_3_a=1.000000 | |
| 306 | + shapecode_3_r2=0.000000 | |
| 307 | + shapecode_3_g2=1.000000 | |
| 308 | + shapecode_3_b2=0.000000 | |
| 309 | + shapecode_3_a2=0.000000 | |
| 310 | + shapecode_3_border_r=1.000000 | |
| 311 | + shapecode_3_border_g=1.000000 | |
| 312 | + shapecode_3_border_b=1.000000 | |
| 313 | + shapecode_3_border_a=0.100000 | |
| 314 | + per_frame_1=warp = 0; | |
| 315 | + per_frame_2=//zoom = 1; | |
| 316 | + per_frame_3= | |
| 317 | + per_frame_4=tic = min(time-tin,.1); | |
| 318 | + per_frame_5=tin = time; | |
| 319 | + per_frame_6= | |
| 320 | + per_frame_7=vol = (bass_att + treb_att + mid_att)*.333333; | |
| 321 | + per_frame_8= | |
| 322 | + per_frame_9=ra = 1/tic*.25; | |
| 323 | + per_frame_10= | |
| 324 | + per_frame_11=treb_avg = tic*(treb_avg*(1/tic - ra) + ra*treb); | |
| 325 | + per_frame_12=mid_avg = tic*(mid_avg*(1/tic - ra) + ra*mid); | |
| 326 | + per_frame_13=bass_avg = tic*(bass_avg*(1/tic - ra) + ra*bass); | |
| 327 | + per_frame_14=vav = tic*(vav*(1/tic - ra) + ra*(bass+treb+mid)*.33333); | |
| 328 | + per_frame_15= | |
| 329 | + per_frame_16=tt = tt + tic*treb; | |
| 330 | + per_frame_17=mt = mt + tic*mid; | |
| 331 | + per_frame_18=bt = bt + tic*bass; | |
| 332 | + per_frame_19=vt = vt + tic*vav; | |
| 333 | + per_frame_20= | |
| 334 | + per_frame_21=q1 = tt*3;// wave morph speeds | |
| 335 | + per_frame_22=q2 = mt*3; | |
| 336 | + per_frame_23=q3 = bt*3; | |
| 337 | + per_frame_24= | |
| 338 | + per_frame_25=q4 = vt; // wave colour cycle | |
| 339 | + per_frame_26= | |
| 340 | + per_frame_27=rb = if(rb,rb,.2 + int(rand(1001))*.001*.6); | |
| 341 | + per_frame_28=rc = if(rc,rc,.2 + int(rand(1001))*.001*.6); | |
| 342 | + per_frame_29=rd = if(rd,rd,.2 + int(rand(1001))*.001*.6); | |
| 343 | + per_frame_30=re = if(re,re,.2 + int(rand(1001))*.001*.6); | |
| 344 | + per_frame_31= | |
| 345 | + per_frame_32=//rot = .26; | |
| 346 | + per_frame_33= | |
| 347 | + per_frame_34=ti = vt*2; | |
| 348 | + per_frame_35=cx = .3 + .1*sin(ti*re) + .1*cos(ti*rc); | |
| 349 | + per_frame_36=cy = .5 + .2*sin(ti*rb) + .1*cos(ti*rd); | |
| 350 | + per_frame_37= | |
| 351 | + per_frame_38=q5 = min(1,.5*treb_avg)*.035; | |
| 352 | + per_frame_39=q6 = min(1,.5*mid_avg)*.035; | |
| 353 | + per_frame_40=q7 = min(1,.5*bass_avg)*.035; | |
| 354 | + per_frame_41= | |
| 355 | + per_pixel_1=num = 8; | |
| 356 | + per_pixel_2=pi = 3.141592654; | |
| 357 | + per_pixel_3=radi = (y-.5)*.75; | |
| 358 | + per_pixel_4=radi = (y-.5); | |
| 359 | + per_pixel_5=radi = pow(radi*radi + (x-.5)*(x-.5),.5); | |
| 360 | + per_pixel_6= | |
| 361 | + per_pixel_7=an = ang + pi + time; | |
| 362 | + per_pixel_8=an = an - pi*2*int(an/(pi*2)); | |
| 363 | + per_pixel_9= | |
| 364 | + per_pixel_10=mod = .1; | |
| 365 | + per_pixel_11= | |
| 366 | + per_pixel_12=seg = ang + pi; | |
| 367 | + per_pixel_13=seg = seg/(pi*2)*num; | |
| 368 | + per_pixel_14=seg = int(seg); | |
| 369 | + per_pixel_15=seg = seg - equal(seg,num); | |
| 370 | + per_pixel_16= | |
| 371 | + per_pixel_17=anga = (ang + pi) - (pi*2/num)*seg; | |
| 372 | + per_pixel_18=anga = if(equal(seg%2,0),(pi*2/num) - anga,anga); | |
| 373 | + per_pixel_19=//anga = anga + pi/6; // num = 6 | |
| 374 | + per_pixel_20=anga = anga + pi/4; // num = 8 | |
| 375 | + per_pixel_21=//anga = anga + .85; // num = 10 | |
| 376 | + per_pixel_22= | |
| 377 | + per_pixel_23= | |
| 378 | + per_pixel_24=ox = .5 - radi*sin(anga); | |
| 379 | + per_pixel_25=oy = .5 + radi*cos(anga); | |
| 380 | + per_pixel_26= | |
| 381 | + per_pixel_27=rot = if(equal(seg,0),rot,0); | |
| 382 | + per_pixel_28= | |
| 383 | + per_pixel_29=dx = equal(seg,3)*(x-ox); | |
| 384 | + per_pixel_30=dy = equal(seg,3)*(y-oy); | |
| 385 | + per_pixel_31= | |
| 386 | + per_pixel_32=dx = above(seg,0)*(x-ox); | |
| 387 | + per_pixel_33=dy = above(seg,0)*(y-oy); | |
| 388 | + per_pixel_34= | |
| 389 | + per_pixel_35=//dx = equal(seg,1)*(x - .5)*2; |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Aurora/suksma - shifter - urchin kali echos - bowel nz.milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=3 | |
| 3 | + PSVERSION_WARP=3 | |
| 4 | + PSVERSION_COMP=3 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.000 | |
| 8 | + fDecay=0.900 | |
| 9 | + fVideoEchoZoom=1.104 | |
| 10 | + fVideoEchoAlpha=0.500 | |
| 11 | + nVideoEchoOrientation=0 | |
| 12 | + nWaveMode=7 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=0 | |
| 16 | + bModWaveAlphaByVolume=1 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=1 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=1 | |
| 22 | + bDarken=1 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=0.001 | |
| 26 | + fWaveScale=1.286 | |
| 27 | + fWaveSmoothing=0.630 | |
| 28 | + fWaveParam=0.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=1.331 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=0.99951 | |
| 36 | + rot=0.26000 | |
| 37 | + cx=0.320 | |
| 38 | + cy=0.290 | |
| 39 | + dx=0.00000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.01105 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.500 | |
| 50 | + ob_r=0.010 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.000 | |
| 54 | + ib_size=0.260 | |
| 55 | + ib_r=0.250 | |
| 56 | + ib_g=0.250 | |
| 57 | + ib_b=0.250 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=1 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=1 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=0.000 | |
| 85 | + wavecode_0_g=0.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=0.050 | |
| 88 | + wave_0_init1=t1 = .2 + .6*int(rand(1001))*.001; | |
| 89 | + wave_0_init2=t2 = .2 + .6*int(rand(1001))*.001; | |
| 90 | + wave_0_init3=t3 = .2 + .6*int(rand(1001))*.001; | |
| 91 | + wave_0_init4=t4 = .2 + .6*int(rand(1001))*.001; | |
| 92 | + wave_0_init5=t5 = .2 + .6*int(rand(1001))*.001; | |
| 93 | + wave_0_init6=t6 = .2 + .6*int(rand(1001))*.001; | |
| 94 | + wave_0_init7=t7 = .2 + .6*int(rand(1001))*.001; | |
| 95 | + wave_0_init8=t8 = .2 + .6*int(rand(1001))*.001; | |
| 96 | + wave_0_per_point1=ti = q1; | |
| 97 | + wave_0_per_point2= | |
| 98 | + wave_0_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 99 | + wave_0_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 100 | + wave_0_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 101 | + wave_0_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 102 | + wave_0_per_point7= | |
| 103 | + wave_0_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 104 | + wave_0_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 105 | + wave_0_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 106 | + wave_0_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 107 | + wave_0_per_point12= | |
| 108 | + wave_0_per_point13= | |
| 109 | + wave_0_per_point14=it = (it + 1)*above(sample,0); | |
| 110 | + wave_0_per_point15=sw = (1-sw)*above(sample,0); | |
| 111 | + wave_0_per_point16= | |
| 112 | + wave_0_per_point17=sa = 1-sample; | |
| 113 | + wave_0_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 114 | + wave_0_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 115 | + wave_0_per_point20= | |
| 116 | + wave_0_per_point21=y = .5 - y*(.5-x)*2; | |
| 117 | + wave_0_per_point22= | |
| 118 | + wave_0_per_point23= | |
| 119 | + wave_0_per_point24=ti = q4; | |
| 120 | + wave_0_per_point25=r = .5 + .5*sin(ti); | |
| 121 | + wave_0_per_point26=g = .5 + .5*sin(ti + 2.0944); | |
| 122 | + wave_0_per_point27=b = .5 + .5*sin(ti + 4.1888); | |
| 123 | + wavecode_1_enabled=1 | |
| 124 | + wavecode_1_samples=512 | |
| 125 | + wavecode_1_sep=0 | |
| 126 | + wavecode_1_bSpectrum=0 | |
| 127 | + wavecode_1_bUseDots=0 | |
| 128 | + wavecode_1_bDrawThick=0 | |
| 129 | + wavecode_1_bAdditive=1 | |
| 130 | + wavecode_1_scaling=1.00000 | |
| 131 | + wavecode_1_smoothing=0.50000 | |
| 132 | + wavecode_1_r=0.000 | |
| 133 | + wavecode_1_g=1.000 | |
| 134 | + wavecode_1_b=0.000 | |
| 135 | + wavecode_1_a=0.050 | |
| 136 | + wave_1_init1=t1 = .2 + .6*int(rand(1001))*.001; | |
| 137 | + wave_1_init2=t2 = .2 + .6*int(rand(1001))*.001; | |
| 138 | + wave_1_init3=t3 = .2 + .6*int(rand(1001))*.001; | |
| 139 | + wave_1_init4=t4 = .2 + .6*int(rand(1001))*.001; | |
| 140 | + wave_1_init5=t5 = .2 + .6*int(rand(1001))*.001; | |
| 141 | + wave_1_init6=t6 = .2 + .6*int(rand(1001))*.001; | |
| 142 | + wave_1_init7=t7 = .2 + .6*int(rand(1001))*.001; | |
| 143 | + wave_1_init8=t8 = .2 + .6*int(rand(1001))*.001; | |
| 144 | + wave_1_per_point1=ti = q2; | |
| 145 | + wave_1_per_point2= | |
| 146 | + wave_1_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 147 | + wave_1_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 148 | + wave_1_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 149 | + wave_1_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 150 | + wave_1_per_point7= | |
| 151 | + wave_1_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 152 | + wave_1_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 153 | + wave_1_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 154 | + wave_1_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 155 | + wave_1_per_point12= | |
| 156 | + wave_1_per_point13= | |
| 157 | + wave_1_per_point14=it = (it + 1)*above(sample,0); | |
| 158 | + wave_1_per_point15=sw = (1-sw)*above(sample,0); | |
| 159 | + wave_1_per_point16= | |
| 160 | + wave_1_per_point17=sa = 1-sample; | |
| 161 | + wave_1_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 162 | + wave_1_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 163 | + wave_1_per_point20= | |
| 164 | + wave_1_per_point21=y = .5 - y*(.5-x)*2; | |
| 165 | + wave_1_per_point22= | |
| 166 | + wave_1_per_point23=ti = q4 + 2.0944; | |
| 167 | + wave_1_per_point24=r = .5 + .5*sin(ti); | |
| 168 | + wave_1_per_point25=g = .5 + .5*sin(ti + 2.0944); | |
| 169 | + wave_1_per_point26=b = .5 + .5*sin(ti + 4.1888); | |
| 170 | + wavecode_2_enabled=1 | |
| 171 | + wavecode_2_samples=512 | |
| 172 | + wavecode_2_sep=0 | |
| 173 | + wavecode_2_bSpectrum=0 | |
| 174 | + wavecode_2_bUseDots=0 | |
| 175 | + wavecode_2_bDrawThick=0 | |
| 176 | + wavecode_2_bAdditive=1 | |
| 177 | + wavecode_2_scaling=1.00000 | |
| 178 | + wavecode_2_smoothing=0.50000 | |
| 179 | + wavecode_2_r=1.000 | |
| 180 | + wavecode_2_g=0.000 | |
| 181 | + wavecode_2_b=0.000 | |
| 182 | + wavecode_2_a=0.050 | |
| 183 | + wave_2_init1=t1 = .2 + .6*int(rand(1001))*.001; | |
| 184 | + wave_2_init2=t2 = .2 + .6*int(rand(1001))*.001; | |
| 185 | + wave_2_init3=t3 = .2 + .6*int(rand(1001))*.001; | |
| 186 | + wave_2_init4=t4 = .2 + .6*int(rand(1001))*.001; | |
| 187 | + wave_2_init5=t5 = .2 + .6*int(rand(1001))*.001; | |
| 188 | + wave_2_init6=t6 = .2 + .6*int(rand(1001))*.001; | |
| 189 | + wave_2_init7=t7 = .2 + .6*int(rand(1001))*.001; | |
| 190 | + wave_2_init8=t8 = .2 + .6*int(rand(1001))*.001; | |
| 191 | + wave_2_per_point1=ti = q3; | |
| 192 | + wave_2_per_point2= | |
| 193 | + wave_2_per_point3=xa = .25 + .25*sin(ti*t1); | |
| 194 | + wave_2_per_point4=xb = .25 + .25*sin(ti*t2); | |
| 195 | + wave_2_per_point5=xc = .25 + .25*sin(ti*t3); | |
| 196 | + wave_2_per_point6=xd = .25 + .25*sin(ti*t4); | |
| 197 | + wave_2_per_point7= | |
| 198 | + wave_2_per_point8=ya = .25 + .25*sin(ti*t5); | |
| 199 | + wave_2_per_point9=yb = .25 + .25*sin(ti*t6); | |
| 200 | + wave_2_per_point10=yc = .25 + .25*sin(ti*t7); | |
| 201 | + wave_2_per_point11=yd = .25 + .25*sin(ti*t8); | |
| 202 | + wave_2_per_point12= | |
| 203 | + wave_2_per_point13= | |
| 204 | + wave_2_per_point14=it = (it + 1)*above(sample,0); | |
| 205 | + wave_2_per_point15=sw = (1-sw)*above(sample,0); | |
| 206 | + wave_2_per_point16= | |
| 207 | + wave_2_per_point17=sa = 1-sample; | |
| 208 | + wave_2_per_point18=x = if(sw,xa*sample + sa*xb,xc*sample + xd*sa); | |
| 209 | + wave_2_per_point19=y = if(sw,ya*sample + sa*yb,yc*sample + yd*sa); | |
| 210 | + wave_2_per_point20= | |
| 211 | + wave_2_per_point21=y = .5 - y*(.5-x)*2; | |
| 212 | + wave_2_per_point22= | |
| 213 | + wave_2_per_point23=ti = q4 + 4.1888; | |
| 214 | + wave_2_per_point24=r = .5 + .5*sin(ti); | |
| 215 | + wave_2_per_point25=g = .5 + .5*sin(ti + 2.0944); | |
| 216 | + wave_2_per_point26=b = .5 + .5*sin(ti + 4.1888); | |
| 217 | + wavecode_3_enabled=0 | |
| 218 | + wavecode_3_samples=512 | |
| 219 | + wavecode_3_sep=0 | |
| 220 | + wavecode_3_bSpectrum=0 | |
| 221 | + wavecode_3_bUseDots=0 | |
| 222 | + wavecode_3_bDrawThick=0 | |
| 223 | + wavecode_3_bAdditive=0 | |
| 224 | + wavecode_3_scaling=1.00000 | |
| 225 | + wavecode_3_smoothing=0.50000 | |
| 226 | + wavecode_3_r=1.000 | |
| 227 | + wavecode_3_g=1.000 | |
| 228 | + wavecode_3_b=1.000 | |
| 229 | + wavecode_3_a=1.000 | |
| 230 | + shapecode_0_enabled=1 | |
| 231 | + shapecode_0_sides=54 | |
| 232 | + shapecode_0_additive=0 | |
| 233 | + shapecode_0_thickOutline=0 | |
| 234 | + shapecode_0_textured=1 | |
| 235 | + shapecode_0_num_inst=1 | |
| 236 | + shapecode_0_x=0.000 | |
| 237 | + shapecode_0_y=0.500 | |
| 238 | + shapecode_0_rad=0.24486 | |
| 239 | + shapecode_0_ang=0.00000 | |
| 240 | + shapecode_0_tex_ang=0.00000 | |
| 241 | + shapecode_0_tex_zoom=1.81669 | |
| 242 | + shapecode_0_r=1.000 | |
| 243 | + shapecode_0_g=1.000 | |
| 244 | + shapecode_0_b=1.000 | |
| 245 | + shapecode_0_a=1.000 | |
| 246 | + shapecode_0_r2=1.000 | |
| 247 | + shapecode_0_g2=1.000 | |
| 248 | + shapecode_0_b2=1.000 | |
| 249 | + shapecode_0_a2=0.000 | |
| 250 | + shapecode_0_border_r=1.000 | |
| 251 | + shapecode_0_border_g=1.000 | |
| 252 | + shapecode_0_border_b=1.000 | |
| 253 | + shapecode_0_border_a=0.000 | |
| 254 | + shape_0_per_frame1=//tex_zoom = 1/rad*.9; | |
| 255 | + shapecode_1_enabled=1 | |
| 256 | + shapecode_1_sides=54 | |
| 257 | + shapecode_1_additive=0 | |
| 258 | + shapecode_1_thickOutline=0 | |
| 259 | + shapecode_1_textured=1 | |
| 260 | + shapecode_1_num_inst=1 | |
| 261 | + shapecode_1_x=0.250 | |
| 262 | + shapecode_1_y=0.400 | |
| 263 | + shapecode_1_rad=0.33000 | |
| 264 | + shapecode_1_ang=0.00000 | |
| 265 | + shapecode_1_tex_ang=0.00000 | |
| 266 | + shapecode_1_tex_zoom=1.81669 | |
| 267 | + shapecode_1_r=1.000 | |
| 268 | + shapecode_1_g=1.000 | |
| 269 | + shapecode_1_b=1.000 | |
| 270 | + shapecode_1_a=1.000 | |
| 271 | + shapecode_1_r2=1.000 | |
| 272 | + shapecode_1_g2=1.000 | |
| 273 | + shapecode_1_b2=1.000 | |
| 274 | + shapecode_1_a2=0.000 | |
| 275 | + shapecode_1_border_r=1.000 | |
| 276 | + shapecode_1_border_g=1.000 | |
| 277 | + shapecode_1_border_b=1.000 | |
| 278 | + shapecode_1_border_a=0.000 | |
| 279 | + shape_1_per_frame1=//tex_zoom = 1/rad*.9; | |
| 280 | + shapecode_2_enabled=0 | |
| 281 | + shapecode_2_sides=4 | |
| 282 | + shapecode_2_additive=0 | |
| 283 | + shapecode_2_thickOutline=0 | |
| 284 | + shapecode_2_textured=0 | |
| 285 | + shapecode_2_num_inst=1 | |
| 286 | + shapecode_2_x=0.500 | |
| 287 | + shapecode_2_y=0.500 | |
| 288 | + shapecode_2_rad=0.10000 | |
| 289 | + shapecode_2_ang=0.00000 | |
| 290 | + shapecode_2_tex_ang=0.00000 | |
| 291 | + shapecode_2_tex_zoom=1.00000 | |
| 292 | + shapecode_2_r=1.000 | |
| 293 | + shapecode_2_g=0.000 | |
| 294 | + shapecode_2_b=0.000 | |
| 295 | + shapecode_2_a=1.000 | |
| 296 | + shapecode_2_r2=0.000 | |
| 297 | + shapecode_2_g2=1.000 | |
| 298 | + shapecode_2_b2=0.000 | |
| 299 | + shapecode_2_a2=0.000 | |
| 300 | + shapecode_2_border_r=1.000 | |
| 301 | + shapecode_2_border_g=1.000 | |
| 302 | + shapecode_2_border_b=1.000 | |
| 303 | + shapecode_2_border_a=0.100 | |
| 304 | + shapecode_3_enabled=0 | |
| 305 | + shapecode_3_sides=4 | |
| 306 | + shapecode_3_additive=0 | |
| 307 | + shapecode_3_thickOutline=0 | |
| 308 | + shapecode_3_textured=0 | |
| 309 | + shapecode_3_num_inst=1 | |
| 310 | + shapecode_3_x=0.500 | |
| 311 | + shapecode_3_y=0.500 | |
| 312 | + shapecode_3_rad=0.10000 | |
| 313 | + shapecode_3_ang=0.00000 | |
| 314 | + shapecode_3_tex_ang=0.00000 | |
| 315 | + shapecode_3_tex_zoom=1.00000 | |
| 316 | + shapecode_3_r=1.000 | |
| 317 | + shapecode_3_g=0.000 | |
| 318 | + shapecode_3_b=0.000 | |
| 319 | + shapecode_3_a=1.000 | |
| 320 | + shapecode_3_r2=0.000 | |
| 321 | + shapecode_3_g2=1.000 | |
| 322 | + shapecode_3_b2=0.000 | |
| 323 | + shapecode_3_a2=0.000 | |
| 324 | + shapecode_3_border_r=1.000 | |
| 325 | + shapecode_3_border_g=1.000 | |
| 326 | + shapecode_3_border_b=1.000 | |
| 327 | + shapecode_3_border_a=0.100 | |
| 328 | + per_frame_1=warp = 0; | |
| 329 | + per_frame_2=//zoom = 1; | |
| 330 | + per_frame_3= | |
| 331 | + per_frame_4=tic = min(time-tin,.1); | |
| 332 | + per_frame_5=tin = time; | |
| 333 | + per_frame_6= | |
| 334 | + per_frame_7=vol = (bass_att + treb_att + mid_att)*.333333; | |
| 335 | + per_frame_8= | |
| 336 | + per_frame_9=ra = 1/tic*.25; | |
| 337 | + per_frame_10= | |
| 338 | + per_frame_11=treb_avg = tic*(treb_avg*(1/tic - ra) + ra*treb); | |
| 339 | + per_frame_12=mid_avg = tic*(mid_avg*(1/tic - ra) + ra*mid); | |
| 340 | + per_frame_13=bass_avg = tic*(bass_avg*(1/tic - ra) + ra*bass); | |
| 341 | + per_frame_14=vav = tic*(vav*(1/tic - ra) + ra*(bass+treb+mid)*.33333); | |
| 342 | + per_frame_15= | |
| 343 | + per_frame_16=tt = tt + tic*treb; | |
| 344 | + per_frame_17=mt = mt + tic*mid; | |
| 345 | + per_frame_18=bt = bt + tic*bass; | |
| 346 | + per_frame_19=vt = vt + tic*vav; | |
| 347 | + per_frame_20= | |
| 348 | + per_frame_21=q1 = tt*3;// wave morph speeds | |
| 349 | + per_frame_22=q2 = mt*3; | |
| 350 | + per_frame_23=q3 = bt*3; | |
| 351 | + per_frame_24= | |
| 352 | + per_frame_25=q4 = vt; // wave colour cycle | |
| 353 | + per_frame_26= | |
| 354 | + per_frame_27=rb = if(rb,rb,.2 + int(rand(1001))*.001*.6); | |
| 355 | + per_frame_28=rc = if(rc,rc,.2 + int(rand(1001))*.001*.6); | |
| 356 | + per_frame_29=rd = if(rd,rd,.2 + int(rand(1001))*.001*.6); | |
| 357 | + per_frame_30=re = if(re,re,.2 + int(rand(1001))*.001*.6); | |
| 358 | + per_frame_31= | |
| 359 | + per_frame_32=//rot = .26; | |
| 360 | + per_frame_33= | |
| 361 | + per_frame_34=ti = vt*2; | |
| 362 | + per_frame_35=cx = .3 + .1*sin(ti*re) + .1*cos(ti*rc); | |
| 363 | + per_frame_36=cy = .5 + .2*sin(ti*rb) + .1*cos(ti*rd); | |
| 364 | + per_frame_37= | |
| 365 | + per_pixel_1=num = 8; | |
| 366 | + per_pixel_2=pi = 3.141592654; | |
| 367 | + per_pixel_3=radi = (y-.5)*.75; | |
| 368 | + per_pixel_4=radi = (y-.5); | |
| 369 | + per_pixel_5=radi = pow(radi*radi + (x-.5)*(x-.5),.5); | |
| 370 | + per_pixel_6= | |
| 371 | + per_pixel_7=an = ang + pi + time; | |
| 372 | + per_pixel_8=an = an - pi*2*int(an/(pi*2)); | |
| 373 | + per_pixel_9= | |
| 374 | + per_pixel_10=mod = .1; | |
| 375 | + per_pixel_11= | |
| 376 | + per_pixel_12=seg = ang + pi; | |
| 377 | + per_pixel_13=seg = seg/(pi*2)*num; | |
| 378 | + per_pixel_14=seg = int(seg); | |
| 379 | + per_pixel_15=seg = seg - equal(seg,num); | |
| 380 | + per_pixel_16= | |
| 381 | + per_pixel_17=anga = (ang + pi) - (pi*2/num)*seg; | |
| 382 | + per_pixel_18=anga = if(equal(seg%2,0),(pi*2/num) - anga,anga); | |
| 383 | + per_pixel_19=//anga = anga + pi/6; // num = 6 | |
| 384 | + per_pixel_20=anga = anga + pi/4; // num = 8 | |
| 385 | + per_pixel_21=//anga = anga + .85; // num = 10 | |
| 386 | + per_pixel_22= | |
| 387 | + per_pixel_23= | |
| 388 | + per_pixel_24=ox = .5 - radi*sin(anga); | |
| 389 | + per_pixel_25=oy = .5 + radi*cos(anga); | |
| 390 | + per_pixel_26= | |
| 391 | + per_pixel_27=rot = if(equal(seg,0),rot,0); | |
| 392 | + per_pixel_28= | |
| 393 | + per_pixel_29=dx = equal(seg,3)*(x-ox); | |
| 394 | + per_pixel_30=dy = equal(seg,3)*(y-oy); | |
| 395 | + per_pixel_31= | |
| 396 | + per_pixel_32=dx = above(seg,0)*(x-ox); | |
| 397 | + per_pixel_33=dy = above(seg,0)*(y-oy); | |
| 398 | + per_pixel_34= | |
| 399 | + per_pixel_35=//dx = equal(seg,1)*(x - .5)*2; | |
| 400 | + warp_1=`shader_body | |
| 401 | + warp_2=`{ | |
| 402 | + warp_3=` // sample previous frame | |
| 403 | + warp_4=` ret = tex2D( sampler_main, uv ).xyz; | |
| 404 | + warp_5=`float4 noise2 = tex3D(sampler_noisevol_hq, | |
| 405 | + warp_6=` ((uv.xyy | |
| 406 | + warp_7=` )*texsize.xyy*texsize_noisevol_hq.zww | |
| 407 | + warp_8=` ).xyz* | |
| 408 | + warp_9=` float3(1,1,0)*0.05 + | |
| 409 | + warp_10=` time*float3(0,0,1)*0.4 | |
| 410 | + warp_11=` ); | |
| 411 | + warp_12=`if(ret.x+ret.y+ret.z>.5)ret += (noise2)*.5; | |
| 412 | + warp_13=` | |
| 413 | + warp_14=` // darken (decay) over time | |
| 414 | + warp_15=` ret = ret- (ret*.5); | |
| 415 | + warp_16=` ret = ret*(abs(GetBlur2(uv)-.5))*5; | |
| 416 | + warp_17=` ret = ret - .01; | |
| 417 | + warp_18=`} | |
| 418 | + comp_1=`sampler sampler_fc_sunrise; | |
| 419 | + comp_2=`float2 factorA, factorB, product; | |
| 420 | + comp_3=`float2 numerator, denominator, fraction; | |
| 421 | + comp_4=`shader_body | |
| 422 | + comp_5=`{ | |
| 423 | + comp_6=`float2 uvo = uv; | |
| 424 | + comp_7=`uv = (uv-0.5); | |
| 425 | + comp_8=`factorA = uv+ float2(q1,q2); | |
| 426 | + comp_9=`factorB = float2(8,0); | |
| 427 | + comp_10=`product = float2( factorA.x*factorB.x - factorA.y*factorB.y, factorA.x*factorB.y + factorA.y*factorB.x); | |
| 428 | + comp_11=`float2 uv1 = product; | |
| 429 | + comp_12=`factorA = uv+ float2(q3,q4); | |
| 430 | + comp_13=`factorB = float2(8,0); | |
| 431 | + comp_14=`product = float2( factorA.x*factorB.x - factorA.y*factorB.y, factorA.x*factorB.y + factorA.y*factorB.x); | |
| 432 | + comp_15=`float2 uv2 = product; | |
| 433 | + comp_16=`factorA = uv+ float2(q5,q6); | |
| 434 | + comp_17=`factorB = float2(8,0); | |
| 435 | + comp_18=`product = float2( factorA.x*factorB.x - factorA.y*factorB.y, factorA.x*factorB.y + factorA.y*factorB.x); | |
| 436 | + comp_19=`float2 uv3 = product; | |
| 437 | + comp_20=`factorA = uv+ float2(q7,q8); | |
| 438 | + comp_21=`factorB = float2(8,0); | |
| 439 | + comp_22=`product = float2( factorA.x*factorB.x - factorA.y*factorB.y, factorA.x*factorB.y + factorA.y*factorB.x); | |
| 440 | + comp_23=`float2 uv4 = product; | |
| 441 | + comp_24=`factorA = uv1; | |
| 442 | + comp_25=`factorB = uv2; | |
| 443 | + comp_26=`product = float2( factorA.x*factorB.x - factorA.y*factorB.y, factorA.x*factorB.y + factorA.y*factorB.x); | |
| 444 | + comp_27=`float2 uv12 = product; | |
| 445 | + comp_28=`factorA = uv3; | |
| 446 | + comp_29=`factorB = uv4; | |
| 447 | + comp_30=`product = float2( factorA.x*factorB.x - factorA.y*factorB.y, factorA.x*factorB.y + factorA.y*factorB.x); | |
| 448 | + comp_31=`float2 uv34 = product; | |
| 449 | + comp_32=`factorA = uv12; | |
| 450 | + comp_33=`factorB = uv34; | |
| 451 | + comp_34=`product = float2( factorA.x*factorB.x - factorA.y*factorB.y, factorA.x*factorB.y + factorA.y*factorB.x); | |
| 452 | + comp_35=`numerator = float2(1,0); | |
| 453 | + comp_36=`denominator = product; | |
| 454 | + comp_37=`fraction = float2( numerator.x*denominator.x + numerator.y*denominator.y, // the fractions real part | |
| 455 | + comp_38=` numerator.y*denominator.x - numerator.x*denominator.y)/ // the fractions imaginary part | |
| 456 | + comp_39=` (denominator.x*denominator.x + denominator.y*denominator.y); | |
| 457 | + comp_40=`uv = fraction*(16); | |
| 458 | + comp_41=`uv = lerp(0.5 + (uvo-0.5)*(2+(bass_att-treb_att)*0.02),uv+0.5,0.5); | |
| 459 | + comp_42=` | |
| 460 | + comp_43=`float l = length(uv-0.5); | |
| 461 | + comp_44=`uv = 0.5 + (1.0 - abs( frac( uv * 0.5 ) * 2 - 1.0 )-0.5); // Eo.S. mirror code with cutted borders | |
| 462 | + comp_45=` | |
| 463 | + comp_46=`ret = GetPixel(uv).y*float3(1,0.6,0); | |
| 464 | + comp_47=`float4 noise2 = tex3D(sampler_noisevol_hq, | |
| 465 | + comp_48=` ((uv.xyy | |
| 466 | + comp_49=` )*texsize.xyy*texsize_noisevol_hq.zww | |
| 467 | + comp_50=` ).xyz* | |
| 468 | + comp_51=` float3(1,1,0)*0.05 + | |
| 469 | + comp_52=` time*float3(0,0,1)*0.4 | |
| 470 | + comp_53=` ); | |
| 471 | + comp_54=`if(ret.x+ret.y+ret.z>.3)ret *= (noise2)*2.5; | |
| 472 | + comp_55=`ret = lerp(saturate(ret),0,GetBlur2(uv).z*0.5); | |
| 473 | + comp_56=`ret = lerp(saturate(ret),float3(0.3,0.4,0.5),GetBlur2(uv).x*4); | |
| 474 | + comp_57=`ret = lerp(saturate(ret),1,GetPixel(uv).z); | |
| 475 | + comp_58=`ret = lerp(saturate(ret),0,GetPixel(uv).x*0.6); | |
| 476 | + comp_59=`ret*=saturate(1.6-pow(l,6)*0.004); | |
| 477 | + comp_60=`} |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Blobby Mirror/AdamFX 2 Geiss - Mash-Up Sphere Xibit Graffiti Warp me Oval Interprise.milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=2 | |
| 3 | + PSVERSION_WARP=2 | |
| 4 | + PSVERSION_COMP=2 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.900 | |
| 8 | + fDecay=0.980 | |
| 9 | + fVideoEchoZoom=1.169 | |
| 10 | + fVideoEchoAlpha=0.000 | |
| 11 | + nVideoEchoOrientation=0 | |
| 12 | + nWaveMode=6 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=1 | |
| 16 | + bModWaveAlphaByVolume=0 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=1 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=0 | |
| 22 | + bDarken=0 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=4.100 | |
| 26 | + fWaveScale=0.010 | |
| 27 | + fWaveSmoothing=0.900 | |
| 28 | + fWaveParam=0.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=2.853 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=1.04000 | |
| 36 | + rot=0.00000 | |
| 37 | + cx=0.500 | |
| 38 | + cy=0.500 | |
| 39 | + dx=0.03000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.47402 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.010 | |
| 50 | + ob_r=0.000 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.000 | |
| 54 | + ib_size=0.010 | |
| 55 | + ib_r=0.250 | |
| 56 | + ib_g=0.250 | |
| 57 | + ib_b=0.250 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=0 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=0 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=1.000 | |
| 85 | + wavecode_0_g=1.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=1.000 | |
| 88 | + wavecode_1_enabled=0 | |
| 89 | + wavecode_1_samples=512 | |
| 90 | + wavecode_1_sep=0 | |
| 91 | + wavecode_1_bSpectrum=0 | |
| 92 | + wavecode_1_bUseDots=0 | |
| 93 | + wavecode_1_bDrawThick=0 | |
| 94 | + wavecode_1_bAdditive=0 | |
| 95 | + wavecode_1_scaling=1.00000 | |
| 96 | + wavecode_1_smoothing=0.50000 | |
| 97 | + wavecode_1_r=1.000 | |
| 98 | + wavecode_1_g=1.000 | |
| 99 | + wavecode_1_b=1.000 | |
| 100 | + wavecode_1_a=1.000 | |
| 101 | + wavecode_2_enabled=0 | |
| 102 | + wavecode_2_samples=512 | |
| 103 | + wavecode_2_sep=0 | |
| 104 | + wavecode_2_bSpectrum=0 | |
| 105 | + wavecode_2_bUseDots=0 | |
| 106 | + wavecode_2_bDrawThick=0 | |
| 107 | + wavecode_2_bAdditive=0 | |
| 108 | + wavecode_2_scaling=1.00000 | |
| 109 | + wavecode_2_smoothing=0.50000 | |
| 110 | + wavecode_2_r=1.000 | |
| 111 | + wavecode_2_g=1.000 | |
| 112 | + wavecode_2_b=1.000 | |
| 113 | + wavecode_2_a=1.000 | |
| 114 | + wavecode_3_enabled=0 | |
| 115 | + wavecode_3_samples=512 | |
| 116 | + wavecode_3_sep=0 | |
| 117 | + wavecode_3_bSpectrum=0 | |
| 118 | + wavecode_3_bUseDots=0 | |
| 119 | + wavecode_3_bDrawThick=0 | |
| 120 | + wavecode_3_bAdditive=0 | |
| 121 | + wavecode_3_scaling=1.00000 | |
| 122 | + wavecode_3_smoothing=0.50000 | |
| 123 | + wavecode_3_r=1.000 | |
| 124 | + wavecode_3_g=1.000 | |
| 125 | + wavecode_3_b=1.000 | |
| 126 | + wavecode_3_a=1.000 | |
| 127 | + shapecode_0_enabled=1 | |
| 128 | + shapecode_0_sides=44 | |
| 129 | + shapecode_0_additive=0 | |
| 130 | + shapecode_0_thickOutline=0 | |
| 131 | + shapecode_0_textured=0 | |
| 132 | + shapecode_0_num_inst=1 | |
| 133 | + shapecode_0_x=0.500 | |
| 134 | + shapecode_0_y=0.500 | |
| 135 | + shapecode_0_rad=0.03347 | |
| 136 | + shapecode_0_ang=0.00000 | |
| 137 | + shapecode_0_tex_ang=0.00000 | |
| 138 | + shapecode_0_tex_zoom=1.00000 | |
| 139 | + shapecode_0_r=1.000 | |
| 140 | + shapecode_0_g=1.000 | |
| 141 | + shapecode_0_b=1.000 | |
| 142 | + shapecode_0_a=1.000 | |
| 143 | + shapecode_0_r2=1.000 | |
| 144 | + shapecode_0_g2=1.000 | |
| 145 | + shapecode_0_b2=1.000 | |
| 146 | + shapecode_0_a2=0.000 | |
| 147 | + shapecode_0_border_r=1.000 | |
| 148 | + shapecode_0_border_g=1.000 | |
| 149 | + shapecode_0_border_b=1.000 | |
| 150 | + shapecode_0_border_a=0.000 | |
| 151 | + shape_0_init1=fran = 1; | |
| 152 | + shape_0_init2=xs = 1; | |
| 153 | + shape_0_init3=ys = 1; | |
| 154 | + shape_0_init4=xm = 0.5; | |
| 155 | + shape_0_init5=ym = 0.5; | |
| 156 | + shape_0_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 157 | + shape_0_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 158 | + shape_0_per_frame3= | |
| 159 | + shape_0_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.4 + 0.6*cos(time*0.62)); | |
| 160 | + shape_0_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.5 + 0.5*cos(time*0.78)); | |
| 161 | + shape_0_per_frame6= | |
| 162 | + shape_0_per_frame7=x = xm; | |
| 163 | + shape_0_per_frame8=y = ym; | |
| 164 | + shape_0_per_frame9= | |
| 165 | + shape_0_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 166 | + shape_0_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 167 | + shape_0_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 168 | + shape_0_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 169 | + shape_0_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 170 | + shapecode_1_enabled=1 | |
| 171 | + shapecode_1_sides=44 | |
| 172 | + shapecode_1_additive=0 | |
| 173 | + shapecode_1_thickOutline=0 | |
| 174 | + shapecode_1_textured=0 | |
| 175 | + shapecode_1_num_inst=1 | |
| 176 | + shapecode_1_x=0.500 | |
| 177 | + shapecode_1_y=0.500 | |
| 178 | + shapecode_1_rad=0.03347 | |
| 179 | + shapecode_1_ang=0.00000 | |
| 180 | + shapecode_1_tex_ang=0.00000 | |
| 181 | + shapecode_1_tex_zoom=1.00000 | |
| 182 | + shapecode_1_r=1.000 | |
| 183 | + shapecode_1_g=1.000 | |
| 184 | + shapecode_1_b=1.000 | |
| 185 | + shapecode_1_a=1.000 | |
| 186 | + shapecode_1_r2=1.000 | |
| 187 | + shapecode_1_g2=1.000 | |
| 188 | + shapecode_1_b2=1.000 | |
| 189 | + shapecode_1_a2=0.000 | |
| 190 | + shapecode_1_border_r=1.000 | |
| 191 | + shapecode_1_border_g=1.000 | |
| 192 | + shapecode_1_border_b=1.000 | |
| 193 | + shapecode_1_border_a=0.000 | |
| 194 | + shape_1_init1=fran = 1; | |
| 195 | + shape_1_init2=xs = 1; | |
| 196 | + shape_1_init3=ys = 1; | |
| 197 | + shape_1_init4=xm = 0.5; | |
| 198 | + shape_1_init5=ym = 0.5; | |
| 199 | + shape_1_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 200 | + shape_1_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 201 | + shape_1_per_frame3= | |
| 202 | + shape_1_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.6 + 0.4*cos(time*0.62)); | |
| 203 | + shape_1_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.7 + 0.3*cos(time*0.78)); | |
| 204 | + shape_1_per_frame6= | |
| 205 | + shape_1_per_frame7=x = xm; | |
| 206 | + shape_1_per_frame8=y = ym; | |
| 207 | + shape_1_per_frame9= | |
| 208 | + shape_1_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 209 | + shape_1_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 210 | + shape_1_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 211 | + shape_1_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 212 | + shape_1_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 213 | + shapecode_2_enabled=0 | |
| 214 | + shapecode_2_sides=44 | |
| 215 | + shapecode_2_additive=0 | |
| 216 | + shapecode_2_thickOutline=0 | |
| 217 | + shapecode_2_textured=0 | |
| 218 | + shapecode_2_num_inst=1 | |
| 219 | + shapecode_2_x=0.500 | |
| 220 | + shapecode_2_y=0.500 | |
| 221 | + shapecode_2_rad=0.03347 | |
| 222 | + shapecode_2_ang=0.00000 | |
| 223 | + shapecode_2_tex_ang=0.00000 | |
| 224 | + shapecode_2_tex_zoom=1.00000 | |
| 225 | + shapecode_2_r=1.000 | |
| 226 | + shapecode_2_g=1.000 | |
| 227 | + shapecode_2_b=1.000 | |
| 228 | + shapecode_2_a=1.000 | |
| 229 | + shapecode_2_r2=1.000 | |
| 230 | + shapecode_2_g2=1.000 | |
| 231 | + shapecode_2_b2=1.000 | |
| 232 | + shapecode_2_a2=0.000 | |
| 233 | + shapecode_2_border_r=1.000 | |
| 234 | + shapecode_2_border_g=1.000 | |
| 235 | + shapecode_2_border_b=1.000 | |
| 236 | + shapecode_2_border_a=0.000 | |
| 237 | + shape_2_init1=fran = 1; | |
| 238 | + shape_2_init2=xs = 1; | |
| 239 | + shape_2_init3=ys = 1; | |
| 240 | + shape_2_init4=xm = 0.5; | |
| 241 | + shape_2_init5=ym = 0.5; | |
| 242 | + shape_2_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 243 | + shape_2_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 244 | + shape_2_per_frame3= | |
| 245 | + shape_2_per_frame4=xm = xm + 0.03*xs*(sin(time*0.35)*0.5 + 0.5*cos(time*0.87)); | |
| 246 | + shape_2_per_frame5=ym = ym + 0.03*ys*(sin(time*0.92)*0.3 + 0.7*cos(time*0.26)); | |
| 247 | + shape_2_per_frame6= | |
| 248 | + shape_2_per_frame7=x = xm; | |
| 249 | + shape_2_per_frame8=y = ym; | |
| 250 | + shape_2_per_frame9= | |
| 251 | + shape_2_per_frame10=r = 0.5 + 0.5*sin(time*0.25); | |
| 252 | + shape_2_per_frame11=g = 0.5 + abs(r)*sin(time*0.5); | |
| 253 | + shape_2_per_frame12=b = 0.5 + abs(g)*sin(time); | |
| 254 | + shape_2_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 255 | + shape_2_per_frame14=rad = 1.6*(bass_att + mid_att + treb_att)/3; | |
| 256 | + shapecode_3_enabled=0 | |
| 257 | + shapecode_3_sides=4 | |
| 258 | + shapecode_3_additive=0 | |
| 259 | + shapecode_3_thickOutline=0 | |
| 260 | + shapecode_3_textured=0 | |
| 261 | + shapecode_3_num_inst=1 | |
| 262 | + shapecode_3_x=0.500 | |
| 263 | + shapecode_3_y=0.500 | |
| 264 | + shapecode_3_rad=0.10000 | |
| 265 | + shapecode_3_ang=0.00000 | |
| 266 | + shapecode_3_tex_ang=0.00000 | |
| 267 | + shapecode_3_tex_zoom=1.00000 | |
| 268 | + shapecode_3_r=1.000 | |
| 269 | + shapecode_3_g=0.000 | |
| 270 | + shapecode_3_b=0.000 | |
| 271 | + shapecode_3_a=1.000 | |
| 272 | + shapecode_3_r2=0.000 | |
| 273 | + shapecode_3_g2=1.000 | |
| 274 | + shapecode_3_b2=0.000 | |
| 275 | + shapecode_3_a2=0.000 | |
| 276 | + shapecode_3_border_r=1.000 | |
| 277 | + shapecode_3_border_g=1.000 | |
| 278 | + shapecode_3_border_b=1.000 | |
| 279 | + shapecode_3_border_a=0.100 | |
| 280 | + per_frame_1=wave_r = wave_r + 0.700*( 0.20*sin(0.933*time) + 0.30*sin(1.045*time) ); | |
| 281 | + per_frame_2=wave_g = wave_g + 0.700*( 0.20*sin(0.900*time) + 0.30*sin(0.956*time) ); | |
| 282 | + per_frame_3=wave_b = wave_b + 0.200*( 0.20*sin(0.910*time) + 0.30*sin(0.920*time) ); | |
| 283 | + per_frame_4= | |
| 284 | + per_frame_5=zoom = zoom + 0.02*cos(time*1.713+2); | |
| 285 | + per_frame_6=zoom = zoom + 0.02*cos(time*2.319+4); | |
| 286 | + per_frame_7=zoom = zoom + 0.02*cos(time*1.522+1); | |
| 287 | + per_pixel_1=dx= 0.002*cos(ang+1.57); | |
| 288 | + per_pixel_2=dy=-0.002*sin(ang+1.57); | |
| 289 | + warp_1=`#define sampler_pic sampler_cells | |
| 290 | + warp_2=`sampler2D sampler_pic; | |
| 291 | + warp_3=` | |
| 292 | + warp_4=`shader_body | |
| 293 | + warp_5=`{ | |
| 294 | + warp_6=` ret = tex2D( sampler_main, uv ).xyz; | |
| 295 | + warp_7=` | |
| 296 | + warp_8=` // ERROR DIFFUSION DITHER - looks great | |
| 297 | + warp_9=` float2 dither_uv = uv_orig*texsize.xy*texsize_noise_lq.zw + rand_frame.xy; | |
| 298 | + warp_10=` ret += (tex2D(sampler_noise_lq, dither_uv).xyz-0.5)/256.0*1; | |
| 299 | + warp_11=` | |
| 300 | + warp_12=` // mix in img... | |
| 301 | + warp_13=` float3 pic = tex2D(sampler_pic, uv_orig*aspect.xy).xyz; | |
| 302 | + warp_14=` float lum = lum(pic); | |
| 303 | + warp_15=` float use_it = abs(lum*0.8+0.1 - (0.5+roam_cos.y*0.25)); | |
| 304 | + warp_16=` float LFNoise = tex2D(sampler_noise_lq, uv*0.1 + time*0.01).x*6-2; | |
| 305 | + warp_17=` use_it = saturate(1 - use_it*(3+9*rand_preset.x) - LFNoise); | |
| 306 | + warp_18=` ret = lerp(ret, pic, use_it.xxx); | |
| 307 | + warp_19=` | |
| 308 | + warp_20=` // darken over time | |
| 309 | + warp_21=` //ret -= 0.004; | |
| 310 | + warp_22=` //ret *= 0.99; | |
| 311 | + warp_23=` ret *= 0.97 + 0.03*saturate( length(uv - uv_orig)*200 ); // center only | |
| 312 | + warp_24=`} | |
| 313 | + warp_25=` | |
| 314 | + comp_1=`shader_body | |
| 315 | + comp_2=`{ | |
| 316 | + comp_3=` float rad_lq = rad * length(texsize.xy)*0.5; | |
| 317 | + comp_4=` float ang_lq = ang; | |
| 318 | + comp_5=` float2 uv_temp1 = (uv - 0.5) * texsize.xy; | |
| 319 | + comp_6=` float rad_hq = length(uv_temp1); | |
| 320 | + comp_7=` float ang_hq = atan2(-uv_temp1.y, uv_temp1.x); | |
| 321 | + comp_8=` | |
| 322 | + comp_9=` float2 uv2 = (uv - 0.5); | |
| 323 | + comp_10=` float rad2 = rad_lq*0.8; | |
| 324 | + comp_11=` float ang2 = ang_lq * M_INV_PI_2; | |
| 325 | + comp_12=` | |
| 326 | + comp_13=` // ROTATION OVER TIME | |
| 327 | + comp_14=` #if 1 | |
| 328 | + comp_15=` ang2 += time*0.025; //rotate over time | |
| 329 | + comp_16=` #endif | |
| 330 | + comp_17=` | |
| 331 | + comp_18=` // FIN TYPE | |
| 332 | + comp_19=` float fins = 3 + floor(rand_preset.z*5.95); | |
| 333 | + comp_20=` #if 1 // SHARP FINS | |
| 334 | + comp_21=` ang2 = frac(ang2*fins)/fins; | |
| 335 | + comp_22=` // ENABLE THIS TO MAKE THE FINS ALTERNATE: (seamless!) | |
| 336 | + comp_23=` ang2 = abs(ang2 - 0.5/fins); | |
| 337 | + comp_24=` #else // COSINE FINS - a bit slow | |
| 338 | + comp_25=` ang2 = cos(ang2*M_PI_2*fins) * 0.023; | |
| 339 | + comp_26=` #endif | |
| 340 | + comp_27=` | |
| 341 | + comp_28=` // RADIAL KALEIDOSCOPING? | |
| 342 | + comp_29=` #if 0 | |
| 343 | + comp_30=` rad2 *= g_fTexSize.z; | |
| 344 | + comp_31=` // choose one: | |
| 345 | + comp_32=` //rad2 = lerp(rad2, frac(rad2*3)/3.0, 0.5); | |
| 346 | + comp_33=` rad2 = cos(rad2*5); | |
| 347 | + comp_34=` //rad2 = sqrt(rad2)*0.5; | |
| 348 | + comp_35=` //rad2 += abs(frac(rad2*7)-0.5)/7.0 * 1.15; // stepifier | |
| 349 | + comp_36=` //rad2 += cos(rad2*61)*0.02; | |
| 350 | + comp_37=` rad2 *= g_fTexSize.x; | |
| 351 | + comp_38=` #endif | |
| 352 | + comp_39=` | |
| 353 | + comp_40=` ang2 *= M_PI_2; | |
| 354 | + comp_41=` uv2 = 0.5 + rad2*float2(cos(ang2),sin(ang2))*texsize.zw; | |
| 355 | + comp_42=` | |
| 356 | + comp_43=` ret = tex2D(sampler_main, uv2).xyz; | |
| 357 | + comp_44=` ret *= 1.333; // a little bit of overbright | |
| 358 | + comp_45=`} |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Blobby Mirror/AdamFX 2 Geiss - Mash-Up Sphere Xibit Graffiti Warp me Oval Interprise4.milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=2 | |
| 3 | + PSVERSION_WARP=2 | |
| 4 | + PSVERSION_COMP=2 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.900 | |
| 8 | + fDecay=0.980 | |
| 9 | + fVideoEchoZoom=1.169 | |
| 10 | + fVideoEchoAlpha=0.000 | |
| 11 | + nVideoEchoOrientation=0 | |
| 12 | + nWaveMode=6 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=1 | |
| 16 | + bModWaveAlphaByVolume=0 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=1 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=0 | |
| 22 | + bDarken=0 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=4.100 | |
| 26 | + fWaveScale=0.010 | |
| 27 | + fWaveSmoothing=0.900 | |
| 28 | + fWaveParam=0.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=2.853 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=1.04000 | |
| 36 | + rot=0.00000 | |
| 37 | + cx=0.500 | |
| 38 | + cy=0.500 | |
| 39 | + dx=0.03000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.47402 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.010 | |
| 50 | + ob_r=0.000 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.000 | |
| 54 | + ib_size=0.010 | |
| 55 | + ib_r=0.250 | |
| 56 | + ib_g=0.250 | |
| 57 | + ib_b=0.250 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=0 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=0 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=1.000 | |
| 85 | + wavecode_0_g=1.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=1.000 | |
| 88 | + wavecode_1_enabled=0 | |
| 89 | + wavecode_1_samples=512 | |
| 90 | + wavecode_1_sep=0 | |
| 91 | + wavecode_1_bSpectrum=0 | |
| 92 | + wavecode_1_bUseDots=0 | |
| 93 | + wavecode_1_bDrawThick=0 | |
| 94 | + wavecode_1_bAdditive=0 | |
| 95 | + wavecode_1_scaling=1.00000 | |
| 96 | + wavecode_1_smoothing=0.50000 | |
| 97 | + wavecode_1_r=1.000 | |
| 98 | + wavecode_1_g=1.000 | |
| 99 | + wavecode_1_b=1.000 | |
| 100 | + wavecode_1_a=1.000 | |
| 101 | + wavecode_2_enabled=0 | |
| 102 | + wavecode_2_samples=512 | |
| 103 | + wavecode_2_sep=0 | |
| 104 | + wavecode_2_bSpectrum=0 | |
| 105 | + wavecode_2_bUseDots=0 | |
| 106 | + wavecode_2_bDrawThick=0 | |
| 107 | + wavecode_2_bAdditive=0 | |
| 108 | + wavecode_2_scaling=1.00000 | |
| 109 | + wavecode_2_smoothing=0.50000 | |
| 110 | + wavecode_2_r=1.000 | |
| 111 | + wavecode_2_g=1.000 | |
| 112 | + wavecode_2_b=1.000 | |
| 113 | + wavecode_2_a=1.000 | |
| 114 | + wavecode_3_enabled=0 | |
| 115 | + wavecode_3_samples=512 | |
| 116 | + wavecode_3_sep=0 | |
| 117 | + wavecode_3_bSpectrum=0 | |
| 118 | + wavecode_3_bUseDots=0 | |
| 119 | + wavecode_3_bDrawThick=0 | |
| 120 | + wavecode_3_bAdditive=0 | |
| 121 | + wavecode_3_scaling=1.00000 | |
| 122 | + wavecode_3_smoothing=0.50000 | |
| 123 | + wavecode_3_r=1.000 | |
| 124 | + wavecode_3_g=1.000 | |
| 125 | + wavecode_3_b=1.000 | |
| 126 | + wavecode_3_a=1.000 | |
| 127 | + shapecode_0_enabled=1 | |
| 128 | + shapecode_0_sides=44 | |
| 129 | + shapecode_0_additive=0 | |
| 130 | + shapecode_0_thickOutline=0 | |
| 131 | + shapecode_0_textured=0 | |
| 132 | + shapecode_0_num_inst=1 | |
| 133 | + shapecode_0_x=0.500 | |
| 134 | + shapecode_0_y=0.500 | |
| 135 | + shapecode_0_rad=0.03347 | |
| 136 | + shapecode_0_ang=0.00000 | |
| 137 | + shapecode_0_tex_ang=0.00000 | |
| 138 | + shapecode_0_tex_zoom=1.00000 | |
| 139 | + shapecode_0_r=1.000 | |
| 140 | + shapecode_0_g=1.000 | |
| 141 | + shapecode_0_b=1.000 | |
| 142 | + shapecode_0_a=1.000 | |
| 143 | + shapecode_0_r2=1.000 | |
| 144 | + shapecode_0_g2=1.000 | |
| 145 | + shapecode_0_b2=1.000 | |
| 146 | + shapecode_0_a2=0.000 | |
| 147 | + shapecode_0_border_r=1.000 | |
| 148 | + shapecode_0_border_g=1.000 | |
| 149 | + shapecode_0_border_b=1.000 | |
| 150 | + shapecode_0_border_a=0.000 | |
| 151 | + shape_0_init1=fran = 1; | |
| 152 | + shape_0_init2=xs = 1; | |
| 153 | + shape_0_init3=ys = 1; | |
| 154 | + shape_0_init4=xm = 0.5; | |
| 155 | + shape_0_init5=ym = 0.5; | |
| 156 | + shape_0_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 157 | + shape_0_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 158 | + shape_0_per_frame3= | |
| 159 | + shape_0_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.4 + 0.6*cos(time*0.62)); | |
| 160 | + shape_0_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.5 + 0.5*cos(time*0.78)); | |
| 161 | + shape_0_per_frame6= | |
| 162 | + shape_0_per_frame7=x = xm; | |
| 163 | + shape_0_per_frame8=y = ym; | |
| 164 | + shape_0_per_frame9= | |
| 165 | + shape_0_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 166 | + shape_0_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 167 | + shape_0_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 168 | + shape_0_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 169 | + shape_0_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 170 | + shapecode_1_enabled=1 | |
| 171 | + shapecode_1_sides=44 | |
| 172 | + shapecode_1_additive=0 | |
| 173 | + shapecode_1_thickOutline=0 | |
| 174 | + shapecode_1_textured=0 | |
| 175 | + shapecode_1_num_inst=1 | |
| 176 | + shapecode_1_x=0.500 | |
| 177 | + shapecode_1_y=0.500 | |
| 178 | + shapecode_1_rad=0.03347 | |
| 179 | + shapecode_1_ang=0.00000 | |
| 180 | + shapecode_1_tex_ang=0.00000 | |
| 181 | + shapecode_1_tex_zoom=1.00000 | |
| 182 | + shapecode_1_r=1.000 | |
| 183 | + shapecode_1_g=1.000 | |
| 184 | + shapecode_1_b=1.000 | |
| 185 | + shapecode_1_a=1.000 | |
| 186 | + shapecode_1_r2=1.000 | |
| 187 | + shapecode_1_g2=1.000 | |
| 188 | + shapecode_1_b2=1.000 | |
| 189 | + shapecode_1_a2=0.000 | |
| 190 | + shapecode_1_border_r=1.000 | |
| 191 | + shapecode_1_border_g=1.000 | |
| 192 | + shapecode_1_border_b=1.000 | |
| 193 | + shapecode_1_border_a=0.000 | |
| 194 | + shape_1_init1=fran = 1; | |
| 195 | + shape_1_init2=xs = 1; | |
| 196 | + shape_1_init3=ys = 1; | |
| 197 | + shape_1_init4=xm = 0.5; | |
| 198 | + shape_1_init5=ym = 0.5; | |
| 199 | + shape_1_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 200 | + shape_1_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 201 | + shape_1_per_frame3= | |
| 202 | + shape_1_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.6 + 0.4*cos(time*0.62)); | |
| 203 | + shape_1_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.7 + 0.3*cos(time*0.78)); | |
| 204 | + shape_1_per_frame6= | |
| 205 | + shape_1_per_frame7=x = xm; | |
| 206 | + shape_1_per_frame8=y = ym; | |
| 207 | + shape_1_per_frame9= | |
| 208 | + shape_1_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 209 | + shape_1_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 210 | + shape_1_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 211 | + shape_1_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 212 | + shape_1_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 213 | + shapecode_2_enabled=0 | |
| 214 | + shapecode_2_sides=44 | |
| 215 | + shapecode_2_additive=0 | |
| 216 | + shapecode_2_thickOutline=0 | |
| 217 | + shapecode_2_textured=0 | |
| 218 | + shapecode_2_num_inst=1 | |
| 219 | + shapecode_2_x=0.500 | |
| 220 | + shapecode_2_y=0.500 | |
| 221 | + shapecode_2_rad=0.03347 | |
| 222 | + shapecode_2_ang=0.00000 | |
| 223 | + shapecode_2_tex_ang=0.00000 | |
| 224 | + shapecode_2_tex_zoom=1.00000 | |
| 225 | + shapecode_2_r=1.000 | |
| 226 | + shapecode_2_g=1.000 | |
| 227 | + shapecode_2_b=1.000 | |
| 228 | + shapecode_2_a=1.000 | |
| 229 | + shapecode_2_r2=1.000 | |
| 230 | + shapecode_2_g2=1.000 | |
| 231 | + shapecode_2_b2=1.000 | |
| 232 | + shapecode_2_a2=0.000 | |
| 233 | + shapecode_2_border_r=1.000 | |
| 234 | + shapecode_2_border_g=1.000 | |
| 235 | + shapecode_2_border_b=1.000 | |
| 236 | + shapecode_2_border_a=0.000 | |
| 237 | + shape_2_init1=fran = 1; | |
| 238 | + shape_2_init2=xs = 1; | |
| 239 | + shape_2_init3=ys = 1; | |
| 240 | + shape_2_init4=xm = 0.5; | |
| 241 | + shape_2_init5=ym = 0.5; | |
| 242 | + shape_2_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 243 | + shape_2_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 244 | + shape_2_per_frame3= | |
| 245 | + shape_2_per_frame4=xm = xm + 0.03*xs*(sin(time*0.35)*0.5 + 0.5*cos(time*0.87)); | |
| 246 | + shape_2_per_frame5=ym = ym + 0.03*ys*(sin(time*0.92)*0.3 + 0.7*cos(time*0.26)); | |
| 247 | + shape_2_per_frame6= | |
| 248 | + shape_2_per_frame7=x = xm; | |
| 249 | + shape_2_per_frame8=y = ym; | |
| 250 | + shape_2_per_frame9= | |
| 251 | + shape_2_per_frame10=r = 0.5 + 0.5*sin(time*0.25); | |
| 252 | + shape_2_per_frame11=g = 0.5 + abs(r)*sin(time*0.5); | |
| 253 | + shape_2_per_frame12=b = 0.5 + abs(g)*sin(time); | |
| 254 | + shape_2_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 255 | + shape_2_per_frame14=rad = 1.6*(bass_att + mid_att + treb_att)/3; | |
| 256 | + shapecode_3_enabled=0 | |
| 257 | + shapecode_3_sides=4 | |
| 258 | + shapecode_3_additive=0 | |
| 259 | + shapecode_3_thickOutline=0 | |
| 260 | + shapecode_3_textured=0 | |
| 261 | + shapecode_3_num_inst=1 | |
| 262 | + shapecode_3_x=0.500 | |
| 263 | + shapecode_3_y=0.500 | |
| 264 | + shapecode_3_rad=0.10000 | |
| 265 | + shapecode_3_ang=0.00000 | |
| 266 | + shapecode_3_tex_ang=0.00000 | |
| 267 | + shapecode_3_tex_zoom=1.00000 | |
| 268 | + shapecode_3_r=1.000 | |
| 269 | + shapecode_3_g=0.000 | |
| 270 | + shapecode_3_b=0.000 | |
| 271 | + shapecode_3_a=1.000 | |
| 272 | + shapecode_3_r2=0.000 | |
| 273 | + shapecode_3_g2=1.000 | |
| 274 | + shapecode_3_b2=0.000 | |
| 275 | + shapecode_3_a2=0.000 | |
| 276 | + shapecode_3_border_r=1.000 | |
| 277 | + shapecode_3_border_g=1.000 | |
| 278 | + shapecode_3_border_b=1.000 | |
| 279 | + shapecode_3_border_a=0.100 | |
| 280 | + per_frame_1=wave_r = wave_r + 0.700*( 0.20*sin(0.933*time) + 0.30*sin(1.045*time) ); | |
| 281 | + per_frame_2=wave_g = wave_g + 0.700*( 0.20*sin(0.900*time) + 0.30*sin(0.956*time) ); | |
| 282 | + per_frame_3=wave_b = wave_b + 0.200*( 0.20*sin(0.910*time) + 0.30*sin(0.920*time) ); | |
| 283 | + per_frame_4= | |
| 284 | + per_frame_5=zoom = zoom + 0.02*cos(time*1.713+2); | |
| 285 | + per_frame_6=zoom = zoom + 0.02*cos(time*2.319+4); | |
| 286 | + per_frame_7=zoom = zoom + 0.02*cos(time*1.522+1); | |
| 287 | + per_pixel_1=dx= 0.002*cos(ang+1.57); | |
| 288 | + per_pixel_2=dy=-0.002*sin(ang+1.57); | |
| 289 | + warp_1=`shader_body | |
| 290 | + warp_2=`{ | |
| 291 | + warp_3=` float s = 0.03 + 1.5*pow(q11, 2); // should be < about 1 | |
| 292 | + warp_4=` float2 nz = tex3D( sampler_noisevol_hq, float3(uv_orig.xy*4*texsize.xy/850.0*s,time*0.055) ); | |
| 293 | + warp_5=` | |
| 294 | + warp_6=` float2 zz = uv_orig.xy * texsize.xy * 6 * 0.1 * s + nz*9; | |
| 295 | + warp_7=` uv.xy += float2(cos(zz.x),cos(zz.y))*texsize.zw * 1.7 * 0.9 / s; | |
| 296 | + warp_8=` | |
| 297 | + warp_9=` // sample previous frame | |
| 298 | + warp_10=` ret.xyz = tex2D( sampler_main, uv ).xyz; | |
| 299 | + warp_11=` | |
| 300 | + warp_12=` ret.xyz *= 0.99; | |
| 301 | + warp_13=` | |
| 302 | + warp_14=` // add noise: | |
| 303 | + warp_15=` float2 dither_uv = uv_orig*texsize.xy*texsize_noise_lq.zw * 1 + rand_frame.xy; | |
| 304 | + warp_16=` ret.xyz += (tex2D(sampler_noise_lq, dither_uv).xyz-0.5)/256.0 * 122 | |
| 305 | + warp_17=` //* saturate(treb_att-1); | |
| 306 | + warp_18=` *0.16; | |
| 307 | + warp_19=` | |
| 308 | + warp_20=` // color rotate & desaturate over time, to keep the globs white | |
| 309 | + warp_21=` ret.xyz = lerp(ret.xyz, ret.zxy, 0.05); | |
| 310 | + warp_22=`} | |
| 311 | + comp_1=`shader_body | |
| 312 | + comp_2=`{ | |
| 313 | + comp_3=` float rad_lq = rad * length(texsize.xy)*0.5; | |
| 314 | + comp_4=` float ang_lq = ang; | |
| 315 | + comp_5=` float2 uv_temp1 = (uv - 0.5) * texsize.xy; | |
| 316 | + comp_6=` float rad_hq = length(uv_temp1); | |
| 317 | + comp_7=` float ang_hq = atan2(-uv_temp1.y, uv_temp1.x); | |
| 318 | + comp_8=` | |
| 319 | + comp_9=` float2 uv2 = (uv - 0.5); | |
| 320 | + comp_10=` float rad2 = rad_lq*0.8; | |
| 321 | + comp_11=` float ang2 = ang_lq * M_INV_PI_2; | |
| 322 | + comp_12=` | |
| 323 | + comp_13=` // ROTATION OVER TIME | |
| 324 | + comp_14=` #if 1 | |
| 325 | + comp_15=` ang2 += time*0.025; //rotate over time | |
| 326 | + comp_16=` #endif | |
| 327 | + comp_17=` | |
| 328 | + comp_18=` // FIN TYPE | |
| 329 | + comp_19=` float fins = 3 + floor(rand_preset.z*5.95); | |
| 330 | + comp_20=` #if 1 // SHARP FINS | |
| 331 | + comp_21=` ang2 = frac(ang2*fins)/fins; | |
| 332 | + comp_22=` // ENABLE THIS TO MAKE THE FINS ALTERNATE: (seamless!) | |
| 333 | + comp_23=` ang2 = abs(ang2 - 0.5/fins); | |
| 334 | + comp_24=` #else // COSINE FINS - a bit slow | |
| 335 | + comp_25=` ang2 = cos(ang2*M_PI_2*fins) * 0.023; | |
| 336 | + comp_26=` #endif | |
| 337 | + comp_27=` | |
| 338 | + comp_28=` // RADIAL KALEIDOSCOPING? | |
| 339 | + comp_29=` #if 0 | |
| 340 | + comp_30=` rad2 *= g_fTexSize.z; | |
| 341 | + comp_31=` // choose one: | |
| 342 | + comp_32=` //rad2 = lerp(rad2, frac(rad2*3)/3.0, 0.5); | |
| 343 | + comp_33=` rad2 = cos(rad2*5); | |
| 344 | + comp_34=` //rad2 = sqrt(rad2)*0.5; | |
| 345 | + comp_35=` //rad2 += abs(frac(rad2*7)-0.5)/7.0 * 1.15; // stepifier | |
| 346 | + comp_36=` //rad2 += cos(rad2*61)*0.02; | |
| 347 | + comp_37=` rad2 *= g_fTexSize.x; | |
| 348 | + comp_38=` #endif | |
| 349 | + comp_39=` | |
| 350 | + comp_40=` ang2 *= M_PI_2; | |
| 351 | + comp_41=` uv2 = 0.5 + rad2*float2(cos(ang2),sin(ang2))*texsize.zw; | |
| 352 | + comp_42=` | |
| 353 | + comp_43=` ret = tex2D(sampler_main, uv2).xyz; | |
| 354 | + comp_44=` ret *= 1.333; // a little bit of overbright | |
| 355 | + comp_45=`} |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Blobby Mirror/AdamFX 2 Geiss - Mash-Up Sphere Xibit Graffiti Warp me Tydye.milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=2 | |
| 3 | + PSVERSION_WARP=2 | |
| 4 | + PSVERSION_COMP=2 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.900 | |
| 8 | + fDecay=0.980 | |
| 9 | + fVideoEchoZoom=1.169 | |
| 10 | + fVideoEchoAlpha=0.000 | |
| 11 | + nVideoEchoOrientation=0 | |
| 12 | + nWaveMode=6 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=1 | |
| 16 | + bModWaveAlphaByVolume=0 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=1 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=0 | |
| 22 | + bDarken=0 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=4.100 | |
| 26 | + fWaveScale=0.010 | |
| 27 | + fWaveSmoothing=0.900 | |
| 28 | + fWaveParam=0.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=2.853 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=1.04000 | |
| 36 | + rot=0.00000 | |
| 37 | + cx=0.500 | |
| 38 | + cy=0.500 | |
| 39 | + dx=0.03000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.47402 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.010 | |
| 50 | + ob_r=0.000 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.000 | |
| 54 | + ib_size=0.010 | |
| 55 | + ib_r=0.250 | |
| 56 | + ib_g=0.250 | |
| 57 | + ib_b=0.250 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=0 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=0 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=1.000 | |
| 85 | + wavecode_0_g=1.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=1.000 | |
| 88 | + wavecode_1_enabled=0 | |
| 89 | + wavecode_1_samples=512 | |
| 90 | + wavecode_1_sep=0 | |
| 91 | + wavecode_1_bSpectrum=0 | |
| 92 | + wavecode_1_bUseDots=0 | |
| 93 | + wavecode_1_bDrawThick=0 | |
| 94 | + wavecode_1_bAdditive=0 | |
| 95 | + wavecode_1_scaling=1.00000 | |
| 96 | + wavecode_1_smoothing=0.50000 | |
| 97 | + wavecode_1_r=1.000 | |
| 98 | + wavecode_1_g=1.000 | |
| 99 | + wavecode_1_b=1.000 | |
| 100 | + wavecode_1_a=1.000 | |
| 101 | + wavecode_2_enabled=0 | |
| 102 | + wavecode_2_samples=512 | |
| 103 | + wavecode_2_sep=0 | |
| 104 | + wavecode_2_bSpectrum=0 | |
| 105 | + wavecode_2_bUseDots=0 | |
| 106 | + wavecode_2_bDrawThick=0 | |
| 107 | + wavecode_2_bAdditive=0 | |
| 108 | + wavecode_2_scaling=1.00000 | |
| 109 | + wavecode_2_smoothing=0.50000 | |
| 110 | + wavecode_2_r=1.000 | |
| 111 | + wavecode_2_g=1.000 | |
| 112 | + wavecode_2_b=1.000 | |
| 113 | + wavecode_2_a=1.000 | |
| 114 | + wavecode_3_enabled=0 | |
| 115 | + wavecode_3_samples=512 | |
| 116 | + wavecode_3_sep=0 | |
| 117 | + wavecode_3_bSpectrum=0 | |
| 118 | + wavecode_3_bUseDots=0 | |
| 119 | + wavecode_3_bDrawThick=0 | |
| 120 | + wavecode_3_bAdditive=0 | |
| 121 | + wavecode_3_scaling=1.00000 | |
| 122 | + wavecode_3_smoothing=0.50000 | |
| 123 | + wavecode_3_r=1.000 | |
| 124 | + wavecode_3_g=1.000 | |
| 125 | + wavecode_3_b=1.000 | |
| 126 | + wavecode_3_a=1.000 | |
| 127 | + shapecode_0_enabled=1 | |
| 128 | + shapecode_0_sides=44 | |
| 129 | + shapecode_0_additive=0 | |
| 130 | + shapecode_0_thickOutline=0 | |
| 131 | + shapecode_0_textured=0 | |
| 132 | + shapecode_0_num_inst=1 | |
| 133 | + shapecode_0_x=0.500 | |
| 134 | + shapecode_0_y=0.500 | |
| 135 | + shapecode_0_rad=0.03347 | |
| 136 | + shapecode_0_ang=0.00000 | |
| 137 | + shapecode_0_tex_ang=0.00000 | |
| 138 | + shapecode_0_tex_zoom=1.00000 | |
| 139 | + shapecode_0_r=1.000 | |
| 140 | + shapecode_0_g=1.000 | |
| 141 | + shapecode_0_b=1.000 | |
| 142 | + shapecode_0_a=1.000 | |
| 143 | + shapecode_0_r2=1.000 | |
| 144 | + shapecode_0_g2=1.000 | |
| 145 | + shapecode_0_b2=1.000 | |
| 146 | + shapecode_0_a2=0.000 | |
| 147 | + shapecode_0_border_r=1.000 | |
| 148 | + shapecode_0_border_g=1.000 | |
| 149 | + shapecode_0_border_b=1.000 | |
| 150 | + shapecode_0_border_a=0.000 | |
| 151 | + shape_0_init1=fran = 1; | |
| 152 | + shape_0_init2=xs = 1; | |
| 153 | + shape_0_init3=ys = 1; | |
| 154 | + shape_0_init4=xm = 0.5; | |
| 155 | + shape_0_init5=ym = 0.5; | |
| 156 | + shape_0_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 157 | + shape_0_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 158 | + shape_0_per_frame3= | |
| 159 | + shape_0_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.4 + 0.6*cos(time*0.62)); | |
| 160 | + shape_0_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.5 + 0.5*cos(time*0.78)); | |
| 161 | + shape_0_per_frame6= | |
| 162 | + shape_0_per_frame7=x = xm; | |
| 163 | + shape_0_per_frame8=y = ym; | |
| 164 | + shape_0_per_frame9= | |
| 165 | + shape_0_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 166 | + shape_0_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 167 | + shape_0_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 168 | + shape_0_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 169 | + shape_0_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 170 | + shapecode_1_enabled=1 | |
| 171 | + shapecode_1_sides=44 | |
| 172 | + shapecode_1_additive=0 | |
| 173 | + shapecode_1_thickOutline=0 | |
| 174 | + shapecode_1_textured=0 | |
| 175 | + shapecode_1_num_inst=1 | |
| 176 | + shapecode_1_x=0.500 | |
| 177 | + shapecode_1_y=0.500 | |
| 178 | + shapecode_1_rad=0.03347 | |
| 179 | + shapecode_1_ang=0.00000 | |
| 180 | + shapecode_1_tex_ang=0.00000 | |
| 181 | + shapecode_1_tex_zoom=1.00000 | |
| 182 | + shapecode_1_r=1.000 | |
| 183 | + shapecode_1_g=1.000 | |
| 184 | + shapecode_1_b=1.000 | |
| 185 | + shapecode_1_a=1.000 | |
| 186 | + shapecode_1_r2=1.000 | |
| 187 | + shapecode_1_g2=1.000 | |
| 188 | + shapecode_1_b2=1.000 | |
| 189 | + shapecode_1_a2=0.000 | |
| 190 | + shapecode_1_border_r=1.000 | |
| 191 | + shapecode_1_border_g=1.000 | |
| 192 | + shapecode_1_border_b=1.000 | |
| 193 | + shapecode_1_border_a=0.000 | |
| 194 | + shape_1_init1=fran = 1; | |
| 195 | + shape_1_init2=xs = 1; | |
| 196 | + shape_1_init3=ys = 1; | |
| 197 | + shape_1_init4=xm = 0.5; | |
| 198 | + shape_1_init5=ym = 0.5; | |
| 199 | + shape_1_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 200 | + shape_1_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 201 | + shape_1_per_frame3= | |
| 202 | + shape_1_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.6 + 0.4*cos(time*0.62)); | |
| 203 | + shape_1_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.7 + 0.3*cos(time*0.78)); | |
| 204 | + shape_1_per_frame6= | |
| 205 | + shape_1_per_frame7=x = xm; | |
| 206 | + shape_1_per_frame8=y = ym; | |
| 207 | + shape_1_per_frame9= | |
| 208 | + shape_1_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 209 | + shape_1_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 210 | + shape_1_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 211 | + shape_1_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 212 | + shape_1_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 213 | + shapecode_2_enabled=0 | |
| 214 | + shapecode_2_sides=44 | |
| 215 | + shapecode_2_additive=0 | |
| 216 | + shapecode_2_thickOutline=0 | |
| 217 | + shapecode_2_textured=0 | |
| 218 | + shapecode_2_num_inst=1 | |
| 219 | + shapecode_2_x=0.500 | |
| 220 | + shapecode_2_y=0.500 | |
| 221 | + shapecode_2_rad=0.03347 | |
| 222 | + shapecode_2_ang=0.00000 | |
| 223 | + shapecode_2_tex_ang=0.00000 | |
| 224 | + shapecode_2_tex_zoom=1.00000 | |
| 225 | + shapecode_2_r=1.000 | |
| 226 | + shapecode_2_g=1.000 | |
| 227 | + shapecode_2_b=1.000 | |
| 228 | + shapecode_2_a=1.000 | |
| 229 | + shapecode_2_r2=1.000 | |
| 230 | + shapecode_2_g2=1.000 | |
| 231 | + shapecode_2_b2=1.000 | |
| 232 | + shapecode_2_a2=0.000 | |
| 233 | + shapecode_2_border_r=1.000 | |
| 234 | + shapecode_2_border_g=1.000 | |
| 235 | + shapecode_2_border_b=1.000 | |
| 236 | + shapecode_2_border_a=0.000 | |
| 237 | + shape_2_init1=fran = 1; | |
| 238 | + shape_2_init2=xs = 1; | |
| 239 | + shape_2_init3=ys = 1; | |
| 240 | + shape_2_init4=xm = 0.5; | |
| 241 | + shape_2_init5=ym = 0.5; | |
| 242 | + shape_2_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 243 | + shape_2_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 244 | + shape_2_per_frame3= | |
| 245 | + shape_2_per_frame4=xm = xm + 0.03*xs*(sin(time*0.35)*0.5 + 0.5*cos(time*0.87)); | |
| 246 | + shape_2_per_frame5=ym = ym + 0.03*ys*(sin(time*0.92)*0.3 + 0.7*cos(time*0.26)); | |
| 247 | + shape_2_per_frame6= | |
| 248 | + shape_2_per_frame7=x = xm; | |
| 249 | + shape_2_per_frame8=y = ym; | |
| 250 | + shape_2_per_frame9= | |
| 251 | + shape_2_per_frame10=r = 0.5 + 0.5*sin(time*0.25); | |
| 252 | + shape_2_per_frame11=g = 0.5 + abs(r)*sin(time*0.5); | |
| 253 | + shape_2_per_frame12=b = 0.5 + abs(g)*sin(time); | |
| 254 | + shape_2_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 255 | + shape_2_per_frame14=rad = 1.6*(bass_att + mid_att + treb_att)/3; | |
| 256 | + shapecode_3_enabled=0 | |
| 257 | + shapecode_3_sides=4 | |
| 258 | + shapecode_3_additive=0 | |
| 259 | + shapecode_3_thickOutline=0 | |
| 260 | + shapecode_3_textured=0 | |
| 261 | + shapecode_3_num_inst=1 | |
| 262 | + shapecode_3_x=0.500 | |
| 263 | + shapecode_3_y=0.500 | |
| 264 | + shapecode_3_rad=0.10000 | |
| 265 | + shapecode_3_ang=0.00000 | |
| 266 | + shapecode_3_tex_ang=0.00000 | |
| 267 | + shapecode_3_tex_zoom=1.00000 | |
| 268 | + shapecode_3_r=1.000 | |
| 269 | + shapecode_3_g=0.000 | |
| 270 | + shapecode_3_b=0.000 | |
| 271 | + shapecode_3_a=1.000 | |
| 272 | + shapecode_3_r2=0.000 | |
| 273 | + shapecode_3_g2=1.000 | |
| 274 | + shapecode_3_b2=0.000 | |
| 275 | + shapecode_3_a2=0.000 | |
| 276 | + shapecode_3_border_r=1.000 | |
| 277 | + shapecode_3_border_g=1.000 | |
| 278 | + shapecode_3_border_b=1.000 | |
| 279 | + shapecode_3_border_a=0.100 | |
| 280 | + per_frame_1=wave_r = wave_r + 0.700*( 0.20*sin(0.933*time) + 0.30*sin(1.045*time) ); | |
| 281 | + per_frame_2=wave_g = wave_g + 0.700*( 0.20*sin(0.900*time) + 0.30*sin(0.956*time) ); | |
| 282 | + per_frame_3=wave_b = wave_b + 0.200*( 0.20*sin(0.910*time) + 0.30*sin(0.920*time) ); | |
| 283 | + per_frame_4= | |
| 284 | + per_frame_5=zoom = zoom + 0.02*cos(time*1.713+2); | |
| 285 | + per_frame_6=zoom = zoom + 0.02*cos(time*2.319+4); | |
| 286 | + per_frame_7=zoom = zoom + 0.02*cos(time*1.522+1); | |
| 287 | + per_pixel_1=dx= 0.002*cos(ang+1.57); | |
| 288 | + per_pixel_2=dy=-0.002*sin(ang+1.57); | |
| 289 | + warp_1=`shader_body | |
| 290 | + warp_2=`{ | |
| 291 | + warp_3=` float2 uv2 = uv; | |
| 292 | + warp_4=` | |
| 293 | + warp_5=` // diffused version: | |
| 294 | + warp_6=` float ss = 0.1; | |
| 295 | + warp_7=` float3 blur = 0.25*( | |
| 296 | + warp_8=` tex2D(sampler_main, uv2+ss*texsize.zw*float2( 1, 1)).xyz + | |
| 297 | + warp_9=` tex2D(sampler_main, uv2+ss*texsize.zw*float2(-1, 1)).xyz + | |
| 298 | + warp_10=` tex2D(sampler_main, uv2+ss*texsize.zw*float2( 1,-1)).xyz + | |
| 299 | + warp_11=` tex2D(sampler_main, uv2+ss*texsize.zw*float2(-1,-1)).xyz | |
| 300 | + warp_12=` ); | |
| 301 | + warp_13=` | |
| 302 | + warp_14=` // diffusion: | |
| 303 | + warp_15=` ret = blur; | |
| 304 | + warp_16=` | |
| 305 | + warp_17=` float F2 = 0.035; | |
| 306 | + warp_18=` float k2 = 0.060; | |
| 307 | + warp_19=` float s = 0.025; | |
| 308 | + warp_20=` float scale = 4; | |
| 309 | + warp_21=` | |
| 310 | + warp_22=` // reaction: | |
| 311 | + warp_23=` float3 z = ret; | |
| 312 | + warp_24=` float uvv = ret.x*ret.y*ret.y; | |
| 313 | + warp_25=` z.x += (-uvv + F2*(1-ret.x))*scale; | |
| 314 | + warp_26=` z.y += (uvv - (F2+k2)*ret.y)*scale; | |
| 315 | + warp_27=` //z.x += s*(16-ret.x*ret.y); | |
| 316 | + warp_28=` //z.y += s*(ret.x*ret.y - ret.y - ret.z); | |
| 317 | + warp_29=` z.z += 0; | |
| 318 | + warp_30=` | |
| 319 | + warp_31=` // apply laplacian: | |
| 320 | + warp_32=` z.x += (GetBlur2(uv2) - GetPixel(uv2))*0.1*scale; | |
| 321 | + warp_33=` | |
| 322 | + warp_34=` ret = z; | |
| 323 | + warp_35=` | |
| 324 | + warp_36=` // add noise: | |
| 325 | + warp_37=` ret += 0.09*(tex2d(sampler_noise_lq, uv*texsize.xy*texsize_noise_lq.zw + rand_frame.xy).xyz*2-1); | |
| 326 | + warp_38=` | |
| 327 | + warp_39=` // darken (decay) over time | |
| 328 | + warp_40=` //ret = (ret - 0.002)*0.99; | |
| 329 | + warp_41=`} | |
| 330 | + comp_1=`shader_body | |
| 331 | + comp_2=`{ | |
| 332 | + comp_3=` float rad_lq = rad * length(texsize.xy)*0.5; | |
| 333 | + comp_4=` float ang_lq = ang; | |
| 334 | + comp_5=` float2 uv_temp1 = (uv - 0.5) * texsize.xy; | |
| 335 | + comp_6=` float rad_hq = length(uv_temp1); | |
| 336 | + comp_7=` float ang_hq = atan2(-uv_temp1.y, uv_temp1.x); | |
| 337 | + comp_8=` | |
| 338 | + comp_9=` float2 uv2 = (uv - 0.5); | |
| 339 | + comp_10=` float rad2 = rad_lq*0.8; | |
| 340 | + comp_11=` float ang2 = ang_lq * M_INV_PI_2; | |
| 341 | + comp_12=` | |
| 342 | + comp_13=` // ROTATION OVER TIME | |
| 343 | + comp_14=` #if 1 | |
| 344 | + comp_15=` ang2 += time*0.025; //rotate over time | |
| 345 | + comp_16=` #endif | |
| 346 | + comp_17=` | |
| 347 | + comp_18=` // FIN TYPE | |
| 348 | + comp_19=` float fins = 3 + floor(rand_preset.z*5.95); | |
| 349 | + comp_20=` #if 1 // SHARP FINS | |
| 350 | + comp_21=` ang2 = frac(ang2*fins)/fins; | |
| 351 | + comp_22=` // ENABLE THIS TO MAKE THE FINS ALTERNATE: (seamless!) | |
| 352 | + comp_23=` ang2 = abs(ang2 - 0.5/fins); | |
| 353 | + comp_24=` #else // COSINE FINS - a bit slow | |
| 354 | + comp_25=` ang2 = cos(ang2*M_PI_2*fins) * 0.023; | |
| 355 | + comp_26=` #endif | |
| 356 | + comp_27=` | |
| 357 | + comp_28=` // RADIAL KALEIDOSCOPING? | |
| 358 | + comp_29=` #if 0 | |
| 359 | + comp_30=` rad2 *= g_fTexSize.z; | |
| 360 | + comp_31=` // choose one: | |
| 361 | + comp_32=` //rad2 = lerp(rad2, frac(rad2*3)/3.0, 0.5); | |
| 362 | + comp_33=` rad2 = cos(rad2*5); | |
| 363 | + comp_34=` //rad2 = sqrt(rad2)*0.5; | |
| 364 | + comp_35=` //rad2 += abs(frac(rad2*7)-0.5)/7.0 * 1.15; // stepifier | |
| 365 | + comp_36=` //rad2 += cos(rad2*61)*0.02; | |
| 366 | + comp_37=` rad2 *= g_fTexSize.x; | |
| 367 | + comp_38=` #endif | |
| 368 | + comp_39=` | |
| 369 | + comp_40=` ang2 *= M_PI_2; | |
| 370 | + comp_41=` uv2 = 0.5 + rad2*float2(cos(ang2),sin(ang2))*texsize.zw; | |
| 371 | + comp_42=` | |
| 372 | + comp_43=` ret = tex2D(sampler_main, uv2).xyz; | |
| 373 | + comp_44=` ret *= 1.333; // a little bit of overbright | |
| 374 | + comp_45=`} |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Blobby Mirror/AdamFX 2 Geiss - Mash-Up Sphere Xibit Graffiti Warp me Tydye2.milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=2 | |
| 3 | + PSVERSION_WARP=2 | |
| 4 | + PSVERSION_COMP=2 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.900 | |
| 8 | + fDecay=0.980 | |
| 9 | + fVideoEchoZoom=1.169 | |
| 10 | + fVideoEchoAlpha=0.000 | |
| 11 | + nVideoEchoOrientation=0 | |
| 12 | + nWaveMode=6 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=1 | |
| 16 | + bModWaveAlphaByVolume=0 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=1 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=0 | |
| 22 | + bDarken=0 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=4.100 | |
| 26 | + fWaveScale=0.010 | |
| 27 | + fWaveSmoothing=0.900 | |
| 28 | + fWaveParam=0.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=2.853 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=1.04000 | |
| 36 | + rot=0.00000 | |
| 37 | + cx=0.500 | |
| 38 | + cy=0.500 | |
| 39 | + dx=0.03000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.47402 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.010 | |
| 50 | + ob_r=0.000 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.000 | |
| 54 | + ib_size=0.010 | |
| 55 | + ib_r=0.250 | |
| 56 | + ib_g=0.250 | |
| 57 | + ib_b=0.250 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=0 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=0 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=1.000 | |
| 85 | + wavecode_0_g=1.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=1.000 | |
| 88 | + wavecode_1_enabled=0 | |
| 89 | + wavecode_1_samples=512 | |
| 90 | + wavecode_1_sep=0 | |
| 91 | + wavecode_1_bSpectrum=0 | |
| 92 | + wavecode_1_bUseDots=0 | |
| 93 | + wavecode_1_bDrawThick=0 | |
| 94 | + wavecode_1_bAdditive=0 | |
| 95 | + wavecode_1_scaling=1.00000 | |
| 96 | + wavecode_1_smoothing=0.50000 | |
| 97 | + wavecode_1_r=1.000 | |
| 98 | + wavecode_1_g=1.000 | |
| 99 | + wavecode_1_b=1.000 | |
| 100 | + wavecode_1_a=1.000 | |
| 101 | + wavecode_2_enabled=0 | |
| 102 | + wavecode_2_samples=512 | |
| 103 | + wavecode_2_sep=0 | |
| 104 | + wavecode_2_bSpectrum=0 | |
| 105 | + wavecode_2_bUseDots=0 | |
| 106 | + wavecode_2_bDrawThick=0 | |
| 107 | + wavecode_2_bAdditive=0 | |
| 108 | + wavecode_2_scaling=1.00000 | |
| 109 | + wavecode_2_smoothing=0.50000 | |
| 110 | + wavecode_2_r=1.000 | |
| 111 | + wavecode_2_g=1.000 | |
| 112 | + wavecode_2_b=1.000 | |
| 113 | + wavecode_2_a=1.000 | |
| 114 | + wavecode_3_enabled=0 | |
| 115 | + wavecode_3_samples=512 | |
| 116 | + wavecode_3_sep=0 | |
| 117 | + wavecode_3_bSpectrum=0 | |
| 118 | + wavecode_3_bUseDots=0 | |
| 119 | + wavecode_3_bDrawThick=0 | |
| 120 | + wavecode_3_bAdditive=0 | |
| 121 | + wavecode_3_scaling=1.00000 | |
| 122 | + wavecode_3_smoothing=0.50000 | |
| 123 | + wavecode_3_r=1.000 | |
| 124 | + wavecode_3_g=1.000 | |
| 125 | + wavecode_3_b=1.000 | |
| 126 | + wavecode_3_a=1.000 | |
| 127 | + shapecode_0_enabled=1 | |
| 128 | + shapecode_0_sides=44 | |
| 129 | + shapecode_0_additive=0 | |
| 130 | + shapecode_0_thickOutline=0 | |
| 131 | + shapecode_0_textured=0 | |
| 132 | + shapecode_0_num_inst=1 | |
| 133 | + shapecode_0_x=0.500 | |
| 134 | + shapecode_0_y=0.500 | |
| 135 | + shapecode_0_rad=0.03347 | |
| 136 | + shapecode_0_ang=0.00000 | |
| 137 | + shapecode_0_tex_ang=0.00000 | |
| 138 | + shapecode_0_tex_zoom=1.00000 | |
| 139 | + shapecode_0_r=1.000 | |
| 140 | + shapecode_0_g=1.000 | |
| 141 | + shapecode_0_b=1.000 | |
| 142 | + shapecode_0_a=1.000 | |
| 143 | + shapecode_0_r2=1.000 | |
| 144 | + shapecode_0_g2=1.000 | |
| 145 | + shapecode_0_b2=1.000 | |
| 146 | + shapecode_0_a2=0.000 | |
| 147 | + shapecode_0_border_r=1.000 | |
| 148 | + shapecode_0_border_g=1.000 | |
| 149 | + shapecode_0_border_b=1.000 | |
| 150 | + shapecode_0_border_a=0.000 | |
| 151 | + shape_0_init1=fran = 1; | |
| 152 | + shape_0_init2=xs = 1; | |
| 153 | + shape_0_init3=ys = 1; | |
| 154 | + shape_0_init4=xm = 0.5; | |
| 155 | + shape_0_init5=ym = 0.5; | |
| 156 | + shape_0_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 157 | + shape_0_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 158 | + shape_0_per_frame3= | |
| 159 | + shape_0_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.4 + 0.6*cos(time*0.62)); | |
| 160 | + shape_0_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.5 + 0.5*cos(time*0.78)); | |
| 161 | + shape_0_per_frame6= | |
| 162 | + shape_0_per_frame7=x = xm; | |
| 163 | + shape_0_per_frame8=y = ym; | |
| 164 | + shape_0_per_frame9= | |
| 165 | + shape_0_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 166 | + shape_0_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 167 | + shape_0_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 168 | + shape_0_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 169 | + shape_0_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 170 | + shapecode_1_enabled=1 | |
| 171 | + shapecode_1_sides=44 | |
| 172 | + shapecode_1_additive=0 | |
| 173 | + shapecode_1_thickOutline=0 | |
| 174 | + shapecode_1_textured=0 | |
| 175 | + shapecode_1_num_inst=1 | |
| 176 | + shapecode_1_x=0.500 | |
| 177 | + shapecode_1_y=0.500 | |
| 178 | + shapecode_1_rad=0.03347 | |
| 179 | + shapecode_1_ang=0.00000 | |
| 180 | + shapecode_1_tex_ang=0.00000 | |
| 181 | + shapecode_1_tex_zoom=1.00000 | |
| 182 | + shapecode_1_r=1.000 | |
| 183 | + shapecode_1_g=1.000 | |
| 184 | + shapecode_1_b=1.000 | |
| 185 | + shapecode_1_a=1.000 | |
| 186 | + shapecode_1_r2=1.000 | |
| 187 | + shapecode_1_g2=1.000 | |
| 188 | + shapecode_1_b2=1.000 | |
| 189 | + shapecode_1_a2=0.000 | |
| 190 | + shapecode_1_border_r=1.000 | |
| 191 | + shapecode_1_border_g=1.000 | |
| 192 | + shapecode_1_border_b=1.000 | |
| 193 | + shapecode_1_border_a=0.000 | |
| 194 | + shape_1_init1=fran = 1; | |
| 195 | + shape_1_init2=xs = 1; | |
| 196 | + shape_1_init3=ys = 1; | |
| 197 | + shape_1_init4=xm = 0.5; | |
| 198 | + shape_1_init5=ym = 0.5; | |
| 199 | + shape_1_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 200 | + shape_1_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 201 | + shape_1_per_frame3= | |
| 202 | + shape_1_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.6 + 0.4*cos(time*0.62)); | |
| 203 | + shape_1_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.7 + 0.3*cos(time*0.78)); | |
| 204 | + shape_1_per_frame6= | |
| 205 | + shape_1_per_frame7=x = xm; | |
| 206 | + shape_1_per_frame8=y = ym; | |
| 207 | + shape_1_per_frame9= | |
| 208 | + shape_1_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 209 | + shape_1_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 210 | + shape_1_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 211 | + shape_1_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 212 | + shape_1_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 213 | + shapecode_2_enabled=0 | |
| 214 | + shapecode_2_sides=44 | |
| 215 | + shapecode_2_additive=0 | |
| 216 | + shapecode_2_thickOutline=0 | |
| 217 | + shapecode_2_textured=0 | |
| 218 | + shapecode_2_num_inst=1 | |
| 219 | + shapecode_2_x=0.500 | |
| 220 | + shapecode_2_y=0.500 | |
| 221 | + shapecode_2_rad=0.03347 | |
| 222 | + shapecode_2_ang=0.00000 | |
| 223 | + shapecode_2_tex_ang=0.00000 | |
| 224 | + shapecode_2_tex_zoom=1.00000 | |
| 225 | + shapecode_2_r=1.000 | |
| 226 | + shapecode_2_g=1.000 | |
| 227 | + shapecode_2_b=1.000 | |
| 228 | + shapecode_2_a=1.000 | |
| 229 | + shapecode_2_r2=1.000 | |
| 230 | + shapecode_2_g2=1.000 | |
| 231 | + shapecode_2_b2=1.000 | |
| 232 | + shapecode_2_a2=0.000 | |
| 233 | + shapecode_2_border_r=1.000 | |
| 234 | + shapecode_2_border_g=1.000 | |
| 235 | + shapecode_2_border_b=1.000 | |
| 236 | + shapecode_2_border_a=0.000 | |
| 237 | + shape_2_init1=fran = 1; | |
| 238 | + shape_2_init2=xs = 1; | |
| 239 | + shape_2_init3=ys = 1; | |
| 240 | + shape_2_init4=xm = 0.5; | |
| 241 | + shape_2_init5=ym = 0.5; | |
| 242 | + shape_2_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 243 | + shape_2_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 244 | + shape_2_per_frame3= | |
| 245 | + shape_2_per_frame4=xm = xm + 0.03*xs*(sin(time*0.35)*0.5 + 0.5*cos(time*0.87)); | |
| 246 | + shape_2_per_frame5=ym = ym + 0.03*ys*(sin(time*0.92)*0.3 + 0.7*cos(time*0.26)); | |
| 247 | + shape_2_per_frame6= | |
| 248 | + shape_2_per_frame7=x = xm; | |
| 249 | + shape_2_per_frame8=y = ym; | |
| 250 | + shape_2_per_frame9= | |
| 251 | + shape_2_per_frame10=r = 0.5 + 0.5*sin(time*0.25); | |
| 252 | + shape_2_per_frame11=g = 0.5 + abs(r)*sin(time*0.5); | |
| 253 | + shape_2_per_frame12=b = 0.5 + abs(g)*sin(time); | |
| 254 | + shape_2_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 255 | + shape_2_per_frame14=rad = 1.6*(bass_att + mid_att + treb_att)/3; | |
| 256 | + shapecode_3_enabled=0 | |
| 257 | + shapecode_3_sides=4 | |
| 258 | + shapecode_3_additive=0 | |
| 259 | + shapecode_3_thickOutline=0 | |
| 260 | + shapecode_3_textured=0 | |
| 261 | + shapecode_3_num_inst=1 | |
| 262 | + shapecode_3_x=0.500 | |
| 263 | + shapecode_3_y=0.500 | |
| 264 | + shapecode_3_rad=0.10000 | |
| 265 | + shapecode_3_ang=0.00000 | |
| 266 | + shapecode_3_tex_ang=0.00000 | |
| 267 | + shapecode_3_tex_zoom=1.00000 | |
| 268 | + shapecode_3_r=1.000 | |
| 269 | + shapecode_3_g=0.000 | |
| 270 | + shapecode_3_b=0.000 | |
| 271 | + shapecode_3_a=1.000 | |
| 272 | + shapecode_3_r2=0.000 | |
| 273 | + shapecode_3_g2=1.000 | |
| 274 | + shapecode_3_b2=0.000 | |
| 275 | + shapecode_3_a2=0.000 | |
| 276 | + shapecode_3_border_r=1.000 | |
| 277 | + shapecode_3_border_g=1.000 | |
| 278 | + shapecode_3_border_b=1.000 | |
| 279 | + shapecode_3_border_a=0.100 | |
| 280 | + per_frame_1=wave_r = wave_r + 0.700*( 0.20*sin(0.933*time) + 0.30*sin(1.045*time) ); | |
| 281 | + per_frame_2=wave_g = wave_g + 0.700*( 0.20*sin(0.900*time) + 0.30*sin(0.956*time) ); | |
| 282 | + per_frame_3=wave_b = wave_b + 0.200*( 0.20*sin(0.910*time) + 0.30*sin(0.920*time) ); | |
| 283 | + per_frame_4= | |
| 284 | + per_frame_5=zoom = zoom + 0.02*cos(time*1.713+2); | |
| 285 | + per_frame_6=zoom = zoom + 0.02*cos(time*2.319+4); | |
| 286 | + per_frame_7=zoom = zoom + 0.02*cos(time*1.522+1); | |
| 287 | + per_pixel_1=dx= 0.002*cos(ang+1.57); | |
| 288 | + per_pixel_2=dy=-0.002*sin(ang+1.57); | |
| 289 | + warp_1=`shader_body | |
| 290 | + warp_2=`{ | |
| 291 | + warp_3=` // sample previous frame | |
| 292 | + warp_4=` ret = tex2D( sampler_main, uv ).xyz; | |
| 293 | + warp_5=` | |
| 294 | + warp_6=` // take the difference between the crisp and blurred images, | |
| 295 | + warp_7=` // then add it back into the image. Creates spots and stripes over time. | |
| 296 | + warp_8=` ret += (ret - GetBlur2(uv))*0.3; | |
| 297 | + warp_9=` ret *= 0.9; | |
| 298 | + warp_10=` | |
| 299 | + warp_11=` // add noise: | |
| 300 | + warp_12=` float2 dither_uv = uv_orig*texsize.xy*texsize_noise_lq.zw * 0.4 + rand_frame.xy; | |
| 301 | + warp_13=` ret += (tex2D(sampler_noise_lq, dither_uv).xyz-0.5)/256.0 * 112; | |
| 302 | + warp_14=` | |
| 303 | + warp_15=` // desaturate over time, to keep the globs white | |
| 304 | + warp_16=` //ret = lerp(ret, lum(ret), 0.2); | |
| 305 | + warp_17=`} | |
| 306 | + comp_1=`shader_body | |
| 307 | + comp_2=`{ | |
| 308 | + comp_3=` float rad_lq = rad * length(texsize.xy)*0.5; | |
| 309 | + comp_4=` float ang_lq = ang; | |
| 310 | + comp_5=` float2 uv_temp1 = (uv - 0.5) * texsize.xy; | |
| 311 | + comp_6=` float rad_hq = length(uv_temp1); | |
| 312 | + comp_7=` float ang_hq = atan2(-uv_temp1.y, uv_temp1.x); | |
| 313 | + comp_8=` | |
| 314 | + comp_9=` float2 uv2 = (uv - 0.5); | |
| 315 | + comp_10=` float rad2 = rad_lq*0.8; | |
| 316 | + comp_11=` float ang2 = ang_lq * M_INV_PI_2; | |
| 317 | + comp_12=` | |
| 318 | + comp_13=` // ROTATION OVER TIME | |
| 319 | + comp_14=` #if 1 | |
| 320 | + comp_15=` ang2 += time*0.025; //rotate over time | |
| 321 | + comp_16=` #endif | |
| 322 | + comp_17=` | |
| 323 | + comp_18=` // FIN TYPE | |
| 324 | + comp_19=` float fins = 3 + floor(rand_preset.z*5.95); | |
| 325 | + comp_20=` #if 1 // SHARP FINS | |
| 326 | + comp_21=` ang2 = frac(ang2*fins)/fins; | |
| 327 | + comp_22=` // ENABLE THIS TO MAKE THE FINS ALTERNATE: (seamless!) | |
| 328 | + comp_23=` ang2 = abs(ang2 - 0.5/fins); | |
| 329 | + comp_24=` #else // COSINE FINS - a bit slow | |
| 330 | + comp_25=` ang2 = cos(ang2*M_PI_2*fins) * 0.023; | |
| 331 | + comp_26=` #endif | |
| 332 | + comp_27=` | |
| 333 | + comp_28=` // RADIAL KALEIDOSCOPING? | |
| 334 | + comp_29=` #if 0 | |
| 335 | + comp_30=` rad2 *= g_fTexSize.z; | |
| 336 | + comp_31=` // choose one: | |
| 337 | + comp_32=` //rad2 = lerp(rad2, frac(rad2*3)/3.0, 0.5); | |
| 338 | + comp_33=` rad2 = cos(rad2*5); | |
| 339 | + comp_34=` //rad2 = sqrt(rad2)*0.5; | |
| 340 | + comp_35=` //rad2 += abs(frac(rad2*7)-0.5)/7.0 * 1.15; // stepifier | |
| 341 | + comp_36=` //rad2 += cos(rad2*61)*0.02; | |
| 342 | + comp_37=` rad2 *= g_fTexSize.x; | |
| 343 | + comp_38=` #endif | |
| 344 | + comp_39=` | |
| 345 | + comp_40=` ang2 *= M_PI_2; | |
| 346 | + comp_41=` uv2 = 0.5 + rad2*float2(cos(ang2),sin(ang2))*texsize.zw; | |
| 347 | + comp_42=` | |
| 348 | + comp_43=` ret = tex2D(sampler_main, uv2).xyz; | |
| 349 | + comp_44=` ret *= 1.333; // a little bit of overbright | |
| 350 | + comp_45=`} |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Blobby Mirror/AdamFX 2 Geiss - Mash-Up Sphere Xibit Graffiti Warp me Tydye3.milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=2 | |
| 3 | + PSVERSION_WARP=2 | |
| 4 | + PSVERSION_COMP=2 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.900 | |
| 8 | + fDecay=0.980 | |
| 9 | + fVideoEchoZoom=1.169 | |
| 10 | + fVideoEchoAlpha=0.000 | |
| 11 | + nVideoEchoOrientation=0 | |
| 12 | + nWaveMode=6 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=1 | |
| 16 | + bModWaveAlphaByVolume=0 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=1 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=0 | |
| 22 | + bDarken=0 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=4.100 | |
| 26 | + fWaveScale=0.010 | |
| 27 | + fWaveSmoothing=0.900 | |
| 28 | + fWaveParam=0.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=2.853 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=1.04000 | |
| 36 | + rot=0.00000 | |
| 37 | + cx=0.500 | |
| 38 | + cy=0.500 | |
| 39 | + dx=0.03000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.47402 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.010 | |
| 50 | + ob_r=0.000 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.000 | |
| 54 | + ib_size=0.010 | |
| 55 | + ib_r=0.250 | |
| 56 | + ib_g=0.250 | |
| 57 | + ib_b=0.250 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=0 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=0 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=1.000 | |
| 85 | + wavecode_0_g=1.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=1.000 | |
| 88 | + wavecode_1_enabled=0 | |
| 89 | + wavecode_1_samples=512 | |
| 90 | + wavecode_1_sep=0 | |
| 91 | + wavecode_1_bSpectrum=0 | |
| 92 | + wavecode_1_bUseDots=0 | |
| 93 | + wavecode_1_bDrawThick=0 | |
| 94 | + wavecode_1_bAdditive=0 | |
| 95 | + wavecode_1_scaling=1.00000 | |
| 96 | + wavecode_1_smoothing=0.50000 | |
| 97 | + wavecode_1_r=1.000 | |
| 98 | + wavecode_1_g=1.000 | |
| 99 | + wavecode_1_b=1.000 | |
| 100 | + wavecode_1_a=1.000 | |
| 101 | + wavecode_2_enabled=0 | |
| 102 | + wavecode_2_samples=512 | |
| 103 | + wavecode_2_sep=0 | |
| 104 | + wavecode_2_bSpectrum=0 | |
| 105 | + wavecode_2_bUseDots=0 | |
| 106 | + wavecode_2_bDrawThick=0 | |
| 107 | + wavecode_2_bAdditive=0 | |
| 108 | + wavecode_2_scaling=1.00000 | |
| 109 | + wavecode_2_smoothing=0.50000 | |
| 110 | + wavecode_2_r=1.000 | |
| 111 | + wavecode_2_g=1.000 | |
| 112 | + wavecode_2_b=1.000 | |
| 113 | + wavecode_2_a=1.000 | |
| 114 | + wavecode_3_enabled=0 | |
| 115 | + wavecode_3_samples=512 | |
| 116 | + wavecode_3_sep=0 | |
| 117 | + wavecode_3_bSpectrum=0 | |
| 118 | + wavecode_3_bUseDots=0 | |
| 119 | + wavecode_3_bDrawThick=0 | |
| 120 | + wavecode_3_bAdditive=0 | |
| 121 | + wavecode_3_scaling=1.00000 | |
| 122 | + wavecode_3_smoothing=0.50000 | |
| 123 | + wavecode_3_r=1.000 | |
| 124 | + wavecode_3_g=1.000 | |
| 125 | + wavecode_3_b=1.000 | |
| 126 | + wavecode_3_a=1.000 | |
| 127 | + shapecode_0_enabled=1 | |
| 128 | + shapecode_0_sides=44 | |
| 129 | + shapecode_0_additive=0 | |
| 130 | + shapecode_0_thickOutline=0 | |
| 131 | + shapecode_0_textured=0 | |
| 132 | + shapecode_0_num_inst=1 | |
| 133 | + shapecode_0_x=0.500 | |
| 134 | + shapecode_0_y=0.500 | |
| 135 | + shapecode_0_rad=0.03347 | |
| 136 | + shapecode_0_ang=0.00000 | |
| 137 | + shapecode_0_tex_ang=0.00000 | |
| 138 | + shapecode_0_tex_zoom=1.00000 | |
| 139 | + shapecode_0_r=1.000 | |
| 140 | + shapecode_0_g=1.000 | |
| 141 | + shapecode_0_b=1.000 | |
| 142 | + shapecode_0_a=1.000 | |
| 143 | + shapecode_0_r2=1.000 | |
| 144 | + shapecode_0_g2=1.000 | |
| 145 | + shapecode_0_b2=1.000 | |
| 146 | + shapecode_0_a2=0.000 | |
| 147 | + shapecode_0_border_r=1.000 | |
| 148 | + shapecode_0_border_g=1.000 | |
| 149 | + shapecode_0_border_b=1.000 | |
| 150 | + shapecode_0_border_a=0.000 | |
| 151 | + shape_0_init1=fran = 1; | |
| 152 | + shape_0_init2=xs = 1; | |
| 153 | + shape_0_init3=ys = 1; | |
| 154 | + shape_0_init4=xm = 0.5; | |
| 155 | + shape_0_init5=ym = 0.5; | |
| 156 | + shape_0_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 157 | + shape_0_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 158 | + shape_0_per_frame3= | |
| 159 | + shape_0_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.4 + 0.6*cos(time*0.62)); | |
| 160 | + shape_0_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.5 + 0.5*cos(time*0.78)); | |
| 161 | + shape_0_per_frame6= | |
| 162 | + shape_0_per_frame7=x = xm; | |
| 163 | + shape_0_per_frame8=y = ym; | |
| 164 | + shape_0_per_frame9= | |
| 165 | + shape_0_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 166 | + shape_0_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 167 | + shape_0_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 168 | + shape_0_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 169 | + shape_0_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 170 | + shapecode_1_enabled=1 | |
| 171 | + shapecode_1_sides=44 | |
| 172 | + shapecode_1_additive=0 | |
| 173 | + shapecode_1_thickOutline=0 | |
| 174 | + shapecode_1_textured=0 | |
| 175 | + shapecode_1_num_inst=1 | |
| 176 | + shapecode_1_x=0.500 | |
| 177 | + shapecode_1_y=0.500 | |
| 178 | + shapecode_1_rad=0.03347 | |
| 179 | + shapecode_1_ang=0.00000 | |
| 180 | + shapecode_1_tex_ang=0.00000 | |
| 181 | + shapecode_1_tex_zoom=1.00000 | |
| 182 | + shapecode_1_r=1.000 | |
| 183 | + shapecode_1_g=1.000 | |
| 184 | + shapecode_1_b=1.000 | |
| 185 | + shapecode_1_a=1.000 | |
| 186 | + shapecode_1_r2=1.000 | |
| 187 | + shapecode_1_g2=1.000 | |
| 188 | + shapecode_1_b2=1.000 | |
| 189 | + shapecode_1_a2=0.000 | |
| 190 | + shapecode_1_border_r=1.000 | |
| 191 | + shapecode_1_border_g=1.000 | |
| 192 | + shapecode_1_border_b=1.000 | |
| 193 | + shapecode_1_border_a=0.000 | |
| 194 | + shape_1_init1=fran = 1; | |
| 195 | + shape_1_init2=xs = 1; | |
| 196 | + shape_1_init3=ys = 1; | |
| 197 | + shape_1_init4=xm = 0.5; | |
| 198 | + shape_1_init5=ym = 0.5; | |
| 199 | + shape_1_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 200 | + shape_1_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 201 | + shape_1_per_frame3= | |
| 202 | + shape_1_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.6 + 0.4*cos(time*0.62)); | |
| 203 | + shape_1_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.7 + 0.3*cos(time*0.78)); | |
| 204 | + shape_1_per_frame6= | |
| 205 | + shape_1_per_frame7=x = xm; | |
| 206 | + shape_1_per_frame8=y = ym; | |
| 207 | + shape_1_per_frame9= | |
| 208 | + shape_1_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 209 | + shape_1_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 210 | + shape_1_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 211 | + shape_1_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 212 | + shape_1_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 213 | + shapecode_2_enabled=0 | |
| 214 | + shapecode_2_sides=44 | |
| 215 | + shapecode_2_additive=0 | |
| 216 | + shapecode_2_thickOutline=0 | |
| 217 | + shapecode_2_textured=0 | |
| 218 | + shapecode_2_num_inst=1 | |
| 219 | + shapecode_2_x=0.500 | |
| 220 | + shapecode_2_y=0.500 | |
| 221 | + shapecode_2_rad=0.03347 | |
| 222 | + shapecode_2_ang=0.00000 | |
| 223 | + shapecode_2_tex_ang=0.00000 | |
| 224 | + shapecode_2_tex_zoom=1.00000 | |
| 225 | + shapecode_2_r=1.000 | |
| 226 | + shapecode_2_g=1.000 | |
| 227 | + shapecode_2_b=1.000 | |
| 228 | + shapecode_2_a=1.000 | |
| 229 | + shapecode_2_r2=1.000 | |
| 230 | + shapecode_2_g2=1.000 | |
| 231 | + shapecode_2_b2=1.000 | |
| 232 | + shapecode_2_a2=0.000 | |
| 233 | + shapecode_2_border_r=1.000 | |
| 234 | + shapecode_2_border_g=1.000 | |
| 235 | + shapecode_2_border_b=1.000 | |
| 236 | + shapecode_2_border_a=0.000 | |
| 237 | + shape_2_init1=fran = 1; | |
| 238 | + shape_2_init2=xs = 1; | |
| 239 | + shape_2_init3=ys = 1; | |
| 240 | + shape_2_init4=xm = 0.5; | |
| 241 | + shape_2_init5=ym = 0.5; | |
| 242 | + shape_2_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 243 | + shape_2_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 244 | + shape_2_per_frame3= | |
| 245 | + shape_2_per_frame4=xm = xm + 0.03*xs*(sin(time*0.35)*0.5 + 0.5*cos(time*0.87)); | |
| 246 | + shape_2_per_frame5=ym = ym + 0.03*ys*(sin(time*0.92)*0.3 + 0.7*cos(time*0.26)); | |
| 247 | + shape_2_per_frame6= | |
| 248 | + shape_2_per_frame7=x = xm; | |
| 249 | + shape_2_per_frame8=y = ym; | |
| 250 | + shape_2_per_frame9= | |
| 251 | + shape_2_per_frame10=r = 0.5 + 0.5*sin(time*0.25); | |
| 252 | + shape_2_per_frame11=g = 0.5 + abs(r)*sin(time*0.5); | |
| 253 | + shape_2_per_frame12=b = 0.5 + abs(g)*sin(time); | |
| 254 | + shape_2_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 255 | + shape_2_per_frame14=rad = 1.6*(bass_att + mid_att + treb_att)/3; | |
| 256 | + shapecode_3_enabled=0 | |
| 257 | + shapecode_3_sides=4 | |
| 258 | + shapecode_3_additive=0 | |
| 259 | + shapecode_3_thickOutline=0 | |
| 260 | + shapecode_3_textured=0 | |
| 261 | + shapecode_3_num_inst=1 | |
| 262 | + shapecode_3_x=0.500 | |
| 263 | + shapecode_3_y=0.500 | |
| 264 | + shapecode_3_rad=0.10000 | |
| 265 | + shapecode_3_ang=0.00000 | |
| 266 | + shapecode_3_tex_ang=0.00000 | |
| 267 | + shapecode_3_tex_zoom=1.00000 | |
| 268 | + shapecode_3_r=1.000 | |
| 269 | + shapecode_3_g=0.000 | |
| 270 | + shapecode_3_b=0.000 | |
| 271 | + shapecode_3_a=1.000 | |
| 272 | + shapecode_3_r2=0.000 | |
| 273 | + shapecode_3_g2=1.000 | |
| 274 | + shapecode_3_b2=0.000 | |
| 275 | + shapecode_3_a2=0.000 | |
| 276 | + shapecode_3_border_r=1.000 | |
| 277 | + shapecode_3_border_g=1.000 | |
| 278 | + shapecode_3_border_b=1.000 | |
| 279 | + shapecode_3_border_a=0.100 | |
| 280 | + per_frame_1=wave_r = wave_r + 0.700*( 0.20*sin(0.933*time) + 0.30*sin(1.045*time) ); | |
| 281 | + per_frame_2=wave_g = wave_g + 0.700*( 0.20*sin(0.900*time) + 0.30*sin(0.956*time) ); | |
| 282 | + per_frame_3=wave_b = wave_b + 0.200*( 0.20*sin(0.910*time) + 0.30*sin(0.920*time) ); | |
| 283 | + per_frame_4= | |
| 284 | + per_frame_5=zoom = zoom + 0.02*cos(time*1.713+2); | |
| 285 | + per_frame_6=zoom = zoom + 0.02*cos(time*2.319+4); | |
| 286 | + per_frame_7=zoom = zoom + 0.02*cos(time*1.522+1); | |
| 287 | + per_pixel_1=dx= 0.002*cos(ang+1.57); | |
| 288 | + per_pixel_2=dy=-0.002*sin(ang+1.57); | |
| 289 | + warp_1=`shader_body | |
| 290 | + warp_2=`{ | |
| 291 | + warp_3=` float2 uv2 = uv; | |
| 292 | + warp_4=` | |
| 293 | + warp_5=` // diffused version: | |
| 294 | + warp_6=` float ss = 0.1; | |
| 295 | + warp_7=` float3 blur = 0.25*( | |
| 296 | + warp_8=` tex2D(sampler_main, uv2+ss*texsize.zw*float2( 1, 1)).xyz + | |
| 297 | + warp_9=` tex2D(sampler_main, uv2+ss*texsize.zw*float2(-1, 1)).xyz + | |
| 298 | + warp_10=` tex2D(sampler_main, uv2+ss*texsize.zw*float2( 1,-1)).xyz + | |
| 299 | + warp_11=` tex2D(sampler_main, uv2+ss*texsize.zw*float2(-1,-1)).xyz | |
| 300 | + warp_12=` ); | |
| 301 | + warp_13=` | |
| 302 | + warp_14=` // diffusion: | |
| 303 | + warp_15=` ret = blur; | |
| 304 | + warp_16=` | |
| 305 | + warp_17=` float F2 = 0.035; | |
| 306 | + warp_18=` float k2 = 0.060; | |
| 307 | + warp_19=` float s = 0.025; | |
| 308 | + warp_20=` float scale = 4; | |
| 309 | + warp_21=` | |
| 310 | + warp_22=` // reaction: | |
| 311 | + warp_23=` float3 z = ret; | |
| 312 | + warp_24=` float uvv = ret.x*ret.y*ret.y; | |
| 313 | + warp_25=` z.x += (-uvv + F2*(1-ret.x))*scale; | |
| 314 | + warp_26=` z.y += (uvv - (F2+k2)*ret.y)*scale; | |
| 315 | + warp_27=` //z.x += s*(16-ret.x*ret.y); | |
| 316 | + warp_28=` //z.y += s*(ret.x*ret.y - ret.y - ret.z); | |
| 317 | + warp_29=` z.z += 0; | |
| 318 | + warp_30=` | |
| 319 | + warp_31=` // apply laplacian: | |
| 320 | + warp_32=` z.x += (GetBlur1(uv2) - GetPixel(uv2))*0.1*scale; | |
| 321 | + warp_33=` | |
| 322 | + warp_34=` ret = z; | |
| 323 | + warp_35=` | |
| 324 | + warp_36=` // add noise: | |
| 325 | + warp_37=` ret += 0.05*(tex2d(sampler_noise_lq, uv*texsize.xy*texsize_noise_lq.zw + rand_frame.xy).xyz*2-1); | |
| 326 | + warp_38=` | |
| 327 | + warp_39=` // darken (decay) over time | |
| 328 | + warp_40=` //ret = (ret - 0.002)*0.99; | |
| 329 | + warp_41=`} | |
| 330 | + comp_1=`shader_body | |
| 331 | + comp_2=`{ | |
| 332 | + comp_3=` float rad_lq = rad * length(texsize.xy)*0.5; | |
| 333 | + comp_4=` float ang_lq = ang; | |
| 334 | + comp_5=` float2 uv_temp1 = (uv - 0.5) * texsize.xy; | |
| 335 | + comp_6=` float rad_hq = length(uv_temp1); | |
| 336 | + comp_7=` float ang_hq = atan2(-uv_temp1.y, uv_temp1.x); | |
| 337 | + comp_8=` | |
| 338 | + comp_9=` float2 uv2 = (uv - 0.5); | |
| 339 | + comp_10=` float rad2 = rad_lq*0.8; | |
| 340 | + comp_11=` float ang2 = ang_lq * M_INV_PI_2; | |
| 341 | + comp_12=` | |
| 342 | + comp_13=` // ROTATION OVER TIME | |
| 343 | + comp_14=` #if 1 | |
| 344 | + comp_15=` ang2 += time*0.025; //rotate over time | |
| 345 | + comp_16=` #endif | |
| 346 | + comp_17=` | |
| 347 | + comp_18=` // FIN TYPE | |
| 348 | + comp_19=` float fins = 3 + floor(rand_preset.z*5.95); | |
| 349 | + comp_20=` #if 1 // SHARP FINS | |
| 350 | + comp_21=` ang2 = frac(ang2*fins)/fins; | |
| 351 | + comp_22=` // ENABLE THIS TO MAKE THE FINS ALTERNATE: (seamless!) | |
| 352 | + comp_23=` ang2 = abs(ang2 - 0.5/fins); | |
| 353 | + comp_24=` #else // COSINE FINS - a bit slow | |
| 354 | + comp_25=` ang2 = cos(ang2*M_PI_2*fins) * 0.023; | |
| 355 | + comp_26=` #endif | |
| 356 | + comp_27=` | |
| 357 | + comp_28=` // RADIAL KALEIDOSCOPING? | |
| 358 | + comp_29=` #if 0 | |
| 359 | + comp_30=` rad2 *= g_fTexSize.z; | |
| 360 | + comp_31=` // choose one: | |
| 361 | + comp_32=` //rad2 = lerp(rad2, frac(rad2*3)/3.0, 0.5); | |
| 362 | + comp_33=` rad2 = cos(rad2*5); | |
| 363 | + comp_34=` //rad2 = sqrt(rad2)*0.5; | |
| 364 | + comp_35=` //rad2 += abs(frac(rad2*7)-0.5)/7.0 * 1.15; // stepifier | |
| 365 | + comp_36=` //rad2 += cos(rad2*61)*0.02; | |
| 366 | + comp_37=` rad2 *= g_fTexSize.x; | |
| 367 | + comp_38=` #endif | |
| 368 | + comp_39=` | |
| 369 | + comp_40=` ang2 *= M_PI_2; | |
| 370 | + comp_41=` uv2 = 0.5 + rad2*float2(cos(ang2),sin(ang2))*texsize.zw; | |
| 371 | + comp_42=` | |
| 372 | + comp_43=` ret = tex2D(sampler_main, uv2).xyz; | |
| 373 | + comp_44=` ret *= 1.333; // a little bit of overbright | |
| 374 | + comp_45=`} |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Blobby Mirror/AdamFX 2 Geiss - Mash-Up Sphere Xibit Graffiti Warp me Tydye5.milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=2 | |
| 3 | + PSVERSION_WARP=2 | |
| 4 | + PSVERSION_COMP=2 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.900 | |
| 8 | + fDecay=0.980 | |
| 9 | + fVideoEchoZoom=1.169 | |
| 10 | + fVideoEchoAlpha=0.000 | |
| 11 | + nVideoEchoOrientation=0 | |
| 12 | + nWaveMode=6 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=1 | |
| 16 | + bModWaveAlphaByVolume=0 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=1 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=0 | |
| 22 | + bDarken=0 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=4.100 | |
| 26 | + fWaveScale=0.010 | |
| 27 | + fWaveSmoothing=0.900 | |
| 28 | + fWaveParam=0.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=2.853 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=1.04000 | |
| 36 | + rot=0.00000 | |
| 37 | + cx=0.500 | |
| 38 | + cy=0.500 | |
| 39 | + dx=0.03000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.47402 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.010 | |
| 50 | + ob_r=0.000 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.000 | |
| 54 | + ib_size=0.010 | |
| 55 | + ib_r=0.250 | |
| 56 | + ib_g=0.250 | |
| 57 | + ib_b=0.250 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=0 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=0 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=1.000 | |
| 85 | + wavecode_0_g=1.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=1.000 | |
| 88 | + wavecode_1_enabled=0 | |
| 89 | + wavecode_1_samples=512 | |
| 90 | + wavecode_1_sep=0 | |
| 91 | + wavecode_1_bSpectrum=0 | |
| 92 | + wavecode_1_bUseDots=0 | |
| 93 | + wavecode_1_bDrawThick=0 | |
| 94 | + wavecode_1_bAdditive=0 | |
| 95 | + wavecode_1_scaling=1.00000 | |
| 96 | + wavecode_1_smoothing=0.50000 | |
| 97 | + wavecode_1_r=1.000 | |
| 98 | + wavecode_1_g=1.000 | |
| 99 | + wavecode_1_b=1.000 | |
| 100 | + wavecode_1_a=1.000 | |
| 101 | + wavecode_2_enabled=0 | |
| 102 | + wavecode_2_samples=512 | |
| 103 | + wavecode_2_sep=0 | |
| 104 | + wavecode_2_bSpectrum=0 | |
| 105 | + wavecode_2_bUseDots=0 | |
| 106 | + wavecode_2_bDrawThick=0 | |
| 107 | + wavecode_2_bAdditive=0 | |
| 108 | + wavecode_2_scaling=1.00000 | |
| 109 | + wavecode_2_smoothing=0.50000 | |
| 110 | + wavecode_2_r=1.000 | |
| 111 | + wavecode_2_g=1.000 | |
| 112 | + wavecode_2_b=1.000 | |
| 113 | + wavecode_2_a=1.000 | |
| 114 | + wavecode_3_enabled=0 | |
| 115 | + wavecode_3_samples=512 | |
| 116 | + wavecode_3_sep=0 | |
| 117 | + wavecode_3_bSpectrum=0 | |
| 118 | + wavecode_3_bUseDots=0 | |
| 119 | + wavecode_3_bDrawThick=0 | |
| 120 | + wavecode_3_bAdditive=0 | |
| 121 | + wavecode_3_scaling=1.00000 | |
| 122 | + wavecode_3_smoothing=0.50000 | |
| 123 | + wavecode_3_r=1.000 | |
| 124 | + wavecode_3_g=1.000 | |
| 125 | + wavecode_3_b=1.000 | |
| 126 | + wavecode_3_a=1.000 | |
| 127 | + shapecode_0_enabled=1 | |
| 128 | + shapecode_0_sides=44 | |
| 129 | + shapecode_0_additive=0 | |
| 130 | + shapecode_0_thickOutline=0 | |
| 131 | + shapecode_0_textured=0 | |
| 132 | + shapecode_0_num_inst=1 | |
| 133 | + shapecode_0_x=0.500 | |
| 134 | + shapecode_0_y=0.500 | |
| 135 | + shapecode_0_rad=0.03347 | |
| 136 | + shapecode_0_ang=0.00000 | |
| 137 | + shapecode_0_tex_ang=0.00000 | |
| 138 | + shapecode_0_tex_zoom=1.00000 | |
| 139 | + shapecode_0_r=1.000 | |
| 140 | + shapecode_0_g=1.000 | |
| 141 | + shapecode_0_b=1.000 | |
| 142 | + shapecode_0_a=1.000 | |
| 143 | + shapecode_0_r2=1.000 | |
| 144 | + shapecode_0_g2=1.000 | |
| 145 | + shapecode_0_b2=1.000 | |
| 146 | + shapecode_0_a2=0.000 | |
| 147 | + shapecode_0_border_r=1.000 | |
| 148 | + shapecode_0_border_g=1.000 | |
| 149 | + shapecode_0_border_b=1.000 | |
| 150 | + shapecode_0_border_a=0.000 | |
| 151 | + shape_0_init1=fran = 1; | |
| 152 | + shape_0_init2=xs = 1; | |
| 153 | + shape_0_init3=ys = 1; | |
| 154 | + shape_0_init4=xm = 0.5; | |
| 155 | + shape_0_init5=ym = 0.5; | |
| 156 | + shape_0_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 157 | + shape_0_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 158 | + shape_0_per_frame3= | |
| 159 | + shape_0_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.4 + 0.6*cos(time*0.62)); | |
| 160 | + shape_0_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.5 + 0.5*cos(time*0.78)); | |
| 161 | + shape_0_per_frame6= | |
| 162 | + shape_0_per_frame7=x = xm; | |
| 163 | + shape_0_per_frame8=y = ym; | |
| 164 | + shape_0_per_frame9= | |
| 165 | + shape_0_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 166 | + shape_0_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 167 | + shape_0_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 168 | + shape_0_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 169 | + shape_0_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 170 | + shapecode_1_enabled=1 | |
| 171 | + shapecode_1_sides=44 | |
| 172 | + shapecode_1_additive=0 | |
| 173 | + shapecode_1_thickOutline=0 | |
| 174 | + shapecode_1_textured=0 | |
| 175 | + shapecode_1_num_inst=1 | |
| 176 | + shapecode_1_x=0.500 | |
| 177 | + shapecode_1_y=0.500 | |
| 178 | + shapecode_1_rad=0.03347 | |
| 179 | + shapecode_1_ang=0.00000 | |
| 180 | + shapecode_1_tex_ang=0.00000 | |
| 181 | + shapecode_1_tex_zoom=1.00000 | |
| 182 | + shapecode_1_r=1.000 | |
| 183 | + shapecode_1_g=1.000 | |
| 184 | + shapecode_1_b=1.000 | |
| 185 | + shapecode_1_a=1.000 | |
| 186 | + shapecode_1_r2=1.000 | |
| 187 | + shapecode_1_g2=1.000 | |
| 188 | + shapecode_1_b2=1.000 | |
| 189 | + shapecode_1_a2=0.000 | |
| 190 | + shapecode_1_border_r=1.000 | |
| 191 | + shapecode_1_border_g=1.000 | |
| 192 | + shapecode_1_border_b=1.000 | |
| 193 | + shapecode_1_border_a=0.000 | |
| 194 | + shape_1_init1=fran = 1; | |
| 195 | + shape_1_init2=xs = 1; | |
| 196 | + shape_1_init3=ys = 1; | |
| 197 | + shape_1_init4=xm = 0.5; | |
| 198 | + shape_1_init5=ym = 0.5; | |
| 199 | + shape_1_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 200 | + shape_1_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 201 | + shape_1_per_frame3= | |
| 202 | + shape_1_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.6 + 0.4*cos(time*0.62)); | |
| 203 | + shape_1_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.7 + 0.3*cos(time*0.78)); | |
| 204 | + shape_1_per_frame6= | |
| 205 | + shape_1_per_frame7=x = xm; | |
| 206 | + shape_1_per_frame8=y = ym; | |
| 207 | + shape_1_per_frame9= | |
| 208 | + shape_1_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 209 | + shape_1_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 210 | + shape_1_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 211 | + shape_1_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 212 | + shape_1_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 213 | + shapecode_2_enabled=0 | |
| 214 | + shapecode_2_sides=44 | |
| 215 | + shapecode_2_additive=0 | |
| 216 | + shapecode_2_thickOutline=0 | |
| 217 | + shapecode_2_textured=0 | |
| 218 | + shapecode_2_num_inst=1 | |
| 219 | + shapecode_2_x=0.500 | |
| 220 | + shapecode_2_y=0.500 | |
| 221 | + shapecode_2_rad=0.03347 | |
| 222 | + shapecode_2_ang=0.00000 | |
| 223 | + shapecode_2_tex_ang=0.00000 | |
| 224 | + shapecode_2_tex_zoom=1.00000 | |
| 225 | + shapecode_2_r=1.000 | |
| 226 | + shapecode_2_g=1.000 | |
| 227 | + shapecode_2_b=1.000 | |
| 228 | + shapecode_2_a=1.000 | |
| 229 | + shapecode_2_r2=1.000 | |
| 230 | + shapecode_2_g2=1.000 | |
| 231 | + shapecode_2_b2=1.000 | |
| 232 | + shapecode_2_a2=0.000 | |
| 233 | + shapecode_2_border_r=1.000 | |
| 234 | + shapecode_2_border_g=1.000 | |
| 235 | + shapecode_2_border_b=1.000 | |
| 236 | + shapecode_2_border_a=0.000 | |
| 237 | + shape_2_init1=fran = 1; | |
| 238 | + shape_2_init2=xs = 1; | |
| 239 | + shape_2_init3=ys = 1; | |
| 240 | + shape_2_init4=xm = 0.5; | |
| 241 | + shape_2_init5=ym = 0.5; | |
| 242 | + shape_2_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 243 | + shape_2_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 244 | + shape_2_per_frame3= | |
| 245 | + shape_2_per_frame4=xm = xm + 0.03*xs*(sin(time*0.35)*0.5 + 0.5*cos(time*0.87)); | |
| 246 | + shape_2_per_frame5=ym = ym + 0.03*ys*(sin(time*0.92)*0.3 + 0.7*cos(time*0.26)); | |
| 247 | + shape_2_per_frame6= | |
| 248 | + shape_2_per_frame7=x = xm; | |
| 249 | + shape_2_per_frame8=y = ym; | |
| 250 | + shape_2_per_frame9= | |
| 251 | + shape_2_per_frame10=r = 0.5 + 0.5*sin(time*0.25); | |
| 252 | + shape_2_per_frame11=g = 0.5 + abs(r)*sin(time*0.5); | |
| 253 | + shape_2_per_frame12=b = 0.5 + abs(g)*sin(time); | |
| 254 | + shape_2_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 255 | + shape_2_per_frame14=rad = 1.6*(bass_att + mid_att + treb_att)/3; | |
| 256 | + shapecode_3_enabled=0 | |
| 257 | + shapecode_3_sides=4 | |
| 258 | + shapecode_3_additive=0 | |
| 259 | + shapecode_3_thickOutline=0 | |
| 260 | + shapecode_3_textured=0 | |
| 261 | + shapecode_3_num_inst=1 | |
| 262 | + shapecode_3_x=0.500 | |
| 263 | + shapecode_3_y=0.500 | |
| 264 | + shapecode_3_rad=0.10000 | |
| 265 | + shapecode_3_ang=0.00000 | |
| 266 | + shapecode_3_tex_ang=0.00000 | |
| 267 | + shapecode_3_tex_zoom=1.00000 | |
| 268 | + shapecode_3_r=1.000 | |
| 269 | + shapecode_3_g=0.000 | |
| 270 | + shapecode_3_b=0.000 | |
| 271 | + shapecode_3_a=1.000 | |
| 272 | + shapecode_3_r2=0.000 | |
| 273 | + shapecode_3_g2=1.000 | |
| 274 | + shapecode_3_b2=0.000 | |
| 275 | + shapecode_3_a2=0.000 | |
| 276 | + shapecode_3_border_r=1.000 | |
| 277 | + shapecode_3_border_g=1.000 | |
| 278 | + shapecode_3_border_b=1.000 | |
| 279 | + shapecode_3_border_a=0.100 | |
| 280 | + per_frame_1=wave_r = wave_r + 0.700*( 0.20*sin(0.933*time) + 0.30*sin(1.045*time) ); | |
| 281 | + per_frame_2=wave_g = wave_g + 0.700*( 0.20*sin(0.900*time) + 0.30*sin(0.956*time) ); | |
| 282 | + per_frame_3=wave_b = wave_b + 0.200*( 0.20*sin(0.910*time) + 0.30*sin(0.920*time) ); | |
| 283 | + per_frame_4= | |
| 284 | + per_frame_5=zoom = zoom + 0.02*cos(time*1.713+2); | |
| 285 | + per_frame_6=zoom = zoom + 0.02*cos(time*2.319+4); | |
| 286 | + per_frame_7=zoom = zoom + 0.02*cos(time*1.522+1); | |
| 287 | + per_pixel_1=dx= 0.002*cos(ang+1.57); | |
| 288 | + per_pixel_2=dy=-0.002*sin(ang+1.57); | |
| 289 | + warp_1=`shader_body | |
| 290 | + warp_2=`{ | |
| 291 | + warp_3=` float1 d = 0.005; | |
| 292 | + warp_4=` float1 dx = ( GetBlur2(uv + float2(d,0)) - GetBlur2(uv-float2(d,0)) ).y; | |
| 293 | + warp_5=` float1 dy = ( GetBlur2(uv + float2(0,d)) - GetBlur2(uv-float2(0,d)) ).y; | |
| 294 | + warp_6=` float2 my_uv = uv - float2(dx,dy)*0.01; | |
| 295 | + warp_7=` | |
| 296 | + warp_8=` | |
| 297 | + warp_9=` | |
| 298 | + warp_10=` float2 v = 0.01; | |
| 299 | + warp_11=` ret.y = tex2D( sampler_fc_main, my_uv-floor(my_uv)).y; | |
| 300 | + warp_12=` | |
| 301 | + warp_13=` | |
| 302 | + warp_14=` ret.y += (ret.y - GetBlur3(my_uv-floor(my_uv)).y)*.1; | |
| 303 | + warp_15=` ret.y += 0.006-GetBlur3(uv-floor(uv)).x*5; | |
| 304 | + warp_16=` | |
| 305 | + warp_17=` ret.y = lerp( ret.y, lum(ret).x, 0); | |
| 306 | + warp_18=` | |
| 307 | + warp_19=`//-------------------------------- | |
| 308 | + warp_20=` | |
| 309 | + warp_21=` d = 0.01; | |
| 310 | + warp_22=` my_uv = float2(-dy,dx)*0.05; | |
| 311 | + warp_23=` | |
| 312 | + warp_24=` dx = ( GetBlur2(uv + float2(d,0)) - GetBlur2(uv-float2(d,0)) ).z; | |
| 313 | + warp_25=` dy = ( GetBlur2(uv + float2(0,d)) - GetBlur2(uv-float2(0,d)) ).z; | |
| 314 | + warp_26=` my_uv += uv - float2(dx,dy)*0.005; | |
| 315 | + warp_27=` | |
| 316 | + warp_28=` | |
| 317 | + warp_29=` | |
| 318 | + warp_30=` v = 0.01; | |
| 319 | + warp_31=` ret.z =tex2D( sampler_fw_main, my_uv - floor(my_uv)).z; | |
| 320 | + warp_32=` | |
| 321 | + warp_33=` | |
| 322 | + warp_34=` ret.z += (ret.z - GetBlur3(my_uv-floor(my_uv)).z)*0.13; | |
| 323 | + warp_35=` ret.z *= 0.95; | |
| 324 | + warp_36=` ret.z += 0.03-GetBlur3(uv-floor(uv)).x - tex2D( sampler_main, my_uv - floor(my_uv)).y*0.05; | |
| 325 | + warp_37=` | |
| 326 | + warp_38=` ret.x = tex2D( sampler_main, uv_orig).x - 0.3; | |
| 327 | + warp_39=` | |
| 328 | + warp_40=`} | |
| 329 | + comp_1=`shader_body | |
| 330 | + comp_2=`{ | |
| 331 | + comp_3=` float rad_lq = rad * length(texsize.xy)*0.5; | |
| 332 | + comp_4=` float ang_lq = ang; | |
| 333 | + comp_5=` float2 uv_temp1 = (uv - 0.5) * texsize.xy; | |
| 334 | + comp_6=` float rad_hq = length(uv_temp1); | |
| 335 | + comp_7=` float ang_hq = atan2(-uv_temp1.y, uv_temp1.x); | |
| 336 | + comp_8=` | |
| 337 | + comp_9=` float2 uv2 = (uv - 0.5); | |
| 338 | + comp_10=` float rad2 = rad_lq*0.8; | |
| 339 | + comp_11=` float ang2 = ang_lq * M_INV_PI_2; | |
| 340 | + comp_12=` | |
| 341 | + comp_13=` // ROTATION OVER TIME | |
| 342 | + comp_14=` #if 1 | |
| 343 | + comp_15=` ang2 += time*0.025; //rotate over time | |
| 344 | + comp_16=` #endif | |
| 345 | + comp_17=` | |
| 346 | + comp_18=` // FIN TYPE | |
| 347 | + comp_19=` float fins = 3 + floor(rand_preset.z*5.95); | |
| 348 | + comp_20=` #if 1 // SHARP FINS | |
| 349 | + comp_21=` ang2 = frac(ang2*fins)/fins; | |
| 350 | + comp_22=` // ENABLE THIS TO MAKE THE FINS ALTERNATE: (seamless!) | |
| 351 | + comp_23=` ang2 = abs(ang2 - 0.5/fins); | |
| 352 | + comp_24=` #else // COSINE FINS - a bit slow | |
| 353 | + comp_25=` ang2 = cos(ang2*M_PI_2*fins) * 0.023; | |
| 354 | + comp_26=` #endif | |
| 355 | + comp_27=` | |
| 356 | + comp_28=` // RADIAL KALEIDOSCOPING? | |
| 357 | + comp_29=` #if 0 | |
| 358 | + comp_30=` rad2 *= g_fTexSize.z; | |
| 359 | + comp_31=` // choose one: | |
| 360 | + comp_32=` //rad2 = lerp(rad2, frac(rad2*3)/3.0, 0.5); | |
| 361 | + comp_33=` rad2 = cos(rad2*5); | |
| 362 | + comp_34=` //rad2 = sqrt(rad2)*0.5; | |
| 363 | + comp_35=` //rad2 += abs(frac(rad2*7)-0.5)/7.0 * 1.15; // stepifier | |
| 364 | + comp_36=` //rad2 += cos(rad2*61)*0.02; | |
| 365 | + comp_37=` rad2 *= g_fTexSize.x; | |
| 366 | + comp_38=` #endif | |
| 367 | + comp_39=` | |
| 368 | + comp_40=` ang2 *= M_PI_2; | |
| 369 | + comp_41=` uv2 = 0.5 + rad2*float2(cos(ang2),sin(ang2))*texsize.zw; | |
| 370 | + comp_42=` | |
| 371 | + comp_43=` ret = tex2D(sampler_main, uv2).xyz; | |
| 372 | + comp_44=` ret *= 1.333; // a little bit of overbright | |
| 373 | + comp_45=`} |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Blobby Mirror/Bdrv et AL Aderrasi - Accelerator (Orbital Migraine) bdvr xxx2_1 - mrt sth.milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=2 | |
| 3 | + PSVERSION_WARP=2 | |
| 4 | + PSVERSION_COMP=2 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.000 | |
| 8 | + fDecay=1.000 | |
| 9 | + fVideoEchoZoom=1.220 | |
| 10 | + fVideoEchoAlpha=0.000 | |
| 11 | + nVideoEchoOrientation=2 | |
| 12 | + nWaveMode=2 | |
| 13 | + bAdditiveWaves=0 | |
| 14 | + bWaveDots=1 | |
| 15 | + bWaveThick=0 | |
| 16 | + bModWaveAlphaByVolume=0 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=0 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=0 | |
| 22 | + bDarken=0 | |
| 23 | + bSolarize=1 | |
| 24 | + bInvert=1 | |
| 25 | + fWaveAlpha=11.202 | |
| 26 | + fWaveScale=0.976 | |
| 27 | + fWaveSmoothing=0.900 | |
| 28 | + fWaveParam=-0.500 | |
| 29 | + fModWaveAlphaStart=0.750 | |
| 30 | + fModWaveAlphaEnd=0.950 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=2.853 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=1.000 | |
| 35 | + zoom=1.00034 | |
| 36 | + rot=0.00000 | |
| 37 | + cx=0.500 | |
| 38 | + cy=0.500 | |
| 39 | + dx=0.00000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.00000 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.500 | |
| 45 | + wave_g=0.500 | |
| 46 | + wave_b=0.500 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.005 | |
| 50 | + ob_r=1.000 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.160 | |
| 54 | + ib_size=0.000 | |
| 55 | + ib_r=0.000 | |
| 56 | + ib_g=0.000 | |
| 57 | + ib_b=0.000 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=1 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=0 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=1.000 | |
| 85 | + wavecode_0_g=1.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=1.000 | |
| 88 | + wave_0_per_point1=x = .5 + (bass*.02)*sin(sample*2*(time*10)); | |
| 89 | + wave_0_per_point2=y = .5 + (bass*.02)*cos(sample*2*(time*10)); | |
| 90 | + wave_0_per_point3=r = 1 + .5*sin(sample*2+(time*10)); | |
| 91 | + wave_0_per_point4=g = 1 + .5*sin(sample*2+(time*50)); | |
| 92 | + wave_0_per_point5=b = 1 + .5*sin(sample*2+(time*20)); | |
| 93 | + wavecode_1_enabled=0 | |
| 94 | + wavecode_1_samples=512 | |
| 95 | + wavecode_1_sep=0 | |
| 96 | + wavecode_1_bSpectrum=0 | |
| 97 | + wavecode_1_bUseDots=0 | |
| 98 | + wavecode_1_bDrawThick=0 | |
| 99 | + wavecode_1_bAdditive=0 | |
| 100 | + wavecode_1_scaling=1.00000 | |
| 101 | + wavecode_1_smoothing=0.50000 | |
| 102 | + wavecode_1_r=1.000 | |
| 103 | + wavecode_1_g=1.000 | |
| 104 | + wavecode_1_b=1.000 | |
| 105 | + wavecode_1_a=1.000 | |
| 106 | + wavecode_2_enabled=0 | |
| 107 | + wavecode_2_samples=512 | |
| 108 | + wavecode_2_sep=0 | |
| 109 | + wavecode_2_bSpectrum=0 | |
| 110 | + wavecode_2_bUseDots=0 | |
| 111 | + wavecode_2_bDrawThick=0 | |
| 112 | + wavecode_2_bAdditive=0 | |
| 113 | + wavecode_2_scaling=1.00000 | |
| 114 | + wavecode_2_smoothing=0.50000 | |
| 115 | + wavecode_2_r=1.000 | |
| 116 | + wavecode_2_g=1.000 | |
| 117 | + wavecode_2_b=1.000 | |
| 118 | + wavecode_2_a=1.000 | |
| 119 | + wavecode_3_enabled=0 | |
| 120 | + wavecode_3_samples=512 | |
| 121 | + wavecode_3_sep=0 | |
| 122 | + wavecode_3_bSpectrum=0 | |
| 123 | + wavecode_3_bUseDots=0 | |
| 124 | + wavecode_3_bDrawThick=0 | |
| 125 | + wavecode_3_bAdditive=0 | |
| 126 | + wavecode_3_scaling=1.00000 | |
| 127 | + wavecode_3_smoothing=0.50000 | |
| 128 | + wavecode_3_r=1.000 | |
| 129 | + wavecode_3_g=1.000 | |
| 130 | + wavecode_3_b=1.000 | |
| 131 | + wavecode_3_a=1.000 | |
| 132 | + shapecode_0_enabled=1 | |
| 133 | + shapecode_0_sides=100 | |
| 134 | + shapecode_0_additive=0 | |
| 135 | + shapecode_0_thickOutline=0 | |
| 136 | + shapecode_0_textured=1 | |
| 137 | + shapecode_0_num_inst=1 | |
| 138 | + shapecode_0_x=0.500 | |
| 139 | + shapecode_0_y=0.500 | |
| 140 | + shapecode_0_rad=0.54279 | |
| 141 | + shapecode_0_ang=0.00000 | |
| 142 | + shapecode_0_tex_ang=0.00000 | |
| 143 | + shapecode_0_tex_zoom=1.00000 | |
| 144 | + shapecode_0_r=0.000 | |
| 145 | + shapecode_0_g=0.000 | |
| 146 | + shapecode_0_b=1.000 | |
| 147 | + shapecode_0_a=1.000 | |
| 148 | + shapecode_0_r2=1.000 | |
| 149 | + shapecode_0_g2=1.000 | |
| 150 | + shapecode_0_b2=1.000 | |
| 151 | + shapecode_0_a2=0.000 | |
| 152 | + shapecode_0_border_r=1.000 | |
| 153 | + shapecode_0_border_g=1.000 | |
| 154 | + shapecode_0_border_b=1.000 | |
| 155 | + shapecode_0_border_a=0.000 | |
| 156 | + shape_0_per_frame1=x = x + 0.362*cos(2.452*time); | |
| 157 | + shape_0_per_frame2=y = y + 0.352*sin(1.52*time); | |
| 158 | + shape_0_per_frame3=r = q3; | |
| 159 | + shape_0_per_frame4=b = q2; | |
| 160 | + shape_0_per_frame5=g = 1-abs(q1); | |
| 161 | + shapecode_1_enabled=1 | |
| 162 | + shapecode_1_sides=100 | |
| 163 | + shapecode_1_additive=0 | |
| 164 | + shapecode_1_thickOutline=0 | |
| 165 | + shapecode_1_textured=1 | |
| 166 | + shapecode_1_num_inst=1 | |
| 167 | + shapecode_1_x=0.500 | |
| 168 | + shapecode_1_y=0.500 | |
| 169 | + shapecode_1_rad=0.33004 | |
| 170 | + shapecode_1_ang=0.00000 | |
| 171 | + shapecode_1_tex_ang=0.00000 | |
| 172 | + shapecode_1_tex_zoom=1.00000 | |
| 173 | + shapecode_1_r=1.000 | |
| 174 | + shapecode_1_g=0.000 | |
| 175 | + shapecode_1_b=0.000 | |
| 176 | + shapecode_1_a=1.000 | |
| 177 | + shapecode_1_r2=1.000 | |
| 178 | + shapecode_1_g2=1.000 | |
| 179 | + shapecode_1_b2=1.000 | |
| 180 | + shapecode_1_a2=0.000 | |
| 181 | + shapecode_1_border_r=1.000 | |
| 182 | + shapecode_1_border_g=1.000 | |
| 183 | + shapecode_1_border_b=1.000 | |
| 184 | + shapecode_1_border_a=0.000 | |
| 185 | + shape_1_per_frame1=x = x + 0.362*sin(2.452*time); | |
| 186 | + shape_1_per_frame2=y = y + 0.352*cos(1.52*time); | |
| 187 | + shape_1_per_frame3=x = x + 0.362*sin(0.1952*time); | |
| 188 | + shape_1_per_frame4=y = y + 0.352*cos(0.32*time); | |
| 189 | + shape_1_per_frame5= | |
| 190 | + shape_1_per_frame6= | |
| 191 | + shape_1_per_frame7= | |
| 192 | + shape_1_per_frame8=r = 1-abs(q3); | |
| 193 | + shape_1_per_frame9=g = q1; | |
| 194 | + shape_1_per_frame10=b = 1-abs(q2); | |
| 195 | + shapecode_2_enabled=1 | |
| 196 | + shapecode_2_sides=4 | |
| 197 | + shapecode_2_additive=0 | |
| 198 | + shapecode_2_thickOutline=0 | |
| 199 | + shapecode_2_textured=1 | |
| 200 | + shapecode_2_num_inst=1 | |
| 201 | + shapecode_2_x=0.500 | |
| 202 | + shapecode_2_y=1.800 | |
| 203 | + shapecode_2_rad=0.10000 | |
| 204 | + shapecode_2_ang=0.00000 | |
| 205 | + shapecode_2_tex_ang=0.00000 | |
| 206 | + shapecode_2_tex_zoom=1.00000 | |
| 207 | + shapecode_2_r=1.000 | |
| 208 | + shapecode_2_g=0.000 | |
| 209 | + shapecode_2_b=0.000 | |
| 210 | + shapecode_2_a=1.000 | |
| 211 | + shapecode_2_r2=0.000 | |
| 212 | + shapecode_2_g2=1.000 | |
| 213 | + shapecode_2_b2=0.000 | |
| 214 | + shapecode_2_a2=0.000 | |
| 215 | + shapecode_2_border_r=1.000 | |
| 216 | + shapecode_2_border_g=1.000 | |
| 217 | + shapecode_2_border_b=1.000 | |
| 218 | + shapecode_2_border_a=0.100 | |
| 219 | + shapecode_3_enabled=0 | |
| 220 | + shapecode_3_sides=4 | |
| 221 | + shapecode_3_additive=0 | |
| 222 | + shapecode_3_thickOutline=0 | |
| 223 | + shapecode_3_textured=0 | |
| 224 | + shapecode_3_num_inst=1 | |
| 225 | + shapecode_3_x=0.500 | |
| 226 | + shapecode_3_y=0.500 | |
| 227 | + shapecode_3_rad=0.10000 | |
| 228 | + shapecode_3_ang=0.00000 | |
| 229 | + shapecode_3_tex_ang=0.00000 | |
| 230 | + shapecode_3_tex_zoom=1.00000 | |
| 231 | + shapecode_3_r=1.000 | |
| 232 | + shapecode_3_g=0.000 | |
| 233 | + shapecode_3_b=0.000 | |
| 234 | + shapecode_3_a=1.000 | |
| 235 | + shapecode_3_r2=0.000 | |
| 236 | + shapecode_3_g2=1.000 | |
| 237 | + shapecode_3_b2=0.000 | |
| 238 | + shapecode_3_a2=0.000 | |
| 239 | + shapecode_3_border_r=1.000 | |
| 240 | + shapecode_3_border_g=1.000 | |
| 241 | + shapecode_3_border_b=1.000 | |
| 242 | + shapecode_3_border_a=0.100 | |
| 243 | + per_frame_1=wave_r = 0.65 + 0.5*sin(time*1.13); | |
| 244 | + per_frame_2=wave_g = 0.65 + 0.5*sin(time*1.23); | |
| 245 | + per_frame_3=wave_b = 0.65 + 0.5*sin(time*1.33); | |
| 246 | + per_frame_4=q1 = wave_r; | |
| 247 | + per_frame_5=q2 = wave_g; | |
| 248 | + per_frame_6=q3 = wave_b; | |
| 249 | + per_frame_7= | |
| 250 | + per_frame_8= | |
| 251 | + per_frame_9=xy1 = x*above(sin(time),0)+y*below(sin(time),0); | |
| 252 | + per_frame_10=xy2 = x*below(sin(time),0)+y*above(sin(time),0); | |
| 253 | + per_frame_11=q1 = xy1; | |
| 254 | + per_frame_12=q2 = xy2; | |
| 255 | + per_frame_13= | |
| 256 | + per_frame_14=thresh = above(bass_att,thresh)*2+(1-above(bass_att,thresh))*((thresh-1.3)*0.96+1.3); | |
| 257 | + per_frame_15=dx_r = equal(thresh,2)*0.015*sin(5*time)+(1-equal(thresh,2))*dx_r; | |
| 258 | + per_frame_16=dy_r = equal(thresh,2)*0.015*sin(6*time)+(1-equal(thresh,2))*dy_r; | |
| 259 | + per_frame_17=rg4 = abs(sin(0.4*time)); | |
| 260 | + per_frame_18=rg5 = 0*above(rg4,0.75) + 1*below(rg4,0.25) + 2*above(rg4,0.25)*below(rg4,0.5)+ | |
| 261 | + per_frame_19=3*below(rg4,0.75)*above(rg4,0.5); | |
| 262 | + per_frame_20=rg6 = if(equal(thresh,2),rg5,rg6); | |
| 263 | + per_frame_21= | |
| 264 | + per_frame_22=echo_orient = echo_orient + rg6; | |
| 265 | + per_frame_23= | |
| 266 | + per_frame_24=decay = min(0.995+abs(0.05*sin(time)),1); | |
| 267 | + per_frame_25=pfthresh = above(bass_att,pfthresh)*2+(1-above(bass_att,pfthresh))*((pfthresh-1.3)*0.96+1.3); | |
| 268 | + per_frame_26=pfdx_r = equal(pfthresh,2)*0.015*sin(5*time)+(1-equal(pfthresh,2))*pfdx_r; | |
| 269 | + per_frame_27=pfdy_r = equal(pfthresh,2)*0.015*sin(6*time)+(1-equal(pfthresh,2))*pfdy_r; | |
| 270 | + per_frame_28=rg1 = abs(sin(0.76*time)); | |
| 271 | + per_frame_29=rg2 = 0*above(rg1,0.5) + 1*below(rg1,0.5); | |
| 272 | + per_frame_30=rg3 = if(equal(pfthresh,2),rg2,rg3); | |
| 273 | + per_frame_31=invert = 1; | |
| 274 | + per_frame_32=darken = 1-invert; | |
| 275 | + per_frame_33=echo_alpha = echo_alpha - 0.1*rg6; | |
| 276 | + per_frame_34=brighten = invert; | |
| 277 | + per_frame_35=//solarize = dx_r*50; | |
| 278 | + per_pixel_1=thresh = above(bass_att,thresh)*2+(1-above(bass_att,thresh))*((thresh-1.3)*0.96+1.3); | |
| 279 | + per_pixel_2=dx_r = equal(thresh,2)*0.015*sin(5*time)+(1-equal(thresh,2))*dx_r; | |
| 280 | + per_pixel_3=dy_r = equal(thresh,2)*0.015*sin(6*time)+(1-equal(thresh,2))*dy_r; | |
| 281 | + per_pixel_4= | |
| 282 | + per_pixel_5= | |
| 283 | + per_pixel_6=zoom = zoom + abs(0.05*(3*(0.5-rad)*bass_att*4)); | |
| 284 | + per_pixel_7=zoom = zoom + if(above(bass_att,1.2),(0.06*sin(24*time)),0); | |
| 285 | + per_pixel_8= | |
| 286 | + per_pixel_9=thresh = above(bass_att,thresh)*2+(1-above(bass_att,thresh))*((thresh-1.3)*0.96+1.3); | |
| 287 | + per_pixel_10=dx_r = equal(thresh,2)*0.015*sin(5*time)+(1-equal(thresh,2))*dx_r; | |
| 288 | + per_pixel_11=dy_r = equal(thresh,2)*0.015*sin(6*time)+(1-equal(thresh,2))*dy_r; | |
| 289 | + per_pixel_12=tg1 = abs(sin(8*time)); | |
| 290 | + per_pixel_13=tg2 = 8*above(tg1,0.75) + 12*below(tg1,0.25) + 16*above(tg1,0.25)*below(tg1,0.5); | |
| 291 | + per_pixel_14=24*above(tg1,0.5)*below(tg1,0.75); | |
| 292 | + per_pixel_15=tg3 = if(equal(thresh,2),tg2,tg3); | |
| 293 | + per_pixel_16= | |
| 294 | + per_pixel_17=zoom = zoom + abs(3*rad*dx_r); | |
| 295 | + per_pixel_18=dx = dx + dx_r*sin(sin(12+(tg3*y)))*(sin(3+(tg3*x))); | |
| 296 | + per_pixel_19=dy = dy + dy_r*sin(sin(12+(tg3*y)))*(sin(3+(tg3+x))); | |
| 297 | + per_pixel_20=thresh = above(bass_att,thresh)*2+(1-above(bass_att,thresh))*((thresh-1.3)*0.96+1.3); | |
| 298 | + per_pixel_21=dx_r = equal(thresh,2)*0.015*sin(5*time)+(1-equal(thresh,2))*dx_r; | |
| 299 | + per_pixel_22=dy_r = equal(thresh,2)*0.015*sin(6*time)+(1-equal(thresh,2))*dy_r; | |
| 300 | + per_pixel_23= | |
| 301 | + per_pixel_24= | |
| 302 | + per_pixel_25=tg1 = abs(sin(time)); | |
| 303 | + per_pixel_26=tg2 = 12*above(tg1,0.8) + 4*below(tg1,0.2) + | |
| 304 | + per_pixel_27=6*above(tg1,0.2)*below(tg1,0.4) + 8*above(tg1,0.4)*below(tg1,0.6) + | |
| 305 | + per_pixel_28=10*above(tg1,0.6)*below(tg1,0.8); | |
| 306 | + per_pixel_29=tg3 = if(equal(thresh,2),tg2,tg3); | |
| 307 | + per_pixel_30=zoom = zoom + 0.6-(1.3*abs( 12*dx_r*cos(tg3*ang) - sin(14*dy_r*rad)*0.5-rad)); | |
| 308 | + per_pixel_31=thresh = above(bass_att,thresh)*2+(1-above(bass_att,thresh))*((thresh-1.3)*0.96+1.3); | |
| 309 | + per_pixel_32= | |
| 310 | + per_pixel_33=dx_r = equal(thresh,2)*0.015*sin(5*time)+(1-equal(thresh,2))*dx_r; | |
| 311 | + per_pixel_34=dy_r = equal(thresh,2)*0.015*sin(6*time)+(1-equal(thresh,2))*dy_r; | |
| 312 | + per_pixel_35=zoom = zoom + 0.01; | |
| 313 | + per_pixel_36=zoom = zoom + (0.05 + 0.04*sin(time))*(0.2*sin(ang*time)); | |
| 314 | + per_pixel_37=rot = rot + 0.01*(0.5*cos(ang*5*bass*time)); | |
| 315 | + per_pixel_38= | |
| 316 | + per_pixel_39=dx = dx + 0.1*above(rad,0.25)*dx_r; | |
| 317 | + per_pixel_40=dy = dy + 0.1*above(rad,0.25)*dy_r; | |
| 318 | + per_pixel_41=rot=0.1*pow(-ang,3)-1.18*sin(ang); | |
| 319 | + per_pixel_42=zoom=1.45*sin(-rad)+1.3+ sin(rad); | |
| 320 | + per_pixel_43=dx = dx + 0.09*sin(q8*0.785); | |
| 321 | + per_pixel_44=dy = dy + 0.09*sin(q8*0.675); | |
| 322 | + per_pixel_45=//zoom = zoom +q7; | |
| 323 | + per_pixel_46=thresh = above(bass_att,thresh)*2+(1-above(bass_att,thresh))*((thresh-1.3)*0.96+1.3); | |
| 324 | + per_pixel_47=dx_r = equal(thresh,2)*0.015*sin(5*time)+(1-equal(thresh,2))*dx_r; | |
| 325 | + per_pixel_48=dy_r = equal(thresh,2)*0.015*sin(6*time)+(1-equal(thresh,2))*dy_r; | |
| 326 | + per_pixel_49= | |
| 327 | + per_pixel_50=rot = rot + 0.00006*(0.1*(time))+(0.5*(0.5-rad))+rad; | |
| 328 | + per_pixel_51=rot = rot - 0.1*sqr(0.5*cos(ang*time)*bass_att); | |
| 329 | + per_pixel_52=zoom = zoom - 0.09*(sin(1-rad)*0.25*(0.25*(5-rad))); | |
| 330 | + per_pixel_53=zoom = zoom - 0.05*above(y,0.5)*sqr(0.5*sin(ang*time)*0.1*bass_att); | |
| 331 | + per_pixel_54=zoom = zoom - 0.05*below(y,0.5)*sqr(0.5*cos(ang*time)*0.1*treb_att); | |
| 332 | + per_pixel_55=du = (x*2-1) - q1; | |
| 333 | + per_pixel_56=dv = (y*2-1) - q2; | |
| 334 | + per_pixel_57=dist = sqrt(du*du+dv*dv); | |
| 335 | + per_pixel_58=ang2 = atan2(du,dv) + time*0.15; | |
| 336 | + per_pixel_59=mult = 0.65*sin(dist*0.05); | |
| 337 | + per_pixel_60=dx = mult*sin(ang2*2-1.5); | |
| 338 | + per_pixel_61=dy = mult*cos(ang2*2-1.5); | |
| 339 | + per_pixel_62=rot=0.1*pow(-ang,3)-1.18*sin(ang); | |
| 340 | + per_pixel_63=zoom=2*sin(-rad)+1.3+ sin(rad); | |
| 341 | + per_pixel_64=dx = dx + 0.09*sin(q8*0.785); | |
| 342 | + per_pixel_65=dy = dy + 0.09*sin(q8*0.675); | |
| 343 | + per_pixel_66=zoom = zoom +q7; | |
| 344 | + warp_1=`shader_body { | |
| 345 | + warp_2=` | |
| 346 | + warp_3=`//uv = uv_orig; | |
| 347 | + warp_4=`float corr = texsize.xy*texsize_noise_lq.zw; | |
| 348 | + warp_5=`float2 uv1 = float2(uv.x-0.5,uv.y-0.5)*aspect.xy; | |
| 349 | + warp_6=` | |
| 350 | + warp_7=`float2 tmp = uv1; | |
| 351 | + warp_8=`tmp.x = ang*3; tmp.y = rad; | |
| 352 | + warp_9=`uv1 = tmp; | |
| 353 | + warp_10=` | |
| 354 | + warp_11=`float3 noise = (tex2D(sampler_noise_lq,corr*uv/2+q23)+1); | |
| 355 | + warp_12=` | |
| 356 | + warp_13=`float3 ret1 = GetBlur1 (uv)-.3; | |
| 357 | + warp_14=`float3 crisp = tex2D(sampler_main, uv+ret1*.01 ) + noise*0.1; | |
| 358 | + warp_15=`float3 blur = GetBlur1 (uv/4+.4*float2(.3*ret1.x,ret1.y)) - noise*.1; | |
| 359 | + warp_16=` | |
| 360 | + warp_17=`ret = -.4*blur + crisp; | |
| 361 | + warp_18=` | |
| 362 | + warp_19=` ret *= 0.98 * pow(1-.01*q28*q28*rad,2); | |
| 363 | + warp_20=` ret -= 0.04; | |
| 364 | + warp_21=`} | |
| 365 | + comp_1=`sampler sampler_rand00; | |
| 366 | + comp_2=`shader_body | |
| 367 | + comp_3=`{ | |
| 368 | + comp_4=`ret = tex2D(sampler_rand00, frac(1-GetBlur2(uv).yx*0.6 + time*float2(0.057,.036))) | |
| 369 | + comp_5=`*(1+GetPixel(uv).x + GetBlur1(uv).y)*0.4; | |
| 370 | + comp_6=` | |
| 371 | + comp_7=`} |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Blobby Mirror/Beat it Adam FX 2 suksma + Future light show - Ft Che Hexocollie AdamFXRemixed Again ft Flexi n Fishbrain + Flexi Again Ugh 5.milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=2 | |
| 3 | + PSVERSION_WARP=2 | |
| 4 | + PSVERSION_COMP=2 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=1.000 | |
| 8 | + fDecay=1.000 | |
| 9 | + fVideoEchoZoom=1.000 | |
| 10 | + fVideoEchoAlpha=1.000 | |
| 11 | + nVideoEchoOrientation=1 | |
| 12 | + nWaveMode=0 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=0 | |
| 16 | + bModWaveAlphaByVolume=0 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=1 | |
| 19 | + bDarkenCenter=0 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=0 | |
| 22 | + bDarken=0 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=0.001 | |
| 26 | + fWaveScale=0.010 | |
| 27 | + fWaveSmoothing=0.630 | |
| 28 | + fWaveParam=-1.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=0.010 | |
| 32 | + fWarpScale=0.010 | |
| 33 | + fZoomExponent=1.00000 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=1.00000 | |
| 36 | + rot=0.00000 | |
| 37 | + cx=0.500 | |
| 38 | + cy=0.500 | |
| 39 | + dx=0.00000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.01000 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.020 | |
| 50 | + ob_r=0.100 | |
| 51 | + ob_g=0.600 | |
| 52 | + ob_b=1.000 | |
| 53 | + ob_a=1.000 | |
| 54 | + ib_size=0.020 | |
| 55 | + ib_r=0.000 | |
| 56 | + ib_g=0.000 | |
| 57 | + ib_b=0.000 | |
| 58 | + ib_a=1.000 | |
| 59 | + nMotionVectorsX=12.800 | |
| 60 | + nMotionVectorsY=9.600 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=1.000 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=0.910 | |
| 66 | + mv_b=0.710 | |
| 67 | + mv_a=1.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=0 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=0 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=1.000 | |
| 85 | + wavecode_0_g=1.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=1.000 | |
| 88 | + wavecode_1_enabled=0 | |
| 89 | + wavecode_1_samples=512 | |
| 90 | + wavecode_1_sep=0 | |
| 91 | + wavecode_1_bSpectrum=0 | |
| 92 | + wavecode_1_bUseDots=0 | |
| 93 | + wavecode_1_bDrawThick=0 | |
| 94 | + wavecode_1_bAdditive=0 | |
| 95 | + wavecode_1_scaling=1.00000 | |
| 96 | + wavecode_1_smoothing=0.50000 | |
| 97 | + wavecode_1_r=1.000 | |
| 98 | + wavecode_1_g=1.000 | |
| 99 | + wavecode_1_b=1.000 | |
| 100 | + wavecode_1_a=1.000 | |
| 101 | + wavecode_2_enabled=0 | |
| 102 | + wavecode_2_samples=512 | |
| 103 | + wavecode_2_sep=0 | |
| 104 | + wavecode_2_bSpectrum=0 | |
| 105 | + wavecode_2_bUseDots=0 | |
| 106 | + wavecode_2_bDrawThick=0 | |
| 107 | + wavecode_2_bAdditive=0 | |
| 108 | + wavecode_2_scaling=1.00000 | |
| 109 | + wavecode_2_smoothing=0.50000 | |
| 110 | + wavecode_2_r=1.000 | |
| 111 | + wavecode_2_g=1.000 | |
| 112 | + wavecode_2_b=1.000 | |
| 113 | + wavecode_2_a=1.000 | |
| 114 | + wavecode_3_enabled=0 | |
| 115 | + wavecode_3_samples=512 | |
| 116 | + wavecode_3_sep=0 | |
| 117 | + wavecode_3_bSpectrum=0 | |
| 118 | + wavecode_3_bUseDots=0 | |
| 119 | + wavecode_3_bDrawThick=0 | |
| 120 | + wavecode_3_bAdditive=0 | |
| 121 | + wavecode_3_scaling=1.00000 | |
| 122 | + wavecode_3_smoothing=0.50000 | |
| 123 | + wavecode_3_r=1.000 | |
| 124 | + wavecode_3_g=1.000 | |
| 125 | + wavecode_3_b=1.000 | |
| 126 | + wavecode_3_a=1.000 | |
| 127 | + shapecode_0_enabled=1 | |
| 128 | + shapecode_0_sides=100 | |
| 129 | + shapecode_0_additive=0 | |
| 130 | + shapecode_0_thickOutline=0 | |
| 131 | + shapecode_0_textured=0 | |
| 132 | + shapecode_0_num_inst=1 | |
| 133 | + shapecode_0_x=0.500 | |
| 134 | + shapecode_0_y=0.500 | |
| 135 | + shapecode_0_rad=0.49138 | |
| 136 | + shapecode_0_ang=0.00000 | |
| 137 | + shapecode_0_tex_ang=0.00000 | |
| 138 | + shapecode_0_tex_zoom=1.00000 | |
| 139 | + shapecode_0_r=0.000 | |
| 140 | + shapecode_0_g=1.000 | |
| 141 | + shapecode_0_b=1.000 | |
| 142 | + shapecode_0_a=1.000 | |
| 143 | + shapecode_0_r2=0.000 | |
| 144 | + shapecode_0_g2=0.000 | |
| 145 | + shapecode_0_b2=0.000 | |
| 146 | + shapecode_0_a2=0.000 | |
| 147 | + shapecode_0_border_r=1.000 | |
| 148 | + shapecode_0_border_g=1.000 | |
| 149 | + shapecode_0_border_b=1.000 | |
| 150 | + shapecode_0_border_a=0.000 | |
| 151 | + shape_0_per_frame1=x=.5+q4;y=.5+q5; | |
| 152 | + shapecode_1_enabled=1 | |
| 153 | + shapecode_1_sides=24 | |
| 154 | + shapecode_1_additive=0 | |
| 155 | + shapecode_1_thickOutline=0 | |
| 156 | + shapecode_1_textured=0 | |
| 157 | + shapecode_1_num_inst=1 | |
| 158 | + shapecode_1_x=0.500 | |
| 159 | + shapecode_1_y=0.500 | |
| 160 | + shapecode_1_rad=0.01120 | |
| 161 | + shapecode_1_ang=0.00000 | |
| 162 | + shapecode_1_tex_ang=0.00000 | |
| 163 | + shapecode_1_tex_zoom=0.81954 | |
| 164 | + shapecode_1_r=1.000 | |
| 165 | + shapecode_1_g=1.000 | |
| 166 | + shapecode_1_b=0.000 | |
| 167 | + shapecode_1_a=1.000 | |
| 168 | + shapecode_1_r2=1.000 | |
| 169 | + shapecode_1_g2=1.000 | |
| 170 | + shapecode_1_b2=1.000 | |
| 171 | + shapecode_1_a2=1.000 | |
| 172 | + shapecode_1_border_r=1.000 | |
| 173 | + shapecode_1_border_g=1.000 | |
| 174 | + shapecode_1_border_b=1.000 | |
| 175 | + shapecode_1_border_a=0.000 | |
| 176 | + shape_1_per_frame1=tex_ang=0.01; | |
| 177 | + shape_1_per_frame2=x=.5-q4; | |
| 178 | + shape_1_per_frame3=y=.5-q5; | |
| 179 | + shapecode_2_enabled=0 | |
| 180 | + shapecode_2_sides=34 | |
| 181 | + shapecode_2_additive=0 | |
| 182 | + shapecode_2_thickOutline=0 | |
| 183 | + shapecode_2_textured=0 | |
| 184 | + shapecode_2_num_inst=1 | |
| 185 | + shapecode_2_x=0.500 | |
| 186 | + shapecode_2_y=0.500 | |
| 187 | + shapecode_2_rad=0.02743 | |
| 188 | + shapecode_2_ang=0.00000 | |
| 189 | + shapecode_2_tex_ang=0.00000 | |
| 190 | + shapecode_2_tex_zoom=1.00000 | |
| 191 | + shapecode_2_r=1.000 | |
| 192 | + shapecode_2_g=1.000 | |
| 193 | + shapecode_2_b=1.000 | |
| 194 | + shapecode_2_a=1.000 | |
| 195 | + shapecode_2_r2=1.000 | |
| 196 | + shapecode_2_g2=1.000 | |
| 197 | + shapecode_2_b2=1.000 | |
| 198 | + shapecode_2_a2=0.000 | |
| 199 | + shapecode_2_border_r=1.000 | |
| 200 | + shapecode_2_border_g=1.000 | |
| 201 | + shapecode_2_border_b=1.000 | |
| 202 | + shapecode_2_border_a=0.100 | |
| 203 | + shape_2_per_frame1=tex_ang=0.01; | |
| 204 | + shape_2_per_frame2=x=.4-q4; | |
| 205 | + shape_2_per_frame3=y=.5-q5; | |
| 206 | + shapecode_3_enabled=0 | |
| 207 | + shapecode_3_sides=4 | |
| 208 | + shapecode_3_additive=0 | |
| 209 | + shapecode_3_thickOutline=0 | |
| 210 | + shapecode_3_textured=0 | |
| 211 | + shapecode_3_num_inst=1 | |
| 212 | + shapecode_3_x=0.500 | |
| 213 | + shapecode_3_y=0.500 | |
| 214 | + shapecode_3_rad=0.10000 | |
| 215 | + shapecode_3_ang=0.00000 | |
| 216 | + shapecode_3_tex_ang=0.00000 | |
| 217 | + shapecode_3_tex_zoom=1.00000 | |
| 218 | + shapecode_3_r=1.000 | |
| 219 | + shapecode_3_g=0.000 | |
| 220 | + shapecode_3_b=0.000 | |
| 221 | + shapecode_3_a=1.000 | |
| 222 | + shapecode_3_r2=0.000 | |
| 223 | + shapecode_3_g2=1.000 | |
| 224 | + shapecode_3_b2=0.000 | |
| 225 | + shapecode_3_a2=0.000 | |
| 226 | + shapecode_3_border_r=1.000 | |
| 227 | + shapecode_3_border_g=1.000 | |
| 228 | + shapecode_3_border_b=1.000 | |
| 229 | + shapecode_3_border_a=0.100 | |
| 230 | + per_frame_init_1=mv_x=64;mv_y=48; | |
| 231 | + per_frame_init_2=nut=0; | |
| 232 | + per_frame_init_3=stp=0;stq=0; | |
| 233 | + per_frame_init_4=rtp=0;rtq=0; | |
| 234 | + per_frame_init_5=wvr=0; | |
| 235 | + per_frame_init_6=decay=0; | |
| 236 | + per_frame_init_7=dcsp=0 | |
| 237 | + per_frame_init_8= | |
| 238 | + per_frame_1=decay=1; | |
| 239 | + per_frame_2= | |
| 240 | + per_frame_3=vol= (bass+mid+treb)*2; | |
| 241 | + per_frame_4=vol=vol; | |
| 242 | + per_frame_5= | |
| 243 | + per_frame_6= | |
| 244 | + per_frame_7= | |
| 245 | + per_frame_8=zoom=1.000; | |
| 246 | + per_frame_9=musictime=musictime+vol; | |
| 247 | + per_frame_10=q4=sin(musictime*0.02)*0.3; | |
| 248 | + per_frame_11=q5=sin(musictime*0.01)*0.3; | |
| 249 | + per_frame_12= | |
| 250 | + per_frame_13= | |
| 251 | + per_frame_14= | |
| 252 | + per_frame_15= | |
| 253 | + per_pixel_1=tm=sin(time*0.5)*3; | |
| 254 | + per_pixel_2=tm2=cos(time)*3; | |
| 255 | + per_pixel_3=zooma=above(cos(x*6.28*3+tm),0) * above(cos(y*6.28*2+tm2),0); | |
| 256 | + per_pixel_4=zooma=min(sin(x*6.28*3+tm)+1,1) * min(cos(y*6.28*2+tm)+1,1); | |
| 257 | + per_pixel_5= | |
| 258 | + per_pixel_6=rd=sqrt( sqr( (x-0.5-q4)*1.7) + sqr( (y-0.5+q5)*1.2 ) ); | |
| 259 | + per_pixel_7=cx=0.5+q4; | |
| 260 | + per_pixel_8=cy=0.5-q5; | |
| 261 | + per_pixel_9= | |
| 262 | + per_pixel_10= | |
| 263 | + per_pixel_11=zoom= 0.99*(zooma) + 0.99*(1-zooma); | |
| 264 | + per_pixel_12=rot=.3*zooma*rd; | |
| 265 | + warp_1=`sampler sampler_fw_clouds; | |
| 266 | + warp_2=`shader_body | |
| 267 | + warp_3=`{// sample previous frame | |
| 268 | + warp_4=`ret = tex2D( sampler_main, uv ).xyz; | |
| 269 | + warp_5=`//float blur =sin(bass*9); | |
| 270 | + warp_6=`/* | |
| 271 | + warp_7=`ret=0.125*( | |
| 272 | + warp_8=`GetPixel(float2(uv.x-0.01*blur,uv.y-0.01*blur)) + | |
| 273 | + warp_9=`GetPixel(float2(uv.x+0.01*blur,uv.y+0.01*blur)) + | |
| 274 | + warp_10=`GetPixel(float2(uv.x-0.01*blur,uv.y+0.01*blur)) + | |
| 275 | + warp_11=`GetPixel(float2(uv.x+0.01*blur,uv.y-0.01*blur)) + | |
| 276 | + warp_12=`GetPixel(float2(uv.x,uv.y-0.01*blur)) + | |
| 277 | + warp_13=`GetPixel(float2(uv.x,uv.y+0.01*blur)) + | |
| 278 | + warp_14=`GetPixel(float2(uv.x-0.01*blur,uv.y)) + | |
| 279 | + warp_15=`GetPixel(float2(uv.x+0.01*blur,uv.y))); | |
| 280 | + warp_16=`*/ | |
| 281 | + warp_17=`//add a 'bass overbright' effect: | |
| 282 | + warp_18=`//ret-=-(lum(ret)<sin(time*90))*ret*blur+(lum(ret)>sin(-time*90))*ret*blur; | |
| 283 | + warp_19=`ret=ret*0.99-0.015; | |
| 284 | + warp_20=`} | |
| 285 | + comp_1=`shader_body | |
| 286 | + comp_2=`{ | |
| 287 | + comp_3=` float2 uv2, uv3; | |
| 288 | + comp_4=` float ang2, c, s; | |
| 289 | + comp_5=` | |
| 290 | + comp_6=` uv -= 0.5; | |
| 291 | + comp_7=` uv *= aspect.xy; | |
| 292 | + comp_8=` | |
| 293 | + comp_9=`float3 ret1 = 0; | |
| 294 | + comp_10=`int anz = 6; | |
| 295 | + comp_11=`int n = 0; | |
| 296 | + comp_12=`while (n <= anz) { | |
| 297 | + comp_13=` ang2 = 6.28*n/anz; | |
| 298 | + comp_14=` c = cos(ang2); | |
| 299 | + comp_15=` s = sin(ang2); | |
| 300 | + comp_16=` uv2.x = uv.x*c - uv.y*s; | |
| 301 | + comp_17=` uv2.y = uv.x*s + uv.y*c; | |
| 302 | + comp_18=` | |
| 303 | + comp_19=` ret1 = max(ret1,tex2D(sampler_main, uv2 + 0.5+.1*q1)); | |
| 304 | + comp_20=`n++; | |
| 305 | + comp_21=`} | |
| 306 | + comp_22=` | |
| 307 | + comp_23=`ret1 = (ret1 - rad/2) * (1+slow_roam_cos.xyz/2); | |
| 308 | + comp_24=` | |
| 309 | + comp_25=`float3 noise = tex2D (sampler_noise_hq,uv*8+lum(ret1)/8)+.15; | |
| 310 | + comp_26=` | |
| 311 | + comp_27=`ret1 = max(ret1,lum(noise)/6); | |
| 312 | + comp_28=` | |
| 313 | + comp_29=`//ret = lerp(ret, lum(ret), -5); | |
| 314 | + comp_30=` | |
| 315 | + comp_31=` ret = ret1*1.6-.1; | |
| 316 | + comp_32=`} | |
| 317 | + comp_33=` | |
| 318 | + comp_34=` |
Sources/PulseCanvas/Resources/ProjectM/Presets/Dancer/Blobby Mirror/CantStop AdamFX 2 Stahlregen & Bmelgren + EoS + Geiss + Krash + Rocke + Rovastar - Glowstick Heart (MashUp 7) .milk added
| 1 | + MILKDROP_PRESET_VERSION=201 | |
| 2 | + PSVERSION=2 | |
| 3 | + PSVERSION_WARP=2 | |
| 4 | + PSVERSION_COMP=0 | |
| 5 | + [preset00] | |
| 6 | + fRating=5.000000 | |
| 7 | + fGammaAdj=2.000 | |
| 8 | + fDecay=1.000 | |
| 9 | + fVideoEchoZoom=1.000 | |
| 10 | + fVideoEchoAlpha=0.500 | |
| 11 | + nVideoEchoOrientation=1 | |
| 12 | + nWaveMode=6 | |
| 13 | + bAdditiveWaves=1 | |
| 14 | + bWaveDots=0 | |
| 15 | + bWaveThick=1 | |
| 16 | + bModWaveAlphaByVolume=0 | |
| 17 | + bMaximizeWaveColor=0 | |
| 18 | + bTexWrap=0 | |
| 19 | + bDarkenCenter=1 | |
| 20 | + bRedBlueStereo=0 | |
| 21 | + bBrighten=0 | |
| 22 | + bDarken=1 | |
| 23 | + bSolarize=0 | |
| 24 | + bInvert=0 | |
| 25 | + fWaveAlpha=4.100 | |
| 26 | + fWaveScale=0.010 | |
| 27 | + fWaveSmoothing=0.900 | |
| 28 | + fWaveParam=0.000 | |
| 29 | + fModWaveAlphaStart=0.710 | |
| 30 | + fModWaveAlphaEnd=1.300 | |
| 31 | + fWarpAnimSpeed=1.000 | |
| 32 | + fWarpScale=2.853 | |
| 33 | + fZoomExponent=0.99984 | |
| 34 | + fShader=0.000 | |
| 35 | + zoom=0.99968 | |
| 36 | + rot=0.00000 | |
| 37 | + cx=0.500 | |
| 38 | + cy=0.500 | |
| 39 | + dx=0.00000 | |
| 40 | + dy=0.00000 | |
| 41 | + warp=0.00000 | |
| 42 | + sx=1.00000 | |
| 43 | + sy=1.00000 | |
| 44 | + wave_r=0.650 | |
| 45 | + wave_g=0.650 | |
| 46 | + wave_b=0.650 | |
| 47 | + wave_x=0.500 | |
| 48 | + wave_y=0.500 | |
| 49 | + ob_size=0.000 | |
| 50 | + ob_r=0.000 | |
| 51 | + ob_g=0.000 | |
| 52 | + ob_b=0.000 | |
| 53 | + ob_a=0.000 | |
| 54 | + ib_size=0.010 | |
| 55 | + ib_r=0.250 | |
| 56 | + ib_g=0.250 | |
| 57 | + ib_b=0.250 | |
| 58 | + ib_a=0.000 | |
| 59 | + nMotionVectorsX=12.000 | |
| 60 | + nMotionVectorsY=9.000 | |
| 61 | + mv_dx=0.000 | |
| 62 | + mv_dy=0.000 | |
| 63 | + mv_l=0.900 | |
| 64 | + mv_r=1.000 | |
| 65 | + mv_g=1.000 | |
| 66 | + mv_b=1.000 | |
| 67 | + mv_a=0.000 | |
| 68 | + b1n=0.000 | |
| 69 | + b2n=0.000 | |
| 70 | + b3n=0.000 | |
| 71 | + b1x=1.000 | |
| 72 | + b2x=1.000 | |
| 73 | + b3x=1.000 | |
| 74 | + b1ed=0.250 | |
| 75 | + wavecode_0_enabled=0 | |
| 76 | + wavecode_0_samples=512 | |
| 77 | + wavecode_0_sep=0 | |
| 78 | + wavecode_0_bSpectrum=0 | |
| 79 | + wavecode_0_bUseDots=0 | |
| 80 | + wavecode_0_bDrawThick=0 | |
| 81 | + wavecode_0_bAdditive=0 | |
| 82 | + wavecode_0_scaling=1.00000 | |
| 83 | + wavecode_0_smoothing=0.50000 | |
| 84 | + wavecode_0_r=1.000 | |
| 85 | + wavecode_0_g=1.000 | |
| 86 | + wavecode_0_b=1.000 | |
| 87 | + wavecode_0_a=1.000 | |
| 88 | + wavecode_1_enabled=0 | |
| 89 | + wavecode_1_samples=512 | |
| 90 | + wavecode_1_sep=0 | |
| 91 | + wavecode_1_bSpectrum=0 | |
| 92 | + wavecode_1_bUseDots=0 | |
| 93 | + wavecode_1_bDrawThick=0 | |
| 94 | + wavecode_1_bAdditive=0 | |
| 95 | + wavecode_1_scaling=1.00000 | |
| 96 | + wavecode_1_smoothing=0.50000 | |
| 97 | + wavecode_1_r=1.000 | |
| 98 | + wavecode_1_g=1.000 | |
| 99 | + wavecode_1_b=1.000 | |
| 100 | + wavecode_1_a=1.000 | |
| 101 | + wavecode_2_enabled=0 | |
| 102 | + wavecode_2_samples=512 | |
| 103 | + wavecode_2_sep=0 | |
| 104 | + wavecode_2_bSpectrum=0 | |
| 105 | + wavecode_2_bUseDots=0 | |
| 106 | + wavecode_2_bDrawThick=0 | |
| 107 | + wavecode_2_bAdditive=0 | |
| 108 | + wavecode_2_scaling=1.00000 | |
| 109 | + wavecode_2_smoothing=0.50000 | |
| 110 | + wavecode_2_r=1.000 | |
| 111 | + wavecode_2_g=1.000 | |
| 112 | + wavecode_2_b=1.000 | |
| 113 | + wavecode_2_a=1.000 | |
| 114 | + wavecode_3_enabled=0 | |
| 115 | + wavecode_3_samples=512 | |
| 116 | + wavecode_3_sep=0 | |
| 117 | + wavecode_3_bSpectrum=0 | |
| 118 | + wavecode_3_bUseDots=0 | |
| 119 | + wavecode_3_bDrawThick=0 | |
| 120 | + wavecode_3_bAdditive=0 | |
| 121 | + wavecode_3_scaling=1.00000 | |
| 122 | + wavecode_3_smoothing=0.50000 | |
| 123 | + wavecode_3_r=1.000 | |
| 124 | + wavecode_3_g=1.000 | |
| 125 | + wavecode_3_b=1.000 | |
| 126 | + wavecode_3_a=1.000 | |
| 127 | + shapecode_0_enabled=1 | |
| 128 | + shapecode_0_sides=44 | |
| 129 | + shapecode_0_additive=0 | |
| 130 | + shapecode_0_thickOutline=0 | |
| 131 | + shapecode_0_textured=0 | |
| 132 | + shapecode_0_num_inst=1 | |
| 133 | + shapecode_0_x=0.500 | |
| 134 | + shapecode_0_y=0.500 | |
| 135 | + shapecode_0_rad=0.03347 | |
| 136 | + shapecode_0_ang=0.00000 | |
| 137 | + shapecode_0_tex_ang=0.00000 | |
| 138 | + shapecode_0_tex_zoom=1.00000 | |
| 139 | + shapecode_0_r=1.000 | |
| 140 | + shapecode_0_g=1.000 | |
| 141 | + shapecode_0_b=1.000 | |
| 142 | + shapecode_0_a=1.000 | |
| 143 | + shapecode_0_r2=1.000 | |
| 144 | + shapecode_0_g2=1.000 | |
| 145 | + shapecode_0_b2=1.000 | |
| 146 | + shapecode_0_a2=0.000 | |
| 147 | + shapecode_0_border_r=1.000 | |
| 148 | + shapecode_0_border_g=1.000 | |
| 149 | + shapecode_0_border_b=1.000 | |
| 150 | + shapecode_0_border_a=0.000 | |
| 151 | + shape_0_init1=fran = 1; | |
| 152 | + shape_0_init2=xs = 1; | |
| 153 | + shape_0_init3=ys = 1; | |
| 154 | + shape_0_init4=xm = 0.5; | |
| 155 | + shape_0_init5=ym = 0.5; | |
| 156 | + shape_0_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 157 | + shape_0_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 158 | + shape_0_per_frame3= | |
| 159 | + shape_0_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.4 + 0.6*cos(time*0.62)); | |
| 160 | + shape_0_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.5 + 0.5*cos(time*0.78)); | |
| 161 | + shape_0_per_frame6= | |
| 162 | + shape_0_per_frame7=x = xm; | |
| 163 | + shape_0_per_frame8=y = ym; | |
| 164 | + shape_0_per_frame9= | |
| 165 | + shape_0_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 166 | + shape_0_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 167 | + shape_0_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 168 | + shape_0_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 169 | + shape_0_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 170 | + shapecode_1_enabled=1 | |
| 171 | + shapecode_1_sides=44 | |
| 172 | + shapecode_1_additive=0 | |
| 173 | + shapecode_1_thickOutline=0 | |
| 174 | + shapecode_1_textured=0 | |
| 175 | + shapecode_1_num_inst=1 | |
| 176 | + shapecode_1_x=0.500 | |
| 177 | + shapecode_1_y=0.500 | |
| 178 | + shapecode_1_rad=0.03347 | |
| 179 | + shapecode_1_ang=0.00000 | |
| 180 | + shapecode_1_tex_ang=0.00000 | |
| 181 | + shapecode_1_tex_zoom=1.00000 | |
| 182 | + shapecode_1_r=1.000 | |
| 183 | + shapecode_1_g=1.000 | |
| 184 | + shapecode_1_b=1.000 | |
| 185 | + shapecode_1_a=1.000 | |
| 186 | + shapecode_1_r2=1.000 | |
| 187 | + shapecode_1_g2=1.000 | |
| 188 | + shapecode_1_b2=1.000 | |
| 189 | + shapecode_1_a2=0.000 | |
| 190 | + shapecode_1_border_r=1.000 | |
| 191 | + shapecode_1_border_g=1.000 | |
| 192 | + shapecode_1_border_b=1.000 | |
| 193 | + shapecode_1_border_a=0.000 | |
| 194 | + shape_1_init1=fran = 1; | |
| 195 | + shape_1_init2=xs = 1; | |
| 196 | + shape_1_init3=ys = 1; | |
| 197 | + shape_1_init4=xm = 0.5; | |
| 198 | + shape_1_init5=ym = 0.5; | |
| 199 | + shape_1_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 200 | + shape_1_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 201 | + shape_1_per_frame3= | |
| 202 | + shape_1_per_frame4=xm = xm + 0.03*xs*(sin(time*0.53)*0.6 + 0.4*cos(time*0.62)); | |
| 203 | + shape_1_per_frame5=ym = ym + 0.03*ys*(sin(time*0.29)*0.7 + 0.3*cos(time*0.78)); | |
| 204 | + shape_1_per_frame6= | |
| 205 | + shape_1_per_frame7=x = xm; | |
| 206 | + shape_1_per_frame8=y = ym; | |
| 207 | + shape_1_per_frame9= | |
| 208 | + shape_1_per_frame10=r = 0.5 + 0.25*sin(x*12) + 0.25*sin(y*3); | |
| 209 | + shape_1_per_frame11=g = 0.5 + 0.25*sin(x*7) + 0.25*sin(y*32); | |
| 210 | + shape_1_per_frame12=b = 0.5 + 0.25*sin(x*21) + 0.25*sin(y*16); | |
| 211 | + shape_1_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 212 | + shape_1_per_frame14=rad = 0.2*(bass_att + mid_att + treb_att)/3; | |
| 213 | + shapecode_2_enabled=0 | |
| 214 | + shapecode_2_sides=44 | |
| 215 | + shapecode_2_additive=0 | |
| 216 | + shapecode_2_thickOutline=0 | |
| 217 | + shapecode_2_textured=0 | |
| 218 | + shapecode_2_num_inst=1 | |
| 219 | + shapecode_2_x=0.500 | |
| 220 | + shapecode_2_y=0.500 | |
| 221 | + shapecode_2_rad=0.03347 | |
| 222 | + shapecode_2_ang=0.00000 | |
| 223 | + shapecode_2_tex_ang=0.00000 | |
| 224 | + shapecode_2_tex_zoom=1.00000 | |
| 225 | + shapecode_2_r=1.000 | |
| 226 | + shapecode_2_g=1.000 | |
| 227 | + shapecode_2_b=1.000 | |
| 228 | + shapecode_2_a=1.000 | |
| 229 | + shapecode_2_r2=1.000 | |
| 230 | + shapecode_2_g2=1.000 | |
| 231 | + shapecode_2_b2=1.000 | |
| 232 | + shapecode_2_a2=0.000 | |
| 233 | + shapecode_2_border_r=1.000 | |
| 234 | + shapecode_2_border_g=1.000 | |
| 235 | + shapecode_2_border_b=1.000 | |
| 236 | + shapecode_2_border_a=0.000 | |
| 237 | + shape_2_init1=fran = 1; | |
| 238 | + shape_2_init2=xs = 1; | |
| 239 | + shape_2_init3=ys = 1; | |
| 240 | + shape_2_init4=xm = 0.5; | |
| 241 | + shape_2_init5=ym = 0.5; | |
| 242 | + shape_2_per_frame1=xs = xs*(1 - 2*above(xm,0.99) - 2*below(xm,0.01)); | |
| 243 | + shape_2_per_frame2=ys = ys*(1 - 2*above(ym,0.99) - 2*below(ym,0.01)); | |
| 244 | + shape_2_per_frame3= | |
| 245 | + shape_2_per_frame4=xm = xm + 0.03*xs*(sin(time*0.35)*0.5 + 0.5*cos(time*0.87)); | |
| 246 | + shape_2_per_frame5=ym = ym + 0.03*ys*(sin(time*0.92)*0.3 + 0.7*cos(time*0.26)); | |
| 247 | + shape_2_per_frame6= | |
| 248 | + shape_2_per_frame7=x = xm; | |
| 249 | + shape_2_per_frame8=y = ym; | |
| 250 | + shape_2_per_frame9= | |
| 251 | + shape_2_per_frame10=r = 0.5 + 0.5*sin(time*0.25); | |
| 252 | + shape_2_per_frame11=g = 0.5 + abs(r)*sin(time*0.5); | |
| 253 | + shape_2_per_frame12=b = 0.5 + abs(g)*sin(time); | |
| 254 | + shape_2_per_frame13=r2 = r; g2 = g; b2 = b; | |
| 255 | + shape_2_per_frame14=rad = 1.6*(bass_att + mid_att + treb_att)/3; | |
| 256 | + shapecode_3_enabled=0 | |
| 257 | + shapecode_3_sides=4 | |
| 258 | + shapecode_3_additive=0 | |
| 259 | + shapecode_3_thickOutline=0 | |
| 260 | + shapecode_3_textured=0 | |
| 261 | + shapecode_3_num_inst=1 | |
| 262 | + shapecode_3_x=0.500 | |
| 263 | + shapecode_3_y=0.500 | |
| 264 | + shapecode_3_rad=0.10000 | |
| 265 | + shapecode_3_ang=0.00000 | |
| 266 | + shapecode_3_tex_ang=0.00000 | |
| 267 | + shapecode_3_tex_zoom=1.00000 | |
| 268 | + shapecode_3_r=1.000 | |
| 269 | + shapecode_3_g=0.000 | |
| 270 | + shapecode_3_b=0.000 | |
| 271 | + shapecode_3_a=1.000 | |
| 272 | + shapecode_3_r2=0.000 | |
| 273 | + shapecode_3_g2=1.000 | |
| 274 | + shapecode_3_b2=0.000 | |
| 275 | + shapecode_3_a2=0.000 | |
| 276 | + shapecode_3_border_r=1.000 | |
| 277 | + shapecode_3_border_g=1.000 | |
| 278 | + shapecode_3_border_b=1.000 | |
| 279 | + shapecode_3_border_a=0.100 | |
| 280 | + per_frame_1=wave_r = wave_r + 0.400*( 0.60*sin(0.933*time) + 0.40*sin(1.045*time) ); | |
| 281 | + per_frame_2=wave_g = wave_g + 0.100*( 0.60*sin(0.900*time) + 0.40*sin(0.956*time) ); | |
| 282 | + per_frame_3=wave_b = wave_b + 0.100*( 0.60*sin(0.910*time) + 0.40*sin(0.920*time) ); | |
| 283 | + per_frame_4=mv_r = wave_r; | |
| 284 | + per_frame_5=mv_b = wave_b; | |
| 285 | + per_frame_6=mv_g = wave_g; | |
| 286 | + per_frame_7=q1 = 0.015*(pow(1+1.2*bass+0.4*bass_att+0.1*treb+0.1*treb_att+0.1*mid+0.1*mid_att,6)/fps); | |
| 287 | + per_frame_8=//q1 = 0.6*(bass+bass_att); | |
| 288 | + per_frame_9=mv_a = if(above(bass-1.2,1),1,bass-1.2); | |
| 289 | + per_pixel_1=zoom = 1.01 + rad*0.07*q1; | |
| 290 | + warp_1=`shader_body | |
| 291 | + warp_2=`{ | |
| 292 | + warp_3=` // PAINTERLY EFFECT: | |
| 293 | + warp_4=` float2 uv2 = uv; | |
| 294 | + warp_5=` const float mipbias = 0; | |
| 295 | + warp_6=` float2 delta2 = texsize.zw*float2(1,1); | |
| 296 | + warp_7=` float3 blurry_color = tex2D( sampler_main, uv2 + delta2 ).xyz; | |
| 297 | + warp_8=` uv2.xy += (blurry_color.xy-0.37) * 0.03; | |
| 298 | + warp_9=` | |
| 299 | + warp_10=` // sample previous frame | |
| 300 | + warp_11=` ret = tex2D( sampler_main, uv2 ).xyz; | |
| 301 | + warp_12=` | |
| 302 | + warp_13=` // darken over time | |
| 303 | + warp_14=` ret -= 0.004; | |
| 304 | + warp_15=`} |
6685 more files changed.