Skip to content

Instantly share code, notes, and snippets.

@josemorval
josemorval / __main.lua
Last active January 26, 2024 01:11
voxelizer in lazyengine
require("lualibs.vec")
function init()
-- get usual variables
global_t = get_time()
delta_t = get_delta_time()
screenx,screeny = get_window_size()
mouseposx,mouseposy = imgui_getmousepos()
@josemorval
josemorval / _main.cpp
Last active December 19, 2023 10:50
Lazy DX11 Engine
//Lazy DX11 Engine
//Lazy because: not errors checking
//Shaders must be in "shaders" folder
//It's necessary several imgui files from
//https://github.com/ocornut/imgui/tree/master
//Mainly imgui*.h (from root), backend DX11 and win32 files and misc folder
#include "lib3d.h"
#include "libmath.h"
#include "meshdata.h"
/*
Solution to Project Euler 729 problem
https://projecteuler.net/problem=729
output program (last one)
=========================
308896374.25023192167282
*/
#include <stdio.h>
using UnityEngine;
using System.Collections;
public class ConversationManager : MonoBehaviour {
GameObject go1;
GameObject go2;
GameObject go3;
public Transform answerAnchorHide;
using UnityEngine;
using System.Collections;
public class GameManager : MonoBehaviour {
public bool gameFinished = false;
int numLigadas = 0;
int numReports = 0;
//FROM TOKERU HOUDINI BLOG
matrix morig = ident();
matrix3 mrotate = ident();
vector axis, pos, origin;
float angle, d, max;
// get control transform
morig = primintrinsic(1,'packedfulltransform',0);
// move the grid to the inverse of that position
@josemorval
josemorval / ffmpegcombine
Last active March 11, 2020 20:43
ffmpeg combine videos
WINDOWS
=======
(for %i in (*.mp4) do @echo file '%i') > mylist.txt
ffmpeg -f concat -i mylist.txt -c copy output.mp4
LINUX/MAC
=========
#!/bin/bash
for filename in *.mp4; do
echo "file '$filename'" >> concat-list.txt
//COMPUTE SHADER
#define NUM_THREADS 8
//Common variables
float4 _Size;
float _DeltaTime;
float _Dissipate;
float _Decay;
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
Shader "Unlit/VolumeMarching"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//Protoype of Free-Form Deformation based on http://faculty.cs.tamu.edu/schaefer/teaching/689_Fall2006/p151-sederberg.pdf
public class FFDModifier : MonoBehaviour
{
public GameObject modelObject;
public GameObject ffdGizmo;
public int divX;