Skip to content

Instantly share code, notes, and snippets.

View olamedia's full-sized avatar
:octocat:
Working from home

olamedia olamedia

:octocat:
Working from home
  • Russian Federation
View GitHub Profile
@olamedia
olamedia / trace2.c
Last active December 11, 2015 00:58
[ru.olamedia.postprocessing.FilterChainRenderer] renderScene
glBindFramebuffer(<int> 0x8D40, <int> 0x2) // RENDER TO FBO #2
glClearColor(<float> 0.0, <float> 0.0, <float> 0.4, <float> 0.0)
glClear(<int> 0x4100)
glDisable(<int> 0xB71)
glDisable(<int> 0xBE2)
glEnable(<int> 0xDE1)
glBindTexture(<int> 0xDE1, <int> 0x3) // USE IMAGE (#3)
glBegin(<int> 0x7)
// QUAD
package ru.olamedia.postprocessing;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLContext;
import com.jogamp.opengl.util.glsl.ShaderCode;
import com.jogamp.opengl.util.glsl.ShaderProgram;
import com.jogamp.opengl.util.glsl.ShaderState;
public abstract class BaseShaderFilter implements IShaderFilter {
@olamedia
olamedia / trace.c
Last active December 10, 2015 22:58
glBindFramebuffer(<int> 0x8D40, <int> 0x2) // bind secondary FBO (GL.GL_FRAMEBUFFER) secondaryFBO.bind(gl);
[ru.olamedia.postprocessing.FilterRenderer] renderSourceToFBO
[ru.olamedia.olacraft.scene.ImageScreen] renderScene <--------
glClearColor(<float> 0.0, <float> 0.0, <float> 0.4, <float> 0.0)
glClear(<int> 0x4100)
glDisable(<int> 0xB71)
glDisable(<int> 0xBE2)
glEnable(<int> 0xDE1)
glBindTexture(<int> 0xDE1, <int> 0x3) // BIND TEXTURE3 (SCENE IMAGE)
package ru.olamedia.postprocessing;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLContext;
import com.jogamp.common.nio.Buffers;
import com.jogamp.opengl.FBObject;
import com.jogamp.opengl.util.PMVMatrix;
package ru.olamedia.olacraft.scene;
import javax.media.opengl.GL2;
import javax.media.opengl.GLContext;
import com.jogamp.opengl.util.texture.Texture;
import ru.olamedia.postprocessing.IRenderer;
import ru.olamedia.postprocessing.Screen;
import ru.olamedia.texture.TextureManager;
package ru.olamedia.postprocessing;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLContext;
import com.jogamp.opengl.FBObject;
import com.jogamp.opengl.FBObject.Attachment;
import com.jogamp.opengl.FBObject.TextureAttachment;
/**
* Copyright 2012 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
smooth in vec2 texCoord;
varying vec4 lightColor;
uniform sampler2D mesh_ActiveTexture;
void main (void)
{
vec4 texColor;
//precision lowp float;
//precision lowp int;
uniform mat4 pmvMatrix[4]; // P, Mv, Mvi and Mvit
uniform vec4 sunColor;
uniform sampler2D mesh_ActiveTexture;
attribute vec4 mesh_vertices;
attribute vec4 mesh_colors;
attribute vec2 mesh_texCoord;
/**
* Copyright 2012 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list