I have a weird "bug" where only textures which match the exact sizes of the lava texture from the lab get accepted and portrayed correctly (256x256)
Is this intended or do i have a bug somewhere in my code
The size of the texture *should* not matter for the program, so I would guess that there is a bug somewhere in the code. What is the error message/display bug when you use textures of a different size?
Also, if you could tell us the name of your group and push your code to the repository, we may be able to diagnose the problem in a little more detail. ;)
LG,
Jonathan Kudlich
Also, if you could tell us the name of your group and push your code to the repository, we may be able to diagnose the problem in a little more detail. ;)
LG,
Jonathan Kudlich
There is no error, just a black texture. I guess that something is wrong because I inserted my textures into the lab project and they worked there.
I pushed my current version to the "Waking up" team.
I added a comment in the main.js in line 46. The problem i described there applies for all of my textures.
It would be really nice if you could help me out here.
LG Florian
I pushed my current version to the "Waking up" team.
I added a comment in the main.js in line 46. The problem i described there applies for all of my textures.
It would be really nice if you could help me out here.
LG Florian
Hi,
In WebGL there are restrictions for textures that are not a power of 2 in both dimensions, e.g. no mip mapping and not all wrap modes are available.
The easiest way to circumvent these restirctions is to use textures with sizes of power of 2 (128x128, 256x256, 1024x1024, ...).
Here are some resources where you can look up these restrictions:
- https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL
- https://webglfundamentals.org/webgl/lessons/webgl-3d-textures.html
- http://learnwebgl.brown37.net/10_surface_properties/texture_mapping_images.html
KR,
Patrick Adelberger
In WebGL there are restrictions for textures that are not a power of 2 in both dimensions, e.g. no mip mapping and not all wrap modes are available.
The easiest way to circumvent these restirctions is to use textures with sizes of power of 2 (128x128, 256x256, 1024x1024, ...).
Here are some resources where you can look up these restrictions:
- https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL
- https://webglfundamentals.org/webgl/lessons/webgl-3d-textures.html
- http://learnwebgl.brown37.net/10_surface_properties/texture_mapping_images.html
KR,
Patrick Adelberger