Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
010d2efd4e | ||
|
|
fca44c91ae | ||
|
|
3ac24458f0 | ||
|
|
60b8630943 |
@@ -1,138 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Imgur</title>
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
|
||||
<meta name="copyright" content="Copyright 2016 Imgur, Inc." />
|
||||
<meta id="viewport" name="viewport" content="width=1280, user-scalable=yes" />
|
||||
<link rel="stylesheet" type="text/css" href="//s.imgur.com/min/sharePlayer.css?1473720239" />
|
||||
|
||||
<style type="text/css">
|
||||
#content, #video {
|
||||
width: 1280px;
|
||||
height: 720px;
|
||||
}
|
||||
|
||||
#chrome, #progress {
|
||||
width: 1280px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="alternate" type="application/json+oembed" href="http://api.imgur.com/oembed.json?url=http://i.imgur.com/9C2DZaI.gifv" title="Imgur GIF" />
|
||||
<link rel="alternate" type="application/xml+oembed" href="http://api.imgur.com/oembed.xml?url=http://i.imgur.com/9C2DZaI.gifv" title="Imgur GIF" />
|
||||
|
||||
<link rel="canonical" href="http://i.imgur.com/9C2DZaI.gifv" />
|
||||
|
||||
<meta property="og:site_name" content="Imgur" />
|
||||
<meta property="og:title" content="Imgur GIF" />
|
||||
<meta property="og:type" content="video.other" />
|
||||
<meta property="og:url" content="https://i.imgur.com/9C2DZaI.mp4" />
|
||||
<meta property="og:image" content="https://i.imgur.com/9C2DZaIh.jpg" />
|
||||
<meta property="og:description" content="Imgur: The most awesome images on the Internet." />
|
||||
<meta property="og:video:width" content="1280" />
|
||||
<meta property="og:video:height" content="720" />
|
||||
<meta property="og:video" content="https://i.imgur.com/9C2DZaI.mp4" />
|
||||
<meta property="og:video:secure_url" content="https://i.imgur.com/9C2DZaI.mp4" />
|
||||
<meta property="og:video:type" content="video/mp4" />
|
||||
|
||||
|
||||
<meta name="twitter:site" content="@imgur" />
|
||||
<meta name="twitter:domain" content="imgur.com" />
|
||||
<meta name="twitter:app:id:googleplay" content="com.imgur.mobile" />
|
||||
<meta name="twitter:card" content="player" />
|
||||
<meta name="twitter:title" content="Imgur GIF" />
|
||||
<meta name="twitter:description" content="Imgur: The most awesome images on the Internet." />
|
||||
<meta name="twitter:image" content="https://i.imgur.com/9C2DZaIh.jpg" />
|
||||
<meta name="twitter:player" content="https://i.imgur.com/9C2DZaI.gifv?twitter#t" />
|
||||
<meta name="twitter:player:width" content="1280" />
|
||||
<meta name="twitter:player:height" content="720" />
|
||||
<meta name="twitter:player:stream" content="https://i.imgur.com/9C2DZaI.mp4" />
|
||||
<meta name="twitter:player:stream:content_type" content="video/mp4">
|
||||
|
||||
<!--[if lte IE 8]><script type="text/javascript" src="//s.imgur.com/min/iepoly.js?1473720239"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body id="body">
|
||||
<div id="content">
|
||||
<script type="text/javascript">
|
||||
window.image = '9C2DZaI';
|
||||
window.image_size = '30908885';
|
||||
window.image_width = '1280';
|
||||
window.image_height = '720';
|
||||
window.cdn_url = '//i.imgur.com';
|
||||
|
||||
if(navigator.userAgent.match(/Firefox/)) {
|
||||
document.body.className = document.body.className + ' firefox';
|
||||
}
|
||||
</script>
|
||||
<div class="vid-container">
|
||||
|
||||
|
||||
|
||||
<div class="post-image">
|
||||
|
||||
|
||||
<div class="video-container">
|
||||
<script type="text/javascript">
|
||||
var videoItem = {
|
||||
looping: true,
|
||||
width: 1280,
|
||||
height: 720,
|
||||
size: 30908885,
|
||||
gifUrl: '//i.imgur.com/9C2DZaI.gif',
|
||||
forceGif: false,
|
||||
prefer_video: true,
|
||||
hash: '9C2DZaI'
|
||||
}
|
||||
</script>
|
||||
<video poster="//i.imgur.com/9C2DZaIh.jpg" preload="auto" autoplay="autoplay" muted="muted" loop="loop" webkit-playsinline></video>
|
||||
<div class="video-elements">
|
||||
<source src="//i.imgur.com/9C2DZaI.mp4" type="video/mp4">
|
||||
</div>
|
||||
<progress value="0" max="100" min="0"></progress>
|
||||
<div class="video-loader"></div>
|
||||
<script id="script9C2DZaI" type="text/javascript" src="//s.imgur.com/min/imageViewerInline.js?1473720239"></script>
|
||||
|
||||
<meta itemprop="thumbnailUrl" content="https://i.imgur.com/9C2DZaIh.jpg" />
|
||||
<meta itemprop="contentURL" content="https://i.imgur.com/9C2DZaI.mp4" />
|
||||
<meta itemprop="embedURL" content="https://i.imgur.com/9C2DZaI.gifv" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var pixel_url = '//i.imgur.com/imageview.gif?a=9C2DZaI&r=' + encodeURIComponent(document.referrer);
|
||||
var pixel = document.createElement('img');
|
||||
pixel.src = pixel_url;
|
||||
</script>
|
||||
|
||||
<div id="chrome">
|
||||
<div class="icon">
|
||||
<a href="//imgur.com/9C2DZaI"><img src="//i.imgur.com/favicon.ico" /></a>
|
||||
</div>
|
||||
<div class="imgur">
|
||||
<a href="//imgur.com/9C2DZaI">Imgur</a>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<a href="//imgur.com/download/9C2DZaI">download</a>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="//s.imgur.com/min/sharePlayer.js?1473720239"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var _comscore = _comscore || [];
|
||||
_comscore.push({ c1: "2", c2: "7770950" });
|
||||
(function() {
|
||||
var s = document.createElement("script"), el = document.getElementsByTagName("script")[0]; s.async = true;
|
||||
s.src = (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js";
|
||||
el.parentNode.insertBefore(s, el);
|
||||
})();
|
||||
</script>
|
||||
<noscript>
|
||||
<img src="http://b.scorecardresearch.com/p?c1=2&c2=7770950&cv=2.0&cj=1" />
|
||||
</noscript>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 820 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 743 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 3.2 MiB |
|
Before Width: | Height: | Size: 31 KiB |
@@ -1,15 +1,16 @@
|
||||
// http://stackoverflow.com/questions/6005076/building-glew-on-windows-with-mingw
|
||||
|
||||
#define GLEW_STATIC
|
||||
#include <GL/glew.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <SDL2/SDL.h>
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
#include <dirent.h>
|
||||
#include "loaders.h"
|
||||
|
||||
int main(int argc, char* args[]) {
|
||||
GLFWwindow* window;
|
||||
GLuint texBG;
|
||||
GLuint texFG, texBG;
|
||||
int textw, texth;
|
||||
int textw2, texth2;
|
||||
|
||||
@@ -22,6 +23,7 @@ int main(int argc, char* args[]) {
|
||||
return 1;
|
||||
}
|
||||
/* Create a windowed mode window and its OpenGL context */
|
||||
glfwSetWindowSizeLimits(window, 640, 480, 640, 480);
|
||||
window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
|
||||
if (!window) {
|
||||
glfwTerminate();
|
||||
@@ -50,11 +52,6 @@ int main(int argc, char* args[]) {
|
||||
}
|
||||
// INIT
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// An array of 3 vectors which represents 3 vertices
|
||||
static const GLfloat g_vertex_buffer_data[] = {
|
||||
-1.0f, -1.0f, 0.0f, // (bottom - left ) TRIANGLE 1
|
||||
@@ -81,130 +78,93 @@ int main(int argc, char* args[]) {
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(g_vertex_buffer_data), g_vertex_buffer_data, GL_STATIC_DRAW);
|
||||
|
||||
// Identify our texture coordinate buffer
|
||||
// Identify our color buffer
|
||||
GLuint colorbuffer;
|
||||
glGenBuffers(1, &colorbuffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, colorbuffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(g_uv_buffer_data), g_uv_buffer_data, GL_STATIC_DRAW);
|
||||
|
||||
// The framebuffer, which regroups one texture, and zero depth buffer.
|
||||
// The framebuffer, which regroups 0, 1, or more textures, and 0 or 1 depth buffer.
|
||||
GLuint FramebufferName;
|
||||
glGenFramebuffers(1, &FramebufferName);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, FramebufferName);
|
||||
|
||||
// load foreground and background textures
|
||||
int lenTexFG = 1;
|
||||
GLint texFGs[lenTexFG];
|
||||
char buffer[50];
|
||||
|
||||
|
||||
|
||||
texBG = LoadTexture("../img/backgrounds/sky.jpg",&textw2,&texth2);
|
||||
for (int i=0; i<lenTexFG; i++) {
|
||||
snprintf(buffer, sizeof(buffer), "../img/foregrounds/original-reference/%d.jpg", i);
|
||||
texFGs[i] = LoadTexture(buffer,&textw,&texth);
|
||||
}
|
||||
|
||||
// Generate texture for frame buffer
|
||||
GLuint renderedTexture;
|
||||
glGenTextures(1, &renderedTexture);
|
||||
glBindTexture(GL_TEXTURE_2D, renderedTexture);
|
||||
// Load texture and set filtering
|
||||
glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB, textw, texth, 0,GL_RGB, GL_UNSIGNED_BYTE, 0);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
|
||||
// Set "renderedTexture" as our color attachment #2 (render to location 2)
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, renderedTexture, 0);
|
||||
// Set the list of draw buffers
|
||||
GLenum DrawBuffers[1] = {GL_COLOR_ATTACHMENT2};
|
||||
glDrawBuffers(1, DrawBuffers); // "1" is the size of DrawBuffers
|
||||
|
||||
// Always check that our frame buffer is ok
|
||||
if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
|
||||
return false;
|
||||
|
||||
// Set window size to texture size (window size, opengl context size, resize constraints)
|
||||
texFG = LoadTexture("../img/tests/flieger.jpg",&textw,&texth);
|
||||
printf("Tex1: %d\n", texFG);
|
||||
glfwSetWindowSize(window, textw, texth);
|
||||
glViewport(0, 0, textw, texth);
|
||||
glfwSetWindowSizeLimits(window, textw, texth, textw, texth);
|
||||
|
||||
// Load shader programs
|
||||
GLuint progTrimapID = LoadShaders("trimap.vertexshader", "trimap.fragmentshader");
|
||||
GLuint progRefineID = LoadShaders("refinement.vertexshader", "refinement.fragmentshader");
|
||||
// The texture we're going to render to
|
||||
GLuint renderedTexture;
|
||||
glGenTextures(1, &renderedTexture);
|
||||
glBindTexture(GL_TEXTURE_2D, renderedTexture);
|
||||
|
||||
// Get shader locations for trimap shader
|
||||
GLint locTriTexForeground = glGetUniformLocation(progTrimapID, "foreground");
|
||||
GLint locTriPixWidth = glGetUniformLocation(progTrimapID, "pixWidth");
|
||||
GLint locTriPixHeight = glGetUniformLocation(progTrimapID, "pixHeight");
|
||||
glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB, textw, texth, 0,GL_RGB, GL_UNSIGNED_BYTE, 0);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
|
||||
// Get shader locations for refinement shader
|
||||
GLint locRefTexTrimap = glGetUniformLocation(progRefineID, "trimap");
|
||||
GLint locRefTexForeground = glGetUniformLocation(progRefineID, "foreground");
|
||||
GLint locRefTexBackground = glGetUniformLocation(progRefineID, "background");
|
||||
GLint locRefPixWidth = glGetUniformLocation(progRefineID, "pixWidth");
|
||||
GLint locRefPixHeight = glGetUniformLocation(progRefineID, "pixHeight");
|
||||
// Set "renderedTexture" as our colour attachement #2
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, renderedTexture, 0);
|
||||
// Set the list of draw buffers.
|
||||
GLenum DrawBuffers[1] = {GL_COLOR_ATTACHMENT2};
|
||||
glDrawBuffers(1, DrawBuffers); // "1" is the size of DrawBuffers
|
||||
|
||||
// Always check that our framebuffer is ok
|
||||
if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
|
||||
return false;
|
||||
|
||||
|
||||
GLuint programID = LoadShaders("trimap.vertexshader", "trimap.fragmentshader");
|
||||
GLuint programRefineID = LoadShaders("refinement.vertexshader", "refinement.fragmentshader");
|
||||
GLint textureLoc1 = glGetUniformLocation(programID, "myTextureSampler");
|
||||
GLint widthLoc = glGetUniformLocation(programID, "pixWidth");
|
||||
GLint heigthLoc = glGetUniformLocation(programID, "pixHeight");
|
||||
|
||||
|
||||
GLint textureLocTri = glGetUniformLocation(programRefineID, "trimap");
|
||||
GLint textureLocFore = glGetUniformLocation(programRefineID, "foreground");
|
||||
GLint textureLocBack = glGetUniformLocation(programRefineID, "background");
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, texFG);
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_2D, texBG);
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_2D, renderedTexture);
|
||||
|
||||
|
||||
printf("Shader program ID: %d\n", programID);
|
||||
printf("textureLoc1: %d\n", textureLoc1);
|
||||
printf("textureLocTri: %d\n", textureLocTri);
|
||||
//printf("textureLocFore: %d\n", textureLocFore);
|
||||
printf("widthLoc: %d\n", widthLoc);
|
||||
printf("heigthLoc: %d\n", heigthLoc);
|
||||
printf("Width: %f\n", 1.0f/textw);
|
||||
printf("Height: %f\n", 1.0f/texth);
|
||||
|
||||
|
||||
|
||||
// INIT END
|
||||
|
||||
int loopNumber = -1;
|
||||
double lastTime = glfwGetTime();
|
||||
double lastTimeLoop = glfwGetTime();
|
||||
int nbFrames = 0;
|
||||
|
||||
/* Loop until the user closes the window */
|
||||
while (!glfwWindowShouldClose(window)) {
|
||||
|
||||
|
||||
|
||||
// Measure speed
|
||||
double currentTime = glfwGetTime();
|
||||
nbFrames++;
|
||||
if ( currentTime - lastTime >= 1.0 ){
|
||||
// If last prinf() was more than 1 sec ago
|
||||
// printf and reset timer
|
||||
printf("%f ms/frame\n", 1000.0/double(nbFrames));
|
||||
nbFrames = 0;
|
||||
lastTime += 1.0;
|
||||
}
|
||||
|
||||
// Foreground texture counter
|
||||
if ( currentTime - lastTimeLoop >= 0.08 ){
|
||||
loopNumber++;
|
||||
if (loopNumber >= lenTexFG) {
|
||||
loopNumber = 0;
|
||||
}
|
||||
lastTimeLoop += 0.08;
|
||||
}
|
||||
|
||||
// Set current foreground texture
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, texFGs[loopNumber]);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* RENDER TO FRAMEBUFFER */
|
||||
|
||||
/* Render here */
|
||||
// Render to our framebuffer
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, FramebufferName);
|
||||
|
||||
// Clear buffer
|
||||
//glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
//glViewport(0,0,textw,texth); // Render on the whole framebuffer, complete from the lower left corner to the upper right
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// Init trimap shader program
|
||||
glUseProgram(progTrimapID);
|
||||
glUniform1f(locTriPixWidth, 1.0f/textw);
|
||||
glUniform1f(locTriPixHeight, 1.0f/texth);
|
||||
glUniform1i(locTriTexForeground, 0);
|
||||
glUseProgram(programID);
|
||||
glUniform1f(widthLoc, 1.0f/textw);
|
||||
glUniform1f(heigthLoc, 1.0f/texth);
|
||||
glUniform1i(textureLoc1, 0);
|
||||
|
||||
// 1st attribute buffer: vertices
|
||||
// 1rst attribute buffer : vertices
|
||||
glEnableVertexAttribArray(0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
|
||||
glVertexAttribPointer(
|
||||
@@ -215,7 +175,6 @@ int main(int argc, char* args[]) {
|
||||
0, // stride
|
||||
(void*)0 // array buffer offset
|
||||
);
|
||||
|
||||
// 2nd attribute buffer : colors
|
||||
glEnableVertexAttribArray(1);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, colorbuffer);
|
||||
@@ -229,33 +188,24 @@ int main(int argc, char* args[]) {
|
||||
);
|
||||
|
||||
|
||||
// Draw the triangles (and render trimap shaders) to framebuffer/texture
|
||||
// Draw the triangle !
|
||||
glDrawArrays(GL_TRIANGLES, 0, 2*3); // 2*3 indices starting at 0 -> 2 triangles -> 1 square
|
||||
|
||||
glDisableVertexAttribArray(0);
|
||||
glUseProgram(0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Render to the screen
|
||||
glUseProgram(0);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
glViewport(0,0,textw, texth); // Render on the whole framebuffer, complete from the lower left corner to the upper right
|
||||
|
||||
// Init refinement shader program
|
||||
glUseProgram(progRefineID);
|
||||
glUniform1i(locRefTexForeground, 0);
|
||||
glUniform1i(locRefTexBackground, 1);
|
||||
glUniform1i(locRefTexTrimap, 2);
|
||||
glUniform1f(locRefPixWidth, 1.0f/textw);
|
||||
glUniform1f(locRefPixHeight, 1.0f/texth);
|
||||
|
||||
// 1st attribute buffer : vertices
|
||||
glUseProgram(programRefineID);
|
||||
glUniform1i(textureLocTri, 2);
|
||||
glUniform1i(textureLocBack, 1);
|
||||
glUniform1i(textureLocFore, 0);
|
||||
|
||||
|
||||
// 1rst attribute buffer : vertices
|
||||
glEnableVertexAttribArray(0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
|
||||
glVertexAttribPointer(
|
||||
@@ -266,8 +216,7 @@ int main(int argc, char* args[]) {
|
||||
0, // stride
|
||||
(void*)0 // array buffer offset
|
||||
);
|
||||
|
||||
// 2nd attribute buffer : texture coordinates
|
||||
// 2nd attribute buffer : colors
|
||||
glEnableVertexAttribArray(1);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, colorbuffer);
|
||||
glVertexAttribPointer(
|
||||
@@ -280,7 +229,7 @@ int main(int argc, char* args[]) {
|
||||
);
|
||||
|
||||
|
||||
// Draw the triangles (and render refinement shaders) to screen
|
||||
// Draw the triangle !
|
||||
glDrawArrays(GL_TRIANGLES, 0, 2*3); // 2*3 indices starting at 0 -> 2 triangles -> 1 square
|
||||
glDisableVertexAttribArray(0);
|
||||
|
||||
|
||||
@@ -2,16 +2,15 @@
|
||||
1385320478 source:d:\owncloud\documents\programmierung\cpp\opengl-test-two\main.cpp
|
||||
<iostream>
|
||||
|
||||
1473869767 source:d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\main.cpp
|
||||
1473703631 source:d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\main.cpp
|
||||
<GL/glew.h>
|
||||
<GLFW/glfw3.h>
|
||||
<SDL2/SDL.h>
|
||||
<fstream>
|
||||
<stdexcept>
|
||||
<dirent.h>
|
||||
"loaders.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\glfw\glfw3.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\glfw\glfw3.h
|
||||
<stddef.h>
|
||||
<stdint.h>
|
||||
<OpenGL/gl3.h>
|
||||
@@ -32,7 +31,7 @@
|
||||
<GL/glext.h>
|
||||
<GL/glu.h>
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl.h
|
||||
"SDL_main.h"
|
||||
"SDL_stdinc.h"
|
||||
"SDL_assert.h"
|
||||
@@ -63,12 +62,12 @@
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_main.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_main.h
|
||||
"SDL_stdinc.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_stdinc.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_stdinc.h
|
||||
"SDL_config.h"
|
||||
<sys/types.h>
|
||||
<stdio.h>
|
||||
@@ -97,34 +96,34 @@
|
||||
<stdlib.h>
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_config.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_config.h
|
||||
"SDL_platform.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_platform.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_platform.h
|
||||
"AvailabilityMacros.h"
|
||||
"TargetConditionals.h"
|
||||
<winapifamily.h>
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\begin_code.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\begin_code.h
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\close_code.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\close_code.h
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_assert.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_assert.h
|
||||
"SDL_config.h"
|
||||
"begin_code.h"
|
||||
<signal.h>
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_atomic.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_atomic.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_platform.h"
|
||||
"begin_code.h"
|
||||
<mbarrier.h>
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_audio.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_audio.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"SDL_endian.h"
|
||||
@@ -134,24 +133,24 @@
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_error.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_error.h
|
||||
"SDL_stdinc.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_endian.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_endian.h
|
||||
"SDL_stdinc.h"
|
||||
<endian.h>
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_mutex.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_mutex.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_thread.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_thread.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"SDL_atomic.h"
|
||||
@@ -160,18 +159,18 @@
|
||||
<process.h>
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_rwops.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_rwops.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_clipboard.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_clipboard.h
|
||||
"SDL_stdinc.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_cpuinfo.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_cpuinfo.h
|
||||
"SDL_stdinc.h"
|
||||
<intrin.h>
|
||||
<intrin.h>
|
||||
@@ -183,7 +182,7 @@
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_events.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_events.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"SDL_video.h"
|
||||
@@ -197,7 +196,7 @@
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_video.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_video.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_pixels.h"
|
||||
"SDL_rect.h"
|
||||
@@ -205,12 +204,12 @@
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_pixels.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_pixels.h
|
||||
"SDL_stdinc.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_rect.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_rect.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"SDL_pixels.h"
|
||||
@@ -218,7 +217,7 @@
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_surface.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_surface.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_pixels.h"
|
||||
"SDL_rect.h"
|
||||
@@ -227,11 +226,11 @@
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_blendmode.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_blendmode.h
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_keyboard.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_keyboard.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"SDL_keycode.h"
|
||||
@@ -239,27 +238,27 @@
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_keycode.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_keycode.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_scancode.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_scancode.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_scancode.h
|
||||
"SDL_stdinc.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_mouse.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_mouse.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"SDL_video.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_joystick.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_joystick.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_gamecontroller.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_gamecontroller.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"SDL_rwops.h"
|
||||
@@ -267,11 +266,11 @@
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_quit.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_quit.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_gesture.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_gesture.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"SDL_video.h"
|
||||
@@ -279,60 +278,60 @@
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_touch.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_touch.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"SDL_video.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_filesystem.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_filesystem.h
|
||||
"SDL_stdinc.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_haptic.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_haptic.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"SDL_joystick.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_hints.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_hints.h
|
||||
"SDL_stdinc.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_loadso.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_loadso.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_log.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_log.h
|
||||
"SDL_stdinc.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_messagebox.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_messagebox.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_video.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_power.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_power.h
|
||||
"SDL_stdinc.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_render.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_render.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_rect.h"
|
||||
"SDL_video.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_system.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_system.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_keyboard.h"
|
||||
"SDL_render.h"
|
||||
@@ -340,24 +339,24 @@
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_timer.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_timer.h
|
||||
"SDL_stdinc.h"
|
||||
"SDL_error.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_version.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_version.h
|
||||
"SDL_stdinc.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_image.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\sdl2\sdl_image.h
|
||||
"SDL.h"
|
||||
"SDL_version.h"
|
||||
"begin_code.h"
|
||||
"close_code.h"
|
||||
|
||||
1473011642 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\gl\glew.h
|
||||
1473015242 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\gl\glew.h
|
||||
<stddef.h>
|
||||
<inttypes.h>
|
||||
<stdint.h>
|
||||
@@ -740,13 +739,13 @@
|
||||
<vector>
|
||||
"loaders.h"
|
||||
|
||||
1473700459 source:d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\src\loaders.cpp
|
||||
1473669189 source:d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\src\loaders.cpp
|
||||
<SDL2/SDL.h>
|
||||
<SDL2/SDL_image.h>
|
||||
<fstream>
|
||||
<vector>
|
||||
"loaders.h"
|
||||
|
||||
1473700459 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\loaders.h
|
||||
1473669189 d:\owncloud\documents\programmierung\cpp\imanox-chroma-matting\opengl-test-two\include\loaders.h
|
||||
<GL/glew.h>
|
||||
|
||||
|
||||
@@ -11,20 +11,12 @@ uniform sampler2D trimap;
|
||||
uniform sampler2D foreground;
|
||||
uniform sampler2D background;
|
||||
|
||||
// Relative width/height of a pixel
|
||||
uniform float pixWidth;
|
||||
uniform float pixHeight;
|
||||
|
||||
int IS_BACKGROUND = 0;
|
||||
int IS_UNDEFINED = 1;
|
||||
int IS_FOREGROUND = 2;
|
||||
int UNSET = -1;
|
||||
|
||||
float M_PI= 3.14159;
|
||||
int suchbreich=10; //die anzahl der Pixel, die maximal in eine Richtung gegangen wird um einen Sicheren Pixel zu finden
|
||||
vec4 SicheresPixel[50]; //Speichert die das nachste Sichere Pixel, Array grosse=anzahl der Richtungen
|
||||
int anzahl_richtungen=50; //Speichert anzahl der Richtungen muss gleich der Array grosse von SicheresPixel sein
|
||||
|
||||
vec3 getTriColor(vec2 uvCoord) {
|
||||
return texture(trimap, uvCoord).rgb;
|
||||
}
|
||||
@@ -47,90 +39,6 @@ int getState(vec3 c) {
|
||||
}
|
||||
}
|
||||
|
||||
vec4 suche_Pixel_nach_winkel (vec2 uv, float winkel){
|
||||
vec2 pix;
|
||||
float i=1;
|
||||
vec3 color_sichers_Pixel;
|
||||
while(i<suchbreich){
|
||||
pix.x=uv.x+ sin(winkel)*pixWidth*i;
|
||||
pix.y=uv.y+ cos(winkel)*pixWidth*i;
|
||||
color_sichers_Pixel = getTriColor(pix);
|
||||
int status = getState(color_sichers_Pixel);
|
||||
if (status==IS_FOREGROUND) {
|
||||
return vec4(getForeColor(pix), i);
|
||||
//return vec4(1f, 1f, 1f, i);
|
||||
} else if (status==IS_BACKGROUND) {
|
||||
return vec4(getBackColor(pix), i);
|
||||
//return vec4(0f, 0f, 0f, i);
|
||||
}else{
|
||||
i++;
|
||||
}
|
||||
|
||||
}
|
||||
return vec4(0.0f, 0.0f, 0.0f, -1.0f);
|
||||
|
||||
|
||||
}
|
||||
|
||||
float Farbabstand(int i){
|
||||
float d=sqrt(pow(color.x-SicheresPixel[i].x,2)+pow(color.y-SicheresPixel[i].y,2)+pow(color.z-SicheresPixel[i].z, 2));//sqr((x1-x2)^2+(y1-y2)^2+(z1-z2)^2)
|
||||
return d;
|
||||
}
|
||||
|
||||
vec3 Pruefe_Pixel_in_Umgebung (vec2 start){
|
||||
float winkel=2*M_PI/anzahl_richtungen;
|
||||
int i=0;
|
||||
float gefundene_pixel=0.0f;
|
||||
float maximal=0;
|
||||
float gesamt_abstand=0.0f;
|
||||
while(i<anzahl_richtungen){
|
||||
SicheresPixel[i]=suche_Pixel_nach_winkel(start, winkel*i);
|
||||
if(SicheresPixel[i].w!=-1){
|
||||
gesamt_abstand+=SicheresPixel[i].w;
|
||||
gefundene_pixel++;
|
||||
if(maximal<SicheresPixel[i].w)
|
||||
maximal=SicheresPixel[i].w;
|
||||
}
|
||||
|
||||
i=i+1;
|
||||
}
|
||||
maximal++;
|
||||
//float d = Farbabstand(1);//eigene Funktion
|
||||
/*float d1=distance(SicheresPixel[1].xyz, color);//mitgelieferte Funktion
|
||||
if (d1==d ){
|
||||
return SicheresPixel[1];
|
||||
}else{
|
||||
return vec3(0.5f);
|
||||
}*/
|
||||
float nenner=0.0f;
|
||||
i=0;
|
||||
while(i<anzahl_richtungen){
|
||||
if(SicheresPixel[i].w!=-1){
|
||||
SicheresPixel[i].w=pow(maximal-SicheresPixel[i].w,2);
|
||||
nenner+=SicheresPixel[i].w;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
i=0;
|
||||
vec3 kombiniert=vec3(0.0f);
|
||||
|
||||
while(i<anzahl_richtungen){
|
||||
if(SicheresPixel[i].w!=-1)
|
||||
kombiniert+=SicheresPixel[i].xyz*SicheresPixel[i].w/nenner;
|
||||
i++;
|
||||
}
|
||||
return kombiniert;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void main(){
|
||||
color = getTriColor(UV);
|
||||
@@ -139,15 +47,9 @@ void main(){
|
||||
|
||||
if (status==IS_FOREGROUND) {
|
||||
color = getForeColor(UV).rgb;
|
||||
//color = vec3(1.0f, 0.0f, 0.0f);
|
||||
//color = vec3(1.0f);
|
||||
} else if (status==IS_BACKGROUND) {
|
||||
color = getBackColor(UV).rgb;
|
||||
//color = vec3(0.0f, 1.0f, 0.0f);
|
||||
//color = vec3(0.0f);
|
||||
} else {
|
||||
color = Pruefe_Pixel_in_Umgebung(UV);
|
||||
//color = vec3(0.0f, 0.0f, 1.0f);
|
||||
//color = Pruefe_Pixel_in_Umgebung(UV);
|
||||
// render undefined area
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,6 +86,7 @@ GLuint LoadShaders(const char * vertex_file_path,const char * fragment_file_path
|
||||
|
||||
|
||||
// Compile Vertex Shader
|
||||
printf("Compiling shader : %s\n", vertex_file_path);
|
||||
char const * VertexSourcePointer = VertexShaderCode.c_str();
|
||||
glShaderSource(VertexShaderID, 1, &VertexSourcePointer , NULL);
|
||||
glCompileShader(VertexShaderID);
|
||||
@@ -102,6 +103,7 @@ GLuint LoadShaders(const char * vertex_file_path,const char * fragment_file_path
|
||||
|
||||
|
||||
// Compile Fragment Shader
|
||||
printf("Compiling shader : %s\n", fragment_file_path);
|
||||
char const * FragmentSourcePointer = FragmentShaderCode.c_str();
|
||||
glShaderSource(FragmentShaderID, 1, &FragmentSourcePointer , NULL);
|
||||
glCompileShader(FragmentShaderID);
|
||||
@@ -118,6 +120,7 @@ GLuint LoadShaders(const char * vertex_file_path,const char * fragment_file_path
|
||||
|
||||
|
||||
// Link the program
|
||||
printf("Linking program\n");
|
||||
GLuint ProgramID = glCreateProgram();
|
||||
glAttachShader(ProgramID, VertexShaderID);
|
||||
glAttachShader(ProgramID, FragmentShaderID);
|
||||
|
||||
@@ -8,7 +8,7 @@ layout(location = 0) out vec3 color;
|
||||
//out vec3 color;
|
||||
|
||||
// Values that stay constant for the whole mesh.
|
||||
uniform sampler2D foreground;
|
||||
uniform sampler2D myTextureSampler;
|
||||
|
||||
// Relative width/height of a pixel
|
||||
uniform float pixWidth;
|
||||
@@ -21,16 +21,20 @@ int IS_UNDEFINED = 1;
|
||||
int IS_FOREGROUND = 2;
|
||||
int UNSET = -1;
|
||||
|
||||
vec3 greenValue = vec3(73.0f/255.0f, 129.0f/255.0f, 24.0f/255.0f);
|
||||
vec3 greenValue = vec3(0.0f, 1.0f, 0.0f);
|
||||
vec3 difference = vec3(40.0f/255.0f);
|
||||
int radius = 2;
|
||||
int radius = 10;
|
||||
|
||||
|
||||
vec3 getColor(vec2 uvCoord) {
|
||||
return texture(foreground, uvCoord).rgb;
|
||||
return texture(myTextureSampler, uvCoord).rgb;
|
||||
}
|
||||
|
||||
bool isBackground(vec3 c) {
|
||||
/*// 49,206, 11
|
||||
if (all( lessThanEqual(c, vec3(51.0f/255.0f, 208.0f/255.0f, 13.0f/255.0f))) &&
|
||||
all(greaterThanEqual(c, vec3(47.0f/255.0f, 204.0f/255.0f, 9.0f/255.0f)))*/
|
||||
// 0, 255, 0
|
||||
if (all( lessThanEqual(c, greenValue+difference)) &&
|
||||
all(greaterThanEqual(c, greenValue-difference))
|
||||
) {
|
||||
@@ -70,10 +74,10 @@ void main(){
|
||||
}
|
||||
|
||||
if (status == IS_BACKGROUND) {
|
||||
color = vec3(0.0f); // black
|
||||
color = vec3(0.0f);
|
||||
} else if (status == IS_FOREGROUND) {
|
||||
color = vec3(1.0f); // white
|
||||
color = vec3(1.0f);
|
||||
} else {
|
||||
color = vec3(0.5f); // gray
|
||||
color = vec3(0.5f);
|
||||
}
|
||||
}
|
||||
|
||||