Skip to content

Instantly share code, notes, and snippets.

View est77's full-sized avatar

Esteban Tovagliari est77

View GitHub Profile
0.01 0.2001
0.20202 1.3001
0.40404 2.1001
0.606061 2.8001
0.808081 3.3001
1.0101 3.8001
1.21212 4.3001
1.41414 4.7001
1.61616 5.1001
1.81818 5.4001
0.0538163,
0.0590581,
0.0628132,
0.0659693,
0.0687794,
0.0713581,
0.0737684,
0.0760496,
0.0782278,
0.0803216,
// two C1
template <typename T>
inline T fresnel_first_moment(const T eta)
{
return
eta < T(1.0)
? T(0.919317) + eta * (T(-3.4793) + eta * (T(6.75335) + eta * (T(-7.80989) + eta * (T(4.98554) - eta * T(1.36881)))))
: T(-9.23372) + eta * (T(22.2272) + eta * (T(-20.9292) + eta * (T(10.2291) + eta * (T(-2.54396) + eta * T(0.254913)))));
}
# CMake-gui popup menu.
set (USE_SIMD "OFF" CACHE STRING "Enable SIMD")
set_property (CACHE USE_SIMD PROPERTY STRINGS OFF SSE2 SSE4.2 AVX)
@est77
est77 / ase_reader.py
Created September 19, 2013 07:49
Parses Adobe swatch exchange files (color palettes).
#!/usr/bin/env python
# coding: utf-8
# Based on SwatchBooker code. Original license follows
#
# Copyright 2008 Olivier Berten <olivier.berten@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@est77
est77 / mesh_from_deform
Created September 23, 2013 02:25
Getting input geom from Maya deformer
MStatus SomeDeformer::deform( MDataBlock& data, MItGeometry& itGeo, const MMatrix &localToWorldMatrix, unsigned int geomIndex )
{
MStatus status;
MArrayDataHandle hInput = data.outputArrayValue( input, &status );
CHECK_MSTATUS_AND_RETURN_IT( status )
status = hInput.jumpToElement( geomIndex );
CHECK_MSTATUS_AND_RETURN_IT( status )
MObject oInputGeom = hInput.outputValue().child( inputGeom ).asMesh();
MFnMesh fnInputMesh( oInputGeom );
}
@est77
est77 / gafferseed_area_light.gfr
Created August 8, 2016 19:08
gafferseed area light
import Gaffer
import GafferAppleseed
import GafferDispatch
import GafferImage
import GafferOSL
import GafferScene
import IECore
Gaffer.Metadata.registerNodeValue( parent, "serialiser:milestoneVersion", 0, persistent=False )
Gaffer.Metadata.registerNodeValue( parent, "serialiser:majorVersion", 27, persistent=False )
@est77
est77 / build.sh
Last active March 2, 2017 15:05
build appleseed linux
export APPLESEED_DEPENDENCIES="..."
export CMAKE_INCLUDE_PATH=$APPLESEED_DEPENDENCIES/include
export CMAKE_LIBRARY_PATH=$APPLESEED_DEPENDENCIES/lib
export LD_LIBRARY_PATH=$APPLESEED_DEPENDENCIES/lib
mkdir build
cd build
cmake \
import appleseed as asr
mesh = asr.MeshObject("my_mesh", {})
print mesh
# Vertices
v0 = asr.Vector3f([0.0, 0.0, 0.0])
v1 = asr.Vector3f([1.0, 0.0, 0.0])
v2 = asr.Vector3f([0.0, 0.0, 1.0])
@est77
est77 / compressed_unit_vector.cpp
Created September 1, 2017 14:23
Compressed unit vectors
/*
Reference:
----------
A Survey of Efficient Representations for Independent Unit Vectors
*/
#include <cmath>
#include <cstdint>
#include <iostream>