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

Red only specular for some new exported objects #423

Open
cryham opened this issue Nov 27, 2023 · 2 comments
Open

Red only specular for some new exported objects #423

cryham opened this issue Nov 27, 2023 · 2 comments
Labels
bug Something isn't working enhancement New feature or request Priority: Low

Comments

@cryham
Copy link
Contributor

cryham commented Nov 27, 2023

Ogre Version: :3.0
Operating System / Platform: Debian 12
RenderSystem: GL3+
GPU: AMD Radeon RX 6600 XT (navi23, LLVM 15.0.6, DRM 3.49, 6.1.0-13-amd64)

IDK why but for my recent new meshes exported, I get red only specular, ignoring specular map.
If I don't use specular map it's white again.
That barrel is old, converted from old v1 .mesh rest is new with red specular issue.
28_00-16-41

material.json in here, log_cabin_01:
https://github.com/stuntrally/stuntrally3/blob/main/data/materials/Pbs/all.material.json#L23805

meshes, textures in:
https://github.com/stuntrally/stuntrally3/tree/main/data/objects2
log_cabin_01.jpg
log_cabin_01.mesh
log_cabin_01_norm.jpg
log_cabin_01_spec.jpg
log_cabin_02.mesh

blend files
https://github.com/stuntrally/blendfiles/tree/master/models/LogCabin01

@darksylinc
Copy link
Member

Mmm, very interesting.

I can guess what's happening already without running it: The JPG was saved as greyscale, thus OgreNext detects this and loads it as R8_UNORM to save memory.

So when used as a specular map, sampling texture.xyzw will return R 0 0 1 as per how the HW works.

One simple workaround is to convert the JPG to rgb. Ideally OgreNext should detect this and use a different swizzle.

@cryham
Copy link
Contributor Author

cryham commented Nov 28, 2023

Ah thanks. I had no idea. Indeed saving as RGB fixed this red.
In GIMP from menu Image > Mode. Info from https://www.picozu.com/how-to-convert-a-grayscale-image-to-rgb-in-gimp
So leaving this open for change in OgreNext then.

@darksylinc darksylinc added bug Something isn't working enhancement New feature or request Priority: Low labels Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request Priority: Low
Projects
None yet
Development

No branches or pull requests

2 participants