paroj / gltut

Learning Modern 3D Graphics Programming
https://paroj.github.io/gltut/
MIT License
1.57k stars 377 forks source link

Tutorial 05 shader filename problem #149

Open Gigabitten opened 1 year ago

Gigabitten commented 1 year ago

All the chapter 5 tutorials use Standard.vert and Standard.frag, which can be located in the data folder in the folder for the chapter. It seems like all the data folders for every chapter get pulled into a top-level data folder, which is what's actually read from when the tutorials get run. My guess is that there's something funky going on with case sensitivity; there's already a standard.vert and a standard.frag in there, and no Standard.vert or Standard.frag. If I run:

find . -type f -exec sed -i 's/Standard\.frag/Standard05\.frag/g' {} +
find . -type f -exec sed -i 's/Standard\.vert/Standard05\.vert/g' {} +
mv Tut\ 05\ Objects\ in\ Depth/data/Standard.frag Tut\ 05\ Objects\ in\ Depth/data/Standard05.frag
mv Tut\ 05\ Objects\ in\ Depth/data/Standard.vert Tut\ 05\ Objects\ in\ Depth/data/Standard05.vert

then build the tutorial, it works fine.

(Note: using sed to do a global find-replace on Standard.frag and Standard.vert is proooobably overkill and could even hit too much if other tutorials have similarly-named shaders, it's probably better to just change the names in those few tutorials)

paroj commented 1 year ago

works here:

gltut$ cmake -GNinja -Bbuild .
gltut$ ls build/data/ | grep St
StandardColors.frag
Standard.frag
Standard.vert
Gigabitten commented 1 year ago

For various dumb reasons, I'm on Windows and using Visual Studio, here. Maybe it's specific to one of those? Maybe I'm the first person to report this because I'm the only person this goofy hehe

Akamitori commented 3 weeks ago

There's nothing dumb about your statement @Gigabitten .
Windows is case insensitive on file names. Chapter 3 has standard.vert and standard.frag. This creates a conflict with the shader files at Chapter 5 which are called Standard.vert and Standard.frag because as far as windows are concerned they are the same files. One solution would be to rename the files in the code and data folder for chapter 5. Then after doing a clean and rebuild you should be fine.

@paroj In practice this creates a conflict between the shader file names utilized in Tut03CPUPositionOffset and Tut05OverlapNoDepth. In Windows, the naming conflict resolves randomly. Hence, one out of those 2 won't copy the shader files properly and hence the screen won't display anything.