Skip to content
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

sdrJPEG from Loader for custom shader skybox #14

Closed
arpu opened this issue Nov 27, 2023 · 2 comments
Closed

sdrJPEG from Loader for custom shader skybox #14

arpu opened this issue Nov 27, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@arpu
Copy link

arpu commented Nov 27, 2023

Hi,

i trying to add this fantastic gainmaps to a custom skyshader ( sdJPEG) https://github.com/mrxz/fern-aframe-components/blob/main/sky-background/src/index.js

the problem is the generated sd Texture, has generated mipmaps and there are visual Seams

what i doing now is:

 const result = await hdrjpgLoader.loadAsync(this.data.textureSrc);
 let sd = result._quad.material.sdr;
 sd.generateMipmaps = false;
 sd.needsUpdate = true;
 let texture = result.renderTarget.texture;
 result.dispose();

using the sd for the custom shader map value and the texture for the Scene environment, this works but not sure if there is a better way? ( or are the mipmaps needed on the sd Texture in the gainmap Material ? )

@arpu arpu changed the title sdrJPEG from Loader for costom shader skybox sdrJPEG from Loader for custom shader skybox Nov 27, 2023
@daniele-pelagatti
Copy link
Contributor

hi! Thanks for reaching out!

Out of curiosity: the SDR texture is intended for internal usage and we imagined would not be consumed externally, is there a use case why you are trying to reference it? All in all, this is just the normal JPEG file which you could load with a normal TextureLoader

on to your specific problem: all the internally used texture don't specifically need generateMipmaps: we just assumed it would not cause any problems but I can see it maybe this will cause problems for someone, maybe even related to #15

I'm working on a solution where the library will not generate them by default and you will need to explicitly enable them, also, in general, the library will assume a more 'un-opinionated' stance regarding the output texture options.
see #17

@daniele-pelagatti daniele-pelagatti added the enhancement New feature or request label Nov 28, 2023
@daniele-pelagatti daniele-pelagatti self-assigned this Nov 28, 2023
daniele-pelagatti added a commit that referenced this issue Nov 29, 2023
…fy renderTarget (and toDataTexture) options

related issues: #14 and #15 

The library will no more generate mipmaps by default but will require to explicitly enable them, also, in general, the library will assume a more 'un-opinionated' stance regarding the output texture options.

BREAKING CHANGE: `generateMipmaps` is no longer `true` by default, both `minFilter` is  no longer `LinearMipMapLinearFilter` by default but `LinearFilter`, `wrapS` and `warpT` are no longer `RepeatWrapping` by default but `ClampToEdgeWrapping`
daniele-pelagatti pushed a commit that referenced this issue Nov 29, 2023
# [3.0.0](v2.0.7...v3.0.0) (2023-11-29)

### Bug Fixes

* **loaders:** properly catches render errors and calls onError callback ([b9bcdd1](b9bcdd1)), closes [#16](#16)

### Features

* **core:** disables default mipmap generation, enables user to specify renderTarget (and toDataTexture) options ([147d278](147d278)), closes [#14](#14) [#15](#15)

### BREAKING CHANGES

* **core:** `generateMipmaps` is no longer `true` by default, both `minFilter` is  no longer `LinearMipMapLinearFilter` by default but `LinearFilter`, `wrapS` and `warpT` are no longer `RepeatWrapping` by default but `ClampToEdgeWrapping`
@daniele-pelagatti
Copy link
Contributor

try version 3.0.0 and let me know if it solves your problem! thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants