随笔分类 -  OpenGL

摘要:好吧 最终的normal加上去了 不过加在local 上 效果什么的比我预期的好一点 。还有一点opengl Crack 的原因: 各种program 忘记init 造孽; 还有潜在的memory error 。下一步: 1)normal composite 看师弟能不能帮我搞定 ,要开始写论文了 一周后 要交 2) 将SSS系数独立出来 调成那种像3dmax 的 可是实时编辑的, 真心要靠 慢慢调参数 调节一个好效果了 不过准备扔给另外一个小师弟有师弟剥削就是好 嘎嘎嘎 阅读全文
posted @ 2013-12-21 15:31 冰点猎手 阅读(154) 评论(0) 推荐(0) 编辑
摘要:先贴出shader 吧 等有时间了 来阐述原理// vertex shader//varying vec3 ViewPosition;//varying vec3 Normal;varying vec3 Vertex_UV;varying vec3 Vertex_Normal;varying vec3 Vertex_LightDir;varying vec3 Vertex_EyeVec;void main(void){ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; Vertex_UV = ... 阅读全文
posted @ 2013-12-06 20:41 冰点猎手 阅读(425) 评论(0) 推荐(0) 编辑
摘要:最近做raycasting,由于体数据比较大,超过了3D纹理的限制,所以需要查询3d纹理(GL_MAX_3D_TEXTURE_SIZE)范围限制。使用了以下函数: glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &maxsize ); 这里有对于OpenGL 参数以及极限等等查询函数的详解 http://www.opengl.org/sdk/docs/man/xhtml/glGet.xml 阅读全文
posted @ 2013-04-17 20:32 冰点猎手 阅读(342) 评论(0) 推荐(0) 编辑
摘要:在VertexShader 中,和顶点相关的数据如Position、Normal、Color等等均称为Attribute,为了给VertexShader传入这些数据,必须首先知道相关Attribute在Shader中位置。在layout尚未出现之间有两种设定Attribute 位置的方法。方法一OpenGL允许我们显示的设定Attribute的位置,方法二OpenGL帮我们设定好Attribute的位置,然后我们在程序中查询Attribute的位置。方法一要特别注意:设定Attribute的位置必须在Link Program 之前,如果在Link之后才设定Attribute的位置,需要重... 阅读全文
posted @ 2012-12-07 00:44 冰点猎手 阅读(456) 评论(0) 推荐(0) 编辑
摘要:(1)Thegl_FragCoordbuilt-in GLSL variable can be used in fragment shaders to get the window-space coordinates of the current fragment. 阅读全文
posted @ 2012-11-09 11:44 冰点猎手 阅读(196) 评论(0) 推荐(0) 编辑
摘要:(1)glGetUniformLocation 报错:invalid operator 时,除了常规的program相关错误外,注意shader是否有错误(2)万恶的GLSL,由于in 的变量是只读的,我在shader里对in的变量进行更改,导致无名错误调试了好久。FUCK~(3)又是Shader出的问题,当一个uniform 变量同shader最终的输出没有任何关系时,编译器会将该变量优化掉,这样就无法提供该变量的location, 导致glGetUniformLocation函数返回-1(4)d:\programs\microsoft visual studio 8\vc\platform 阅读全文
posted @ 2012-11-01 20:03 冰点猎手 阅读(359) 评论(0) 推荐(0) 编辑
摘要:1 glPixelStore http://www.zwqxin.com/archives/opengl/opengl-api-memorandum-2.html2 depth clamping glEnable(GL_DEPTH_CLAMP); A more reasonable mechanism isdepth clamping. What this does is turn off camera near/far plane clipping altogether. Instead, the depth for these fragments are clamped to the [- 阅读全文
posted @ 2012-10-31 14:57 冰点猎手 阅读(264) 评论(0) 推荐(0) 编辑
摘要:转自:http://www.cnblogs.com/Pointer/archive/2009/05/31/27323.html最近初学GLSL,发现一些很好的入门资料。OpenGL Shading Language Specificationhttp://www.opengl.org/documentation/oglsl.html OpenGL低级着色语言与高级着色语言http://gameres.com/Articles/Program/Visual/3D/OpenGLOctane3d.pdf OpenGL Shading Language Tutorialshttp://www.cloc 阅读全文
posted @ 2011-11-30 15:13 冰点猎手 阅读(295) 评论(0) 推荐(0) 编辑
摘要:http://www.cppblog.com/guojingjia2006/archive/2009/01/08/68874.html OpenGL vs2010中碰到的配置问题,网上找了下,以下和我碰到的一样,可以解决,感谢作者 unresolved external symbol __imp____glutInitWithExit@12 unresolved external symbol __imp____glutCreateWindowWithExit@8 I have the folling files in the following locations: - glut.h glu 阅读全文
posted @ 2011-10-18 00:09 冰点猎手 阅读(890) 评论(0) 推荐(0) 编辑
摘要:本日志为推荐日志,罗列一些我在学习过程中特意或无意搜集到的网站或教程,对OpenGL初学者或者进阶者都很有用的喔。(可能会不定期更新,方便搜索苦手啊。 )ZwqXin不怕做广告,但这广告得有“ZX认证”~(貌似对自己甄别力黄婆卖瓜)。其实有时候会怀疑自己到底还算初学者不,相信甚至也有很多人不敢说自己是中年鸟,更别说老鸟了。但是以下的推荐其实老少均宜 的哦。1.DancingWind NEHE中文教程 NEHE是十分不错的opengl教程,由浅入深,配合实例讲解。而DancingWind本着一颗分享的心,制成中文版。看官不必一课一课按顺序看但每一课都应该认真看,中文苦手者可配合英文版观看……各位 阅读全文
posted @ 2011-10-16 11:11 冰点猎手 阅读(595) 评论(0) 推荐(0) 编辑