Comments (3)
Hi there,
So, I am going through the tutorials right now, implementing everything from scratch. I've seen that the cube using the textures I've also made myself was wrong as well.
The problem is actually with the common/texture.cpp script.
Line 61:
// Read the actual data from the file into the buffer
fread(data,1,imageSize,file);
Should have this command as well, to use the dataPos variable:
// Use the dataPos offset inside the file
fseek(file, dataPos, SEEK_SET);
// Read the actual data from the file into the buffer
fread(data,1,imageSize,file);
With this additional line, this issue should have been fixed.
Note: I tried this using the loadBMP_custom() given in the tutorial, to load BMP files only. Didn't tried anything with other texture loaders (DDS or TGA).
Carlos HR.
from ogl.
Thanks. I'll try this later since I've turned to another opengl tutorial.
from ogl.
Hi. I know this is already closed, but about the mentioned DDS texture issue, I came across a stack overflow answer where basically the contributor explains that "DDS has a different-D3D-based coordinate system compared to OpenGL, so we either invert the y component of the UV-coords in the fragment shader or invert the image before compressing it".
So, I solved by replacing, in the SimpleFragmentShader.glsl
:
color = texture(myTextureSampler, UV).rgb;
by
color = texture(myTextureSampler, vec2(UV.x, 1.0-UV.y)).rgb;
from ogl.
Related Issues (20)
- Domain expired HOT 3
- Tutorial 05: trying my own .bmp files turns out black HOT 3
- Playground background wrong color in documentation
- 3D Model Keyboard Mouse Controller
- error when compiling Bullet
- Tutorial 4: Output looks nothing like what I have. HOT 3
- [Info] Tutorial 08 GTKMM glArea with shaders loaded from obj file HOT 3
- is this glm::translate call correct? HOT 1
- Quick question about the sign in TestRayOBBIntersection function
- Cannot execute project18 HOT 1
- Tutorial 4 projection issues HOT 1
- glreadpixels picking up wrong color
- why lRayEnd_NDC's z setted to 0 in misc05_picking_custom example
- Memory leak in Particle demo.
- Some comments on the Picking with an OpenGL Hack article
- Tutorial 14 output looks blocky HOT 1
- Preprocessor conflict with tokens _B, _X, _S in AntTweakBar
- Can't compile due to the lack of glplatform.h HOT 2
- Tutorial 13: Orthogonalization applet link down
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ogl.