Skip to content

Instantly share code, notes, and snippets.

View BlurryLight's full-sized avatar
🎯
Focusing on RealtimeRendering

BlurryLight BlurryLight

🎯
Focusing on RealtimeRendering
View GitHub Profile
@BlurryLight
BlurryLight / ISM.patch
Created September 15, 2023 16:09
UE4.26 ISM FP32 support
---
.../Components/InstancedStaticMeshComponent.h | 5 +++++
.../Runtime/Engine/Private/InstancedStaticMesh.cpp | 13 +++++++++++--
.../Runtime/Engine/Public/StaticMeshResources.h | 3 ++-
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/Engine/Source/Runtime/Engine/Classes/Components/InstancedStaticMeshComponent.h b/Engine/Source/Runtime/Engine/Classes/Components/InstancedStaticMeshComponent.h
index d6694d8ce..af60349c1 100644
--- a/Engine/Source/Runtime/Engine/Classes/Components/InstancedStaticMeshComponent.h
+++ b/Engine/Source/Runtime/Engine/Classes/Components/InstancedStaticMeshComponent.h
@BlurryLight
BlurryLight / cvar_list_426.txt
Last active August 17, 2023 03:11
UE Dump console variable list
a.AnimNode.AimOffsetLookAt.Debug
a.AnimNode.AimOffsetLookAt.Enable
a.AnimNode.Inertialization.Enable
a.AnimNode.Inertialization.IgnoreDeficit
a.AnimNode.Inertialization.IgnoreVelocity
a.AnimNode.LegIK.AveragePull
a.AnimNode.LegIK.Debug
a.AnimNode.LegIK.Enable
a.AnimNode.LegIK.EnableTwoBone
a.AnimNode.LegIK.MaxIterations
{
"Name": "AlembicImporter",
"Enabled": false
},
{
"Name": "AppleMoviePlayer",
"Enabled": false
},
{
"Name": "AppleImageUtils",
@BlurryLight
BlurryLight / fixed_vector.hh
Created June 26, 2023 15:53
fixed (pmr) vector by fixed-size allocator
template <class T, size_t N> struct limited_allocator : std::allocator<T> {
using value_type = typename std::allocator<T>::value_type;
using size_type = typename std::allocator<T>::size_type;
size_type max_size() const noexcept { return N; }
template <class Other> struct rebind {
typedef limited_allocator<Other, N> other;
};
// make msvc happy
template <class Other, size_t M> constexpr operator limited_allocator<Other, M>() const noexcept {
@BlurryLight
BlurryLight / qrenderdoc.pyi
Created June 17, 2023 09:08
RenderDoc Python API Stubs
from typing import Any, ClassVar
from typing import overload
import collections
import enum
import importlib._bootstrap
class APIInspector(SwigPyObject):
this: Any
thisown: Any
@BlurryLight
BlurryLight / AlterMaterialParameter.cpp
Created June 11, 2023 07:21
Simple Logic about replacing Material nodes in UE
void AlterMaterialParameter_Simple(UMaterial* Mat)
{
UTexture2DArrayFactory* Texture2DArrayFactory = NewObject<UTexture2DArrayFactory>();
UTexture2DArray* DummyTex = Cast<UTexture2DArray>(Texture2DArrayFactory->FactoryCreateNew(UTexture2DArray::StaticClass(),Mat,NAME_None,RF_Standalone | RF_Transactional,nullptr,GWarn));
TArray<UMaterialExpressionTextureSampleParameter* > ParamsTextureSamples;
for (int32 ExpressionIndex = 0; ExpressionIndex < Mat->Expressions.Num(); ExpressionIndex++)
{
auto* ExpressionPtr = Cast<UMaterialExpressionTextureSampleParameter>(Mat->Expressions[ExpressionIndex]);
if (ExpressionPtr)
{
@BlurryLight
BlurryLight / HBAO.cginc
Last active March 23, 2023 22:11
Unity Naive HBAO
#ifndef HBAO_CGINC
#define HBAO_CGINC
#include "UnityCG.cginc"
sampler2D _MainTex;
float4 _MainTex_TexelSize;
half4x4 _WorldToViewMatrix;
struct appdata
@BlurryLight
BlurryLight / naive_bind.cc
Created October 1, 2022 09:34
naive bind c++17
// https://godbolt.org/z/7hefs586j
#include <functional>
#include <tuple>
#include <iostream>
template <size_t n> using index_constant = std::integral_constant<size_t, n>;
template<class ... Args>
class callee_list
{
public:
template<class ... TArgs>
@BlurryLight
BlurryLight / Bloom.shader
Created June 7, 2022 06:40 — forked from CarlLee/Bloom.shader
UE4 bloom for unity
Shader "Hidden/Bloom"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
HLSLINCLUDE
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
struct appdata
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.