This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ////////////////////// | |
| // Dynamic Performance Scaling | |
| static float perfGpuSmoothed = 0; | |
| static float perfCurrentScale = 0; | |
| /// <summary>Dynamically adjusts Renderer.ViewportScaling based on GPU | |
| /// performance relative to the display's refresh rate budget. Call this | |
| /// each frame to maintain smooth performance.</summary> | |
| /// <param name="targetUtilization">Fraction of the GPU frame budget to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace StereoKit.Framework | |
| { | |
| class XrRefreshRate : IStepper | |
| { | |
| int _rate; | |
| public bool Enabled { get; private set; } | |
| public XrRefreshRate() : this(0) { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static void LogModelInfo(Model m) | |
| { | |
| Log.Info($"Model: {m.Id}"); | |
| int vertCount = 0; | |
| int triCount = 0; | |
| foreach (ModelNode n in m.Visuals) | |
| { | |
| Mesh mesh = n.Mesh; | |
| vertCount += mesh.VertCount; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This is a QUADRANTIFIED shader, and should be used with QUADRANTIFIED meshes | |
| // only. Queadrantified meshes are commonly found in StereoKit's UI. | |
| #include "stereokit.hlsli" | |
| //--frost_level = 1 | |
| //--frost_blend = 0.1 | |
| int frost_level; | |
| float frost_blend; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| // The authors below grant copyright rights under the MIT license: | |
| // Copyright (c) 2024 Nick Klingensmith | |
| using System; | |
| namespace StereoKit.Framework | |
| { | |
| /// <summary> Don't know which to use? Try SoftOut! It's a great default! | |
| /// This site is a great reference for how these functions look: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stereokit.hlsli> | |
| //--color:color = 1,1,1,1 | |
| //--tex_scale = 1 | |
| //--diffuse = white | |
| float4 color; | |
| float tex_scale; | |
| Texture2D diffuse : register(t0); | |
| SamplerState diffuse_s : register(s0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This function will restore the StereoKit theme used in versions prior to | |
| // v0.3.9. | |
| // This also requires the previous UI shaders, you will need to copy them and | |
| // add them to your project's Assets. This file references them as: | |
| // ui.hlsl - https://github.com/StereoKit/StereoKit/blob/646afeef576a2f04103b0b99e2ee932cffa814b4/StereoKitC/shaders_builtin/shader_builtin_ui.hlsl | |
| // ui_quadrant.hlsl - https://github.com/StereoKit/StereoKit/blob/646afeef576a2f04103b0b99e2ee932cffa814b4/StereoKitC/shaders_builtin/shader_builtin_ui_quadrant.hlsl | |
| static void ApplyTheme_SKPrevious() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "stereokit.hlsli" | |
| //--color:color = 1, 1, 1, 1 | |
| //--grid_size = 0.004 | |
| //--dot_percent = 0.1 | |
| //--show_radius = 0.04 | |
| float4 color; | |
| float grid_size; | |
| float dot_percent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Linq; | |
| using StereoKit; | |
| class BinMesh { | |
| const uint binMeshIdentifier = 0x06b8d800; // a nice blue color | |
| const uint binMeshVersion = 0x00000001; // and then a version, should never make it to 255! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Linq; | |
| using System.Reflection; | |
| namespace StereoKit.Framework | |
| { | |
| /////////////////////////////////////////// | |
| abstract class InspectorAttribute : Attribute |
NewerOlder