Skip to content

Instantly share code, notes, and snippets.

View sergiobd's full-sized avatar

Sergio Bromberg sergiobd

View GitHub Profile
@sergiobd
sergiobd / Dockerfile
Created September 4, 2023 07:46
Dockerfile for 3D Gaussian splatting
## Unofficial Dockerfile for 3D Gaussian Splatting for Real-Time Radiance Field Rendering
## Bernhard Kerbl, Georgios Kopanas, Thomas Leimkühler, George Drettakis
## https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/
# Use the base image with PyTorch and CUDA support
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel
# NOTE:
# Building the libraries for this repository requires cuda *DURING BUILD PHASE*, therefore:
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
* @author erich666 / http://erichaines.com
*/
// This set of controls performs orbiting, dollying (zooming), and panning.
// Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default).
/*
Utility function for looping (deeply) through all children in a transform
Usage:
List<Transform> childs = new List<Transform>();
Utilities.GetAllChildren(queryParent.transform, ref childs);
*/
@sergiobd
sergiobd / Skybox6-ArbitraryRotation
Created November 10, 2018 17:57
Unity skybox 6-sided with arbitrary rotation axis
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Edited from Unity built-in, copied rotation function from here: http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/
Shader "Skybox/6 Sided - Arbitrary Rotation" {
Properties {
_Tint ("Tint Color", Color) = (.5, .5, .5, .5)
[Gamma] _Exposure ("Exposure", Range(0, 8)) = 1.0
_Rotation ("Rotation", Range(0, 360)) = 0
_RotationAxis("Rotation axis", Vector) = (0, 1, 0)
[NoScaleOffset] _FrontTex ("Front [+Z] (HDR)", 2D) = "grey" {}
[NoScaleOffset] _BackTex ("Back [-Z] (HDR)", 2D) = "grey" {}
@sergiobd
sergiobd / CopyOpenVR.cs
Last active January 2, 2019 06:19
A script that will copy openvr dll to your project on post-build.
/*
Copyright 2019 , Sergio Bromberg
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// For use with the holographic projection tutorial at www.sbromberg.co
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CreateSmallCube : MonoBehaviour {
public Transform cubeParent;
void Update () {
@sergiobd
sergiobd / BatchConvertVideos.ps1
Last active June 12, 2024 13:40
Batch convert videos using ffmpeg and powershell
# Script to convert a list of files using ffmpeg and powershell. This example converts to .ogv files (theora/vorbis as video/audio codecs)
# Please note that, if you havent done so, you should set the execution policy of powershell in order to be able to run this script.
# The easiest way to run this script without messing to much with execution policies is to set it for a single powershell session:
# powershell.exe -ExecutionPolicy Unrestricted
# Check: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies
$filenames = "1","2", "3", "4", "5","6","7"
$filepath = "C:\Users\Oculus\Documents\Videos\Menu\"
$extension = ".mp4"
@sergiobd
sergiobd / ChromaShader.shader
Created June 25, 2018 23:55
Simplest chroma shader
// Simple chroma shader. Will remove colors whose RGB values lie in the range of [_ColorInf, _ColorSup]
// This is a surface shader. It assumes you are interested in having a lit video, that (possibly) lives in world space.
Shader "Custom/ChromaShader" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_ColorInf ("Color Inf", Color) = (1,1,1,1)
_ColorSup ("Color Sup", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5