Skip to content

Instantly share code, notes, and snippets.

Gizmo {
name Noise_3D
inputs 2
help "Generate Noise in 3D space based on Position passes. It includes pre-made Position passes for some 3D primitives, or can use a custom pass. Uses a 4D noise internally so that the 4th dimension can be used to add a 'boiling' effect"
addUserKnob {20 noise3d l "3D Noise"}
addUserKnob {4 mapping l Mapping t "Generates a Noise based on a 3D shape, unfolded to fit into a UV plane.\n\nThe Custom P Input lets you input the shape of your choice. Using a pWorld pass as cutom P will generate a 3D noise as seen from the same camera as used to render the Pworld. Ensure an Alpha channel is present for Custom P." M {"Card (Flat)" Spherical "Cylindrical (Tile X)" "Cylinder 4D (Tile X and Y)" "Custom P Input" "" ""}}
addUserKnob {26 ""}
addUserKnob {41 translate T Axis_3D.translate}
addUserKnob {41 rotate T Axis_3D.rotate}
addUserKnob {41 scaling l scale T Axis_3D.scaling}
@herronelou
herronelou / irradiance_map.cpp
Last active July 9, 2019 16:27
WIP irradiance map blinkscript, has pinching issues. Adapted from https://learnopengl.com/PBR/IBL/Diffuse-irradiance
inline float3 uv_to_sphere(const float2 uv, const float2 image_size)
{
float2 st = (uv+float2(0.5f)) / image_size;
float latitude = (st.y - 0.5f) * PI;
float longitude = (st.x - 0.5f) * 2 * PI;
float radiusAtLat = cos(latitude);
float3 normal;
normal.x = radiusAtLat * cos(longitude);
normal.y = sin(latitude);
normal.z = radiusAtLat * sin(longitude);
@herronelou
herronelou / particle_setup.nk
Created May 20, 2019 07:21
Custom particle setup
Group {
name Point_Radial_Force
label "\[value strength]"
selected true
xpos 490
ypos -269
addUserKnob {20 User}
addUserKnob {7 strength l Strength}
strength -1
}