- Designing a Modern GPU Interface by @BrookeHodgman
- Optimizing the Graphics Pipeline with Compute by @gwihlidal
- GPU Driven Rendering Pipelines by @SebAaltonen
- Destiny’s Multi-threaded Renderer Architecture by @Mirror2Mask
- Stingray Renderer Walkthrough by @tobias_persson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
internal static class MergeSort<T> { | |
public static void Sort (List<T> list, Comparison<T> comparison) { | |
if (list.Count <= 1) | |
return; | |
var mid = list.Count / 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME! | |
// However, if you want to author shaders in shading language you can use this teamplate as a base. | |
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader. | |
// This shader works with URP 7.1.x and above | |
Shader "Universal Render Pipeline/Custom/Physically Based Example" | |
{ | |
Properties | |
{ | |
// Specular vs Metallic workflow | |
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct CpuGpuTimestampInfo { | |
VkDevice device; | |
VkQueue queue; | |
uint32_t queue_family_index; | |
float timestamp_period; // Copy from VkPhysicalDeviceLimits::timestampPeriod | |
uint32_t timestamp_valid_bits; // Copy from VkQueueFamilyProperties::timestampValidBits | |
}; | |
VkResult GetCpuGpuTimestamp(const CpuGpuTimestampInfo *info, | |
std::chrono::high_resolution_clock::time_point *out_cpu_time, uint64_t *out_gpu_time) { | |
if (info->timestamp_valid_bits == 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Runtime.CompilerServices; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Unity.Jobs; | |
public static class JobHelper | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Hidden/Bloom" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
} | |
HLSLINCLUDE | |
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl" | |
struct appdata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MarchingCubesGPU.cs: | |
... | |
// DrawProceduralIndirect | |
ComputeBuffer argsBuffer; | |
[StructLayout(LayoutKind.Sequential)] | |
struct DrawCallArgBuffer | |
{ | |
public const int size = | |
sizeof(int) + | |
sizeof(int) + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "EditorUtilityWidgetBlueprint.h" | |
#include "EditorUtilitySubsystem.h" | |
UObject * Blueprint = UEditorAssetLibrary::LoadAsset(FString(TEXT("EditorUtilityWidgetBlueprint'/Game/EditorUtilities/MyWidget.MyWidget'"))); | |
if(IsValid(Blueprint)) { | |
UEditorUtilityWidgetBlueprint* EditorWidget = Cast<UEditorUtilityWidgetBlueprint>(Blueprint); | |
if (IsValid(EditorWidget)) { | |
UEditorUtilitySubsystem* EditorUtilitySubsystem = GEditor->GetEditorSubsystem<UEditorUtilitySubsystem>(); | |
EditorUtilitySubsystem->SpawnAndRegisterTab(EditorWidget); | |
} |