openglinsights / openglinsightscode Goto Github PK
View Code? Open in Web Editor NEWSource code for OpenGL Insights
Source code for OpenGL Insights
Hello, I tried to compile the code project for Chapter 11, using Visual Studio Express 2012 on a machine running Windows 7.
I am not super-familiar with openGL on the desktop, nor with Visual Studio -- in fact I just downloaded VS to try to compile this book's project.
I'm getting an error when I try to run it.
Status: Using GLEW 1.7.0
Error, Shader compilation failed for vertex_program :'1':
Vertex shader failed to compile with the following errors:
ERROR: 0:1: error<#106> Version number not supported by GL2
ERROR: 0:1 error<#308> Profile is invalid before glsl1.5.
ERROR 0:9: error<#279> Invalid layout qualifier 'location'
ERROR: 0:10 error<#279> Invalid layout qualifier 'location'
WARNING: 0:12: warning<#312> interface block with instance is supported in GLSL 1.5
ERROR: error<#273> 4 compilation errors. No code generated
GPUProgram fullscreen not built! Press any key to continue . . .
I hope someone knows the answer because that sure was a pain to type in by hand. Does Visual Studio let you copy and paste text from the program output, because I could not do it! :)
Thanks
Bob
I have dowload glm (ver 0.9.2.6). But I cannot complie the project in vs2010.
There is error in scene.cpp,
"glm/gtc/swizzle.hpp": No such file or directory.
Is the glm is the right version?
Hi, (sorry for my bad english)
I'm just trying to understand Pstates by myself,
i have downloaded the lastest nvapi and adl from the officals websites
i have open the Ch37.sln, and i can't compile it !
i can't find the error strings into nvapi, with manual text saerching.
i search "NV_GPU_PERF_PSTATE_ID" too on google, and the only one answer it return is in your book.
i don't understand how compiling this source is possible, please help me !
thanks !
error log :
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(56): error C2065: 'NV_GPU_PERF_PSTATE_ID' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(56): error C2146: syntax error : missing ';' before identifier 'currentPState'
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(56): error C2065: 'currentPState' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(57): error C2065: 'currentPState' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(57): error C3861: 'NvAPI_GPU_GetCurrentPstate': identifier not found
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(60): error C2065: 'currentPState' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(68): error C2065: 'NV_GPU_PERF_PSTATES_INFO' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(68): error C2146: syntax error : missing ';' before identifier 'PerfPstatesInfo'
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(68): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(69): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(69): error C2228: left of '.version' must have class/struct/union
1> type is ''unknown-type''
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(69): error C2065: 'NV_GPU_PERF_PSTATES_INFO_VER' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(71): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(71): error C3861: 'NvAPI_GPU_GetPstatesInfoEx': identifier not found
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(74): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(74): error C2228: left of '.numPstates' must have class/struct/union
1> type is ''unknown-type''
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(75): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(75): error C2228: left of '.numClocks' must have class/struct/union
1> type is ''unknown-type''
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(76): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(76): error C2228: left of '.numVoltages' must have class/struct/union
1> type is ''unknown-type''
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(81): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(81): error C2228: left of '.pstates' must have class/struct/union
1> type is ''unknown-type''
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(81): error C2228: left of '.pstateId' must have class/struct/union
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(86): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(86): error C2228: left of '.pstates' must have class/struct/union
1> type is ''unknown-type''
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(86): error C2228: left of '.clocks' must have class/struct/union
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(86): error C2228: left of '.domainId' must have class/struct/union
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(87): error C2065: 'NVAPI_GPU_PUBLIC_CLOCK_GRAPHICS' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(88): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(88): error C2228: left of '.pstates' must have class/struct/union
1> type is ''unknown-type''
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(88): error C2228: left of '.clocks' must have class/struct/union
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(88): error C2228: left of '.freq' must have class/struct/union
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(89): error C2065: 'NVAPI_GPU_PUBLIC_CLOCK_MEMORY' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(90): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(90): error C2228: left of '.pstates' must have class/struct/union
1> type is ''unknown-type''
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(90): error C2228: left of '.clocks' must have class/struct/union
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(90): error C2228: left of '.freq' must have class/struct/union
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(91): error C2065: 'NVAPI_GPU_PUBLIC_CLOCK_PROCESSOR' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(92): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(92): error C2228: left of '.pstates' must have class/struct/union
1> type is ''unknown-type''
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(92): error C2228: left of '.clocks' must have class/struct/union
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(92): error C2228: left of '.freq' must have class/struct/union
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(97): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(97): error C2228: left of '.pstates' must have class/struct/union
1> type is ''unknown-type''
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(97): error C2228: left of '.voltages' must have class/struct/union
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(97): error C2228: left of '.domainId' must have class/struct/union
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(98): error C2065: 'PerfPstatesInfo' : undeclared identifier
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(98): error C2228: left of '.pstates' must have class/struct/union
1> type is ''unknown-type''
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(98): error C2228: left of '.voltages' must have class/struct/union
1>u:\programmation[ressources][livres payants]\openglinsights-openglinsightscode-bb2d6c6\chapter 37 performance state tracking\ch37\pstatenv.cpp(98): error C2228: left of '.mvolt' must have class/struct/union
1> PStateAMD.cpp
1> PState.cpp
1> Ch37Dlg.cpp
1> Ch37.cpp
1> Generating Code...
1>
1>Build FAILED.
Chapter 29 Fermi Asynchronous Texture Transfers sample (CopyEngine.exe) crash on my AMD FirePro W9100 running on Windows7 64 with last drivers installed.
(I also try with a W5100 on Windows 8.1 64 and the problem is the same)
In release the STATUS_FATAL_APP_EXIT exception occured in atioglxx.dll Fault offset: 0x014250bf:
When a debugger is attached, the process seems to freeze execution in amd driver callstack coming from wglMakeCurrent(NULL, NULL) call.
I successfully made this sample work on Quadro K2000M and Geforce GTX 680.
I completely understand that Fermi architecture is Nvidia specific.
But it seems that this sample use standard OpenGL ARB code with classic win32 API.
So for me, it is expected to work everywhere.
Do you think it's a driver issue forcing me to install an older version.
Or do I miss something else ?
AMD Firepro hardware seems to have DMA too behind the DirectGMA feature. (used to transfere buffer from video capture card). I do not know if this can by considered as a "Copy Engine hardware" as understood in the chapter 29 of the book.
Any advice would be welcome,
Thanks in advance for this.
For chapter 12, about distance fields, I want to compile the demo for a mac.
I try 'make' on a mac running 10.8.2, and it says
bob$ make
Usage: make Win32 | Linux | MacOSX | clean | distclean
bob$ make MacOSX
./bundle.sh contourdemo
make: ./bundle.sh: No such file or directory
It is probably something extremely simple but what do I need to do?
Thanks!
Bob
Thank you so much for putting together these resources they are fantastic!
I'm currently in the process of studying the scene voxelization construction in Chapter 22 and wondering if the source code would be made available in the future?
Thank you again and hope to see more from OpenGL Insights in the future :)
Kind regards,
Chris
It seems the issues in this repo are not being monitored, but I will post it here anyway for the lack of a more appropriate place.
When I compile the codes in both demo1 and demo2 using GNU Make, the following error occur:
$ make Linux
gcc -I. -I/usr/include shaderdemo.c -lglfw -lGLU -o shaderdemo
In file included from shaderdemo.c:29:0:
./GL/glfw.h:162:20: fatal error: GL/gl.h: No such file or directory
compilation terminated.
Makefile:11: recipe for target 'Linux' failed
make: *** [Linux] Error 1
It appears GL/gl.h
is needed for compilation but is missing for some reason.
They don't compile for me on the latest nvidia drivers under linux:
0(7) : error C7532: layout qualifier 'binding' requires "#version 420" or later
0(7) : error C0000: ... or #extension GL_ARB_shading_language_420pack : enable
Changing the version numbers to 420 fixes it.
Hi
Thanks for this wonderful book and samples.
There is an issue with Chapter 28 Scenario4
base::app::renderer_side_start@....\src\base\app.cpp(79) Cannot find file "fonts/lucida_console_13.fnt".
Tested with Visual Studio 2015 in Debug win32
Edit: in fact its just because the async_vbo_transfers_Scenario4.vcxproj.user file have not been added to git repository, so debugging working directory is not set to $(TargetDir) as other project does.
may be their still missing others settings.
Edit2: same issue for async_vbo_transfers_bw.vcxproj.user
Thanks for your concern about this.
Hi,
reading sample chapter 22 "Octree-Based Sparse Voxelization Using the GPU Hardware Rasterizer " I read :
"Details can be found in the accompanying source code"
but I can't find here on github.. any info on where code is posted?
thanks..
It is impossible to compile Chapter 10 without vsld.lib. Please fix this.
"Real-Time Rendering" has just released its 4th edition a couple of days ago. When will OpenGL Insights? Many new features of OpenGL 4.5 and 4.6 are eager to be introduced in a new edition of this wonderful book. "Things have not changed that much in the past six years"...... :-)
The distance transform code in the console
application to create distance field textures, located in
the file "edtaa3func.c", is MIT licensed, and free to use
under the following conditions.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
A Makefile or similar and/or a readme who to compile this chapter on linux (e.g. ubuntu) is missing.
Hi everybody:
When I executed the example "Fermi Asynchronous Texture Transfers" of chapter 29,it failed,dand gave a messageBox that "vertex shader compilation failed",I don't know why.Did anybody encouter this error,and how to fix it ?Thank you .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.