Skip to content

Instantly share code, notes, and snippets.

View marcusbirkeland's full-sized avatar

Marcus Benjamin Ravnå Birkeland marcusbirkeland

  • NTNU
  • Norway
View GitHub Profile
@marcusbirkeland
marcusbirkeland / CRT.hlsl
Created October 4, 2021 05:27
Unity CRT Shader
Shader "Unlit/CRT"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
[HDR] _ImageColor("Image Color", Color) = (1,1,1,1)
[HDR] _TintColor1("CRT TintColor", Color) = (1,1,1,1)
[HideInInspector][HDR] _TintColor2("TintColor2", Color) = (1,1,1,1)
_CRTAmount("CRT Amount", Range(0.0,0.5)) = 0.5
_CRTResolution("Resolution", Range(1.0,8.0)) = 1.2
@marcusbirkeland
marcusbirkeland / ddsToPng.bat
Created September 10, 2021 04:11
[Texconv]Convert dds to png
for %%f in (*.dds) do (
echo %%~nf
texconv %%f -ft png -y
)
@marcusbirkeland
marcusbirkeland / ubulkFixer.py
Last active September 10, 2021 11:13
[Umodel/NMH3 ] WIP NMH3 texture fixer script. credit: CABALEX
import os
from shutil import move
def findBlocksize(filesize):
print("Filesize for loaded file: " , filesize)
d = {
# texture w/h -> blocksize
# 0 = UNKNOWN
@marcusbirkeland
marcusbirkeland / LODdelete.py
Created September 10, 2021 03:48
[Nier2Blender] Deleting all low LOD objects
import bpy
for obj in bpy.data.objects:
if(obj['LOD_Level'] != 0):
obj.select_set(True)
bpy.ops.object.delete()
@marcusbirkeland
marcusbirkeland / renameXAP.py
Last active September 10, 2021 03:49
[Kaineconv] Add XAP extensions to tex_ files
import os
import re
dir_path = os.path.dirname(os.path.realpath(__file__))
def rename(f):
os.rename(dir_path+'\\'+f ,dir_path+'\\'+f+'.xap')
files = [f for f in os.listdir(dir_path) if os.path.isfile(os.path.join(dir_path,f))]
@marcusbirkeland
marcusbirkeland / separateChannels.bat
Last active September 10, 2021 03:49
[Imagemagick] Separate rgb channels
for %%f in (*.png, *.tga) do (
echo %%~nf
magick convert %%f -channel R -separate %%f_r.png
magick convert %%f -channel G -separate %%f_g.png
magick convert %%f -channel B -separate %%f_b.png
)