Skip to content

Instantly share code, notes, and snippets.

View khairul169's full-sized avatar
๐Ÿ€
Active

Khairul Hidayat khairul169

๐Ÿ€
Active
View GitHub Profile
@khairul169
khairul169 / MeshCustomMaterial.js
Created April 15, 2020 23:09 — forked from mattdesl/MeshCustomMaterial.js
Custom mesh standard material with glslify + ThreeJS r83dev
const glslify = require('glslify');
const path = require('path');
// This is the original source, we will copy + paste it for our own GLSL
// const vertexShader = THREE.ShaderChunk.meshphysical_vert;
// const fragmentShader = THREE.ShaderChunk.meshphysical_frag;
// Our custom shaders
const fragmentShader = glslify(path.resolve(__dirname, 'standard.frag'));
const vertexShader = glslify(path.resolve(__dirname, 'standard.vert'));
@khairul169
khairul169 / p2p.c
Created December 12, 2019 15:11 — forked from mpatraw/p2p.c
Simple P2P example using ENet.
/*
* p2p.c
*/
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <enet/enet.h>
shader_type spatial;
render_mode shadows_disabled;
uniform float rim = 0.25;
uniform float rim_tint = 0.5;
uniform sampler2D albedo : hint_albedo;
uniform float specular;
uniform float roughness = 1.0;
uniform bool disable_lighting = false;
uniform vec4 shadow_color : hint_color;