-
-
Notifications
You must be signed in to change notification settings - Fork 340
Support sRGB color space #2593
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
Merged
Merged
Support sRGB color space #2593
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
323b2f4
fix: the output by skybox should in gamma space
zhuxudong b2035a2
feat: support sRGB
zhuxudong ea85349
feat: add sRGB compatible function in common glsl
zhuxudong 99cb337
feat: some built-in textures use sRGB directly in shader
zhuxudong 39c254f
feat: add isSRGBColorSpace param in texture loader
zhuxudong c60e630
feat: set sRGB textures in glTF
zhuxudong 2e290fe
feat: use sRGB in text/sprite/ui
zhuxudong 2e80a4b
feat: add sRGB in editor decoder
zhuxudong 9343ffb
feat: support sRGB in KTX2
zhuxudong b533585
fix: ci error
zhuxudong 29f4dbf
chore: add sRGB plugin detect
zhuxudong 2186ecc
feat: parse texture after material
zhuxudong d0f5448
fix: editor remap material need know textures[index]'s sRGB color space
zhuxudong 9182cc8
fix: sRGB test
zhuxudong 118684b
ci: add e2e test
zhuxudong 37feebd
fix: dirt should be sRGB color space
zhuxudong 2b889ee
ci: type error
zhuxudong 5f4169e
feat: gamma correction
zhuxudong d42a359
feat: add render context macro
zhuxudong 2eac0a8
fix: use linear color space in BTDF
zhuxudong bc189d3
fix: use linear clear color in FBO
zhuxudong e9a5e2e
fix: e2e case
zhuxudong 80d7fdc
fix: copy sRGB texture
zhuxudong 5ebc63f
fix: name error
zhuxudong e2417f4
fix: engine destroy error
zhuxudong f040d7f
fix: destroy error
zhuxudong 9679f8c
fix: color math error
zhuxudong 101a24c
Merge branch 'dev/1.5' into feat/sRGB
zhuxudong ff59518
fix: readPixels format error
zhuxudong 79d7632
refactor: set default sRGB color space
zhuxudong df13e4e
refactor: use blit screen material to enhance code
zhuxudong 1229057
refactor: enhance blitter logic
zhuxudong 5cffc2f
refactor: use engine space
zhuxudong 0a66dff
refactor: srgb shader function
zhuxudong 45f4286
refactor: update e2e case
zhuxudong 2cb5124
refactor: rename
zhuxudong ffac36c
refactor: rename
zhuxudong edcd108
refactor: format code
zhuxudong ae8d810
refactor: rename
zhuxudong 3a2825c
refactor: opt code
GuoLei1990 a2b8cfc
refactor: opt code
GuoLei1990 3743392
refactor: opt code
GuoLei1990 0d67cc4
refactor: opt code
zhuxudong 757aca3
fix: don't clear color in blitframebuffer
zhuxudong a4383f9
refactor: opt code
zhuxudong a38abef
refactor: code format
zhuxudong 5e60ec9
refactor: code format
zhuxudong 4fedb4b
fix: use sRGB color space to down/up sample
zhuxudong 6ff0baa
refactor: use sRGB color space when camera.enableHDR === false
zhuxudong 17b99fd
refactor: revert logic
zhuxudong 442c7f2
refactor: opt code
GuoLei1990 6b5eb86
refactor: clamp 0 in Common.glsl
zhuxudong a6b19da
refactor: add comments
zhuxudong c87e44e
chore: rename
<
8000
/div>
zhuxudong Apr 8, 2025
86eeae9
chore: rename
zhuxudong 37702ca
chore: code opt
zhuxudong 2e1a02e
refactor: code opt
zhuxudong 7bf0a58
chore: code opt
zhuxudong df5cdbe
chore: code opt
zhuxudong fd7917e
chore: change param order
zhuxudong 1c11b1f
chore: code opt
zhuxudong 7ba82f7
chore: opt comment
zhuxudong 5382e04
chore: revert order
zhuxudong d3de25b
chore: update comment
zhuxudong 45e54f5
chore: code opt
zhuxudong 1266a9d
chore: code opt
zhuxudong 34845b7
chore: update comment
zhuxudong 396361a
refactor: code opt
zhuxudong 0a456a7
refactor: code opt
zhuxudong b2d91b7
fix: code opt
zhuxudong e5f5de4
chore: code opt
zhuxudong e8609a7
refactor: code opt
zhuxudong 3461022
chore: rename
zhuxudong a483e65
chore: code opt
zhuxudong d5fc114
chore: code opt
zhuxudong 2c5decd
chore: code opt
zhuxudong 4523442
refactor: code opt
zhuxudong 53dd20d
refactor: code opt
zhuxudong 7693fc3
Merge branch 'dev/1.5' into feat/sRGB
zhuxudong 758a857
chore: e2e fix
zhuxudong 1fedf9e
chore: code opt
zhuxudong 4166410
fix: e2e
zhuxudong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* @title sRGB + KTX2 | ||
* @category Texture | ||
*/ | ||
import { | ||
AssetType, | ||
Camera, | ||
MeshRenderer, | ||
PrimitiveMesh, | ||
Texture2D, | ||
UnlitMaterial, | ||
Vector3, | ||
WebGLEngine | ||
} from "@galacean/engine"; | ||
import { initScreenshot, updateForE2E } from "./.mockForE2E"; | ||
|
||
WebGLEngine.create({ canvas: "canvas" }).then((engine) => { | ||
engine.canvas.resizeByClientSize(2); | ||
const scene = engine.sceneManager.activeScene; | ||
const rootEntity = scene.createRootEntity(); | ||
|
||
// camera | ||
const cameraEntity = rootEntity.createChild("camera_node"); | ||
cameraEntity.transform.position = new Vector3(0, 0, 2); | ||
const camera = cameraEntity.addComponent(Camera); | ||
|
||
engine.resourceManager | ||
.load<Texture2D>({ | ||
url: "https://mdn.alipayobjects.com/oasis_be/afts/img/A*XmHPTYGREAIAAAAAAAAAAAAAekp5AQ/original/original.ktx2", | ||
type: AssetType.KTX2 | ||
}) | ||
.then((texture: Texture2D) => { | ||
const material = new UnlitMaterial(engine); | ||
material.baseTexture = texture; | ||
|
||
engine.run(); | ||
const entity = rootEntity.createChild("mesh"); | ||
entity.transform.setRotation(0, 90, 0); | ||
const meshRenderer = entity.addComponent(MeshRenderer); | ||
meshRenderer.mesh = PrimitiveMesh.createSubdivisionSurfaceSphere(engine); | ||
meshRenderer.setMaterial(material); | ||
|
||
updateForE2E(engine); | ||
initScreenshot(engine, camera); | ||
}); | ||
}); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
e2e/fixtures/originImage/Animator_animator-blendShape-quantization.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add a Project with a custom Shader