效果图
1,取两幅图像的最大像素值合成新的图像
2,取两幅图像的最小像素值合成新的图像
实现shader
varying vec2 V_Texcoord;
uniform sampler2D U_BaseTexture;
uniform sampler2D U_BlendTexture;
void main()
{
vec4 blendColor=texture2D(U_BlendTexture,V_Texcoord);
vec4 baseColor=texture2D(U_BaseTexture,V_Texcoord);
//颜色变亮
gl_FragColor=max(blendColor,baseColor);
//颜色变暗
//gl_FragColor=min(blendColor,baseColor);
}
#include <windows.h>
#include "glew.h"
#include <stdio.h>
#include <math.h>
#include "utils.h"
#include "GPUProgram.h"
#include "ObjModel.h"
#include "FBO.h"
#include "FullScreenQuad.h"
#include "Glm/glm.hpp"
#include "Glm/ext.hpp"
#pragma comment(lib,"openg