-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CompressedTexture: Support flipY
in shaders.
#4316
Comments
Confirmed. If the DDS file is converted to PNG, then the model renders correctly.
|
Thank you for your answer , |
Random guess... Maybe |
Yes, it appears that the texture is rendered upside down, but EDIT: The three.js compressed image files (except for cube maps) appear to be inverted. |
I've researched this issue a bit, here are my findings: OpenGL addresses textures upside down (the first row of pixels data is interpreted at the bottom row on a screen). Because this is not how browsers (and most other software) addresses pixels, WebGL for convenience provided a flag For compressed textures the Because of these, the DDS textures are handled as expected by Three.js, they are in the correct orientation from the OpenGL point of view. The library probably could provide an option to flip DXT data in JavaScript, but this doesn't seem to make much sense (applications use compressed textures for performance benefits and flipping DXT would be quite slow). DDSes that are flipped in a correct way can be generated from non flipped images for example like this:
|
Why not have Three.js use |
@wrr What kind of command line tool is the one you use like that? |
@Herst Thanks! |
The summary of this issue is that |
…in UV coordinates to work around mrdoob#4316, allowing us to use uncompressed DDS, compressed DDS and PNG textures interchangeably. Closes #6.
So seems like this issue can be easily fixed by simply adding new flag like |
This issue is not exclusive to S3TC but affects all compressed texture formats. Different workarounds are outlined in #19797 (comment). Generating compressed textures in the correct orientation is best, for all other cases the mentioned In context of In context of const uvNode = uv();
material.colorNode = texture( ktxTexture, uvNode.setY( uvNode.y.oneMinus() ) ); I think we could investigate to automatically inject this code inside the renderer somehow so |
flipY
in shaders.
I convert a simple sheep model use convert_obj_three.py to .json ,


load it use THREE.JSONLoader(),
and use THREE.ImageUtils.loadCompressedTexture(texturepath) to add the texture,
but not reach my results,
here is:
here is the code : https://github.com/pikaya/lei ,
Thank you very much for someone to help me!
here is the result of DDS converted to PNG :

The text was updated successfully, but these errors were encountered: