opengl
-TianSF-
-
展开
-
Phong光照
顶点着色器#version 330 corelayout (location = 0) in vec3 aPosition;layout (location = 1) in vec2 aCoor;layout (location = 1) in vec3 aNormal;uniform mat4 uModel;uniform mat4 uView;uniform mat4 uProject原创 2017-07-06 22:31:05 · 287 阅读 · 0 评论 -
渲染到纹理
/* 帧缓冲, 渲染到纹理*/#include "stdafx.h"#include "../common/common.out.h"/*VAO VBO EBO 纹理*/using namespace std;float color1 = 0.1;float color2 = 0.3;float color3 = 0.4;bool g_b_line = false;void原创 2017-07-06 22:36:25 · 238 阅读 · 0 评论 -
模板测试练习 选中效果
完整程序 https://github.com/WaldenPonder/opengl-test/tree/master/t004#include "stdafx.h"#include "../common/common.out.h"int _tmain(int argc, _TCHAR* argv[]){ GLfloat cubePts[180]; tools::GetCub原创 2017-07-06 22:35:07 · 265 阅读 · 0 评论 -
Z-fighting
Z-fighting, also called stitching, is a phenomenon in 3D rendering that occurs when two or more primitives have similar or identical values in the z-buffer. It is particularly prevalent with coplanar p翻译 2017-08-03 23:22:26 · 466 阅读 · 0 评论 -
glDepthMask 使用时遇到的问题
原文 http://stackmirror.cn/page/3xwgq8v46k4 或 https://stackoverflow.com/questions/3388294/opengl-question-about-the-usage-of-gldepthmask问 : I have rendered an objectA in a scene as follows. The scene翻译 2017-08-03 21:53:44 · 3202 阅读 · 0 评论 -
glActiveTexture和glBindTexture的区别和联系
原文链接 问: From what I gather, glActiveTexture sets the active “texture unit”. Each texture unit can have multiple texture targets (). 据我所知,glActiveTexture 设置激活的纹理单元。每一个纹理单元有多个纹理目标选择(GL_TEXTURE_1D, 2D,翻译 2017-08-04 21:57:01 · 23681 阅读 · 1 评论