daw42 / glslcookbook

Example code for the OpenGL Shading Language Cookbook - 2nd Edition (3rd Edition now available)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No projected texture

samhartlebury opened this issue · comments

Projected texture example doesnt show a working projected texture, just a teapot. It is loading the flower.png texture without errors... I'm not sure why I can't see it working.

Compiled in VS2015

I figured it out by checking the "fixed" issues and found this

In chapter 04 file sceneproj.tex line 47 zero matrix #49

I checked most recent code and found it has not actually been fixed. There are still 0 initialised matrices been used, line 34, SceneProjText: mat4 projScaleTrans = glm::translate(mat4(), vec3(0.5f)) * glm::scale(mat4(), vec3(0.5f));

should be:

mat4 projScaleTrans = glm::translate(mat4(1.0f), vec3(0.5f)) * glm::scale(mat4(1.0f), vec3(0.5f));

commented

Thanks, I've made that change, let me know if it works for you. Note that this issue is already fixed in the 3rd edition code: https://github.com/PacktPublishing/OpenGL-4-Shading-Language-Cookbook-Third-Edition . I'm no longer actively maintaining this repo. However, thanks for the report!