Example code from the [OpenGL 4.0 Shading Language Cookbook][cookbook]
=========================================================
This is the example programs from the [OpenGL 4.0 Shading Language
Cookbook][cookbook], by David Wolff. The source code has been updated to work
with MS Visual Studio, and no longer requires Qt.
Requirements
-------------
To use these examples, you'll need the following:
* The latest version of the Unofficial OpenGL Software Development Kit (GLSDK),
available at <http://glsdk.sourceforge.net>.
* You'll also need the clever and useful tool [premake][].
* In order to use the examples in Chapter 8, you'll need at least version
0.9.3 of [GLM][]. Unfortunately, at this time, the
[GLSDK][] includes version 0.9.2.x of [GLM][]. However, it is easy to
substitute a newer version (see below).
Compiling the examples
----------------------
These examples have been fully tested with Visual Studio 2010. I hope to have
them working with other compilers soon. Your help is welcome! Fork
[this project][ghcookbook] on github.
1. Install the [GLSDK][] by following the instructions on their [web site][glsdk].
In the process, you'll also install [premake][].
2. If you want to use the examples in Chapter 8, install the latest version
of [GLM][] into the GLSDK. You can do so by removing the `glm` directory
and replacing it with the contents of the GLM zip file. Make sure to change
the directory name to just `glm`.
3. Download the example code from [github][ghcookbook]. Unzip to an appropriate
directory.
4. Edit the `premake4.lua` file to point to your GLSDK's `links.lua` file.
5. Run `premake4 vs2010` to generate the project and solution files.
6. Open the solution in Visual Studio, and compile!
Any problems, create an issue on [github][ghcookbook].
Changes from the book
------------------------
At the time the book was written, I thought that using Qt would make the examples
quite portable and easy to compile within Qt Creator. Unfortunately, Qt Creator
has changed since the time of the writing of the book. It has become more
unwieldy to install, and in my experience has become extremely slow to boot.
In addition, it is not widely used.
Secondly, since the time of the book's writing, I have experienced problems
with GLEW under a 4.0 core profile. When doing some research it appears that
there are some fundemental issues with GLEW and core profiles.
Due to the above issues, and to make the code more available and hopefully
easier to use, I have ported the code over
to use GLLoad and FreeGLUT via the GLSDK. The code has been fully tested and
compiles in VisualStudio 2010, and will soon (hopefully) be tested with the
GNU compiler chain under Linux.
The major changes are listed below:
* Dropped dependence on Qt.
* Uses FreeGLUT, GLM, GLLoad, and GLImage via the [GLSDK][].
* Dropped dependence on libnoise for Chapter 8 examples. Instead, uses the noise
functions available in [GLM][] > 0.9.3.
TODO
--------------
* Currently, the noise examples (Chapter 8) don't look quite right due to the move
to GLM. Fix noise examples (chapter 8) to look better.
[GLM]: http://glm.g-truc.net
[GLSDK]: http://glsdk.sourceforge.net
[premake]: http://industriousone.com/premake
[ghcookbook]: http://github.com/daw42/glslcookbook
[cookbook]: http://www.packtpub.com/opengl-4-0-shading-language-cookbook/book
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
glslcookbook源码 (306个子文件)
vbomeshadj.cpp 15KB
vbomesh.cpp 13KB
scenejitter.cpp 11KB
scenebloom.cpp 10KB
sceneparticlesfeedback.cpp 10KB
scenesmoke.cpp 10KB
scenefire.cpp 10KB
vboteapot.cpp 9KB
sceneshadowmap.cpp 9KB
scenebasic_uniformblock.cpp 9KB
sceneblur.cpp 9KB
glslprogram.cpp 8KB
scenepcf.cpp 8KB
scenebasic_uniform.cpp 8KB
frustum.cpp 8KB
scenedeferred.cpp 7KB
scenenightvision.cpp 7KB
scenebasic_layout.cpp 7KB
sceneedge.cpp 7KB
scenebasic.cpp 7KB
sceneparticles.cpp 6KB
scenerendertotex.cpp 6KB
sceneparticlesinstanced.cpp 5KB
scenereflectcube.cpp 5KB
scenerefractcube.cpp 5KB
sceneao.cpp 5KB
scenetessteapotdepth.cpp 5KB
sceneprojtex.cpp 5KB
scenebezcurve.cpp 5KB
scenealphatest.cpp 5KB
scenepointsprite.cpp 4KB
scenenormalmap.cpp 4KB
vbotorus.cpp 4KB
scenemultitex.cpp 4KB
scenequadtess.cpp 4KB
vboteapotpatch.cpp 4KB
vbocube.cpp 4KB
scenetessteapot.cpp 4KB
scenewood.cpp 3KB
scenespot.cpp 3KB
scenemsaa.cpp 3KB
scenesubroutine.cpp 3KB
scenetexture.cpp 3KB
vboplane.cpp 3KB
sceneshadewire.cpp 3KB
scenesky.cpp 3KB
scenemultilight.cpp 3KB
scenefog.cpp 3KB
scenesilhouette.cpp 3KB
scenetoon.cpp 3KB
sceneperfragment.cpp 3KB
sceneads.cpp 3KB
scenetwoside.cpp 3KB
scenedecay.cpp 3KB
scenedirectional.cpp 3KB
scenegamma.cpp 3KB
scenepaint.cpp 3KB
scenediscard.cpp 3KB
sceneflat.cpp 3KB
scenewave.cpp 2KB
scenediffuse.cpp 2KB
skybox.cpp 2KB
noisetex.cpp 2KB
glutils.cpp 2KB
main.cpp 1KB
main.cpp 1KB
main.cpp 1KB
main.cpp 1KB
main.cpp 1KB
main.cpp 1KB
main.cpp 1KB
main.cpp 1KB
main.cpp 1KB
animtimer.cpp 465B
drawable.cpp 53B
discard.frag 457B
basic_uniformblock.frag 452B
twoside.frag 341B
flat.frag 156B
subroutine.frag 151B
diffuse.frag 151B
phong.frag 151B
function.frag 151B
multilight.frag 133B
basic_uniform.frag 130B
basic_layout.frag 130B
basic.frag 108B
bloom.fs 3KB
jitter.fs 3KB
edge.fs 3KB
blur.fs 2KB
nightvision.fs 2KB
pcf.fs 2KB
shadewire.fs 2KB
shadowmap.fs 2KB
alphatest.fs 2KB
deferred.fs 1KB
multitex.fs 1KB
spot.fs 1KB
texture.fs 1KB
共 306 条
- 1
- 2
- 3
- 4
资源评论
- luobote5218152013-08-24包括了全书的源代码,很全很好
- lrismyano2014-12-03是和书配套的,很有参考价值,谢谢
- axiong082018-12-08不错的资源,谢谢分享!
zhanyong168
- 粉丝: 23
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功