Skip to content

Instantly share code, notes, and snippets.

@FrankRicharrd
FrankRicharrd / pbr.frag
Last active November 23, 2023 02:59
Physically based rendering using openscenegraph
#version 330 core
out vec4 FragColor;
in vec2 TexCoords;
in vec3 WorldPos;
in vec3 Normal;
// material parameters
uniform vec3 albedo;
uniform float metallic;
uniform float roughness;
@FrankRicharrd
FrankRicharrd / main.cpp
Last active April 6, 2022 14:25
Multiple lights in openscenegraph using GLSL shaders
//multiplelights.vert
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aNormal;
layout (location = 3) in vec4 aTexCoords;
@Hebali
Hebali / GlslSobel.frag
Created January 12, 2017 17:25
GLSL Fragment Shader: Sobel Edge Detection
// Sobel Edge Detection Filter
// GLSL Fragment Shader
// Implementation by Patrick Hebron
uniform sampler2D texture;
uniform float width;
uniform float height;
void make_kernel(inout vec4 n[9], sampler2D tex, vec2 coord)
{
@rcolinray
rcolinray / gl_ffmpeg.cpp
Created November 19, 2013 20:54
OpenGL-FFMpeg integration
// Use OpenGL 3.0+, but don't use GLU
#define GLFW_INCLUDE_GL3
#define GLFW_NO_GLU
#include <GL/glfw.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
extern "C" {