Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller Scene] Depth attachment; baked lighting example #38118

Merged
merged 4 commits into from
Dec 7, 2022

Conversation

bdero
Copy link
Member

@bdero bdero commented Dec 7, 2022

Screen.Recording.2022-12-07.at.2.26.23.AM.mov

Impeller stuff:

  • Add combined depth+stencil texture formats. The depth + stencil texture must be the same on Metal ARM devices and Vulkan.
  • Allow un-setting RenderTarget depth and stencil attachments.
  • Remove an ImGui playground stencil attachment hack for passing validation that I added long ago (FYI @iskakaushik). The ImGui pipeline doesn't have a stencil, it uses the scissor for clipping.

Scene stuff:

  • Setup depth/stencil attachments
  • Allow for configuring the vertex color weight in the unlit material.
  • Add a texture to the example with baked lighting to test UVs.

The texture is 512x512 and 266k. What was your go to PNG compression tool @chinmaygarde?

Screenshot of the model with a baked 1024x1024 texture:
image
Notice the texture is mapped opposite to the geometry in Impeller Scene. We're decoding the geometry into the wrong space!

And a quick Iray render with 2048x2048 PBR textures against an HDRI:
image

Also, here are some fun screen grabs from before the color and depth were fixed:
Screen Shot 2022-12-06 at 10 08 16 PM

Screen Shot 2022-12-06 at 10 40 19 PM

@bdero bdero self-assigned this Dec 7, 2022
@bdero bdero force-pushed the bdero/ipscene-baked-light-texture branch from 107dab4 to 6929e31 Compare December 7, 2022 11:20
@bdero bdero force-pushed the bdero/ipscene-baked-light-texture branch from 43190cc to 658c260 Compare December 7, 2022 11:39
@@ -78,6 +78,7 @@ test_fixtures("file_fixtures") {
"table_mountain_py.png",
"table_mountain_pz.png",
"test_texture.frag",
"flutter_logo_baked.png",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: alphabetize.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatter apparently only sorts DEPS and sources since it can't tell if the items in the custom template are order sensitive. There is a NOSORT directive to disable sorting. Maybe we should patch GN to add a SORT directive to the formatter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done wrt alphabetizing.

@chinmaygarde
Copy link
Member

What was your go to PNG compression tool?

pngcrush -ow -brute foo.png

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting!

kS8UInt,
kD32FloatS8UInt,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, I didn't realize we didn't have one of these already.

Copy link
Member Author

@bdero bdero Dec 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never noticed either. For the depth in impeller-cmake I literally used B8G8R8A8 because it's GLES only right now and the attachments have no affect on the surface framebuffer. 😄

@@ -78,6 +78,7 @@ test_fixtures("file_fixtures") {
"table_mountain_py.png",
"table_mountain_pz.png",
"test_texture.frag",
"flutter_logo_baked.png",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatter apparently only sorts DEPS and sources since it can't tell if the items in the custom template are order sensitive. There is a NOSORT directive to disable sorting. Maybe we should patch GN to add a SORT directive to the formatter.

@bdero
Copy link
Member Author

bdero commented Dec 7, 2022

❯ ls -lh impeller/fixtures/flutter_logo_baked.png
-rw-r--r--@ 2 bdero  primarygroup   266K Dec  6 20:56 impeller/fixtures/flutter_logo_baked.png
❯ pngcrush -ow -brute impeller/fixtures/flutter_logo_baked.png
  Recompressing IDAT chunks in impeller/fixtures/flutter_logo_baked.png
   Total length of data found in critical chunks            =    272306
   Best pngcrush method        = 124 (ws 15 fm 5 zl 9 zs 1) =    269195
CPU time decode 0.767569, encode 5.304494, other 0.021383, total 6.099856 sec
❯ ls -lh impeller/fixtures/flutter_logo_baked.png
-rw-r--r--@ 1 bdero  primarygroup   263K Dec  7 13:13 impeller/fixtures/flutter_logo_baked.png

Looks like it found a way to save 3k on this image. 👍
I bet we'll be able to compress the maps with less detailed PBR channels a lot more when I eventually add them for testing purposes.

jpegs seem like an appropriate option for these test images as well.

@bdero bdero added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 7, 2022
@auto-submit auto-submit bot merged commit 0bddc60 into flutter:main Dec 7, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 9, 2022
…116802)

* bd8bcf956 Roll Fuchsia Mac SDK from crEcyXdyZ686cAqMV... to pMV6A0ykZQ8aA3NG2... (flutter/engine#38120)

* dec8b5221 Preliminary implementation of UIA for A11y on Windows (flutter/engine#37754)

* 5545ccf87 Roll Fuchsia Linux SDK from NlJGkMbtZqQ6_BCpu... to xn8ztWtp-zww-jObz... (flutter/engine#38122)

* 80a15a419 Create FlutterActivity/FlutterFragment using light weight engine with FlutterEngineGroup (flutter/engine#36963)

* 5caef8585 Full implementation of text-input-test (flutter/engine#37986)

* 8f6036e58 Reland fix wrong VSYNC event (flutter/engine#37865)

* 4101c363c [iOS] Change locale format for spell check (flutter/engine#38080)

* 2f5b67e4d [embedder] Ensure destruction called on present (flutter/engine#38078)

* 0bddc6045 [Impeller Scene] Depth attachment; baked lighting example (flutter/engine#38118)

* 6aa4ccd60 Remove dlCanvasRecorder from flutter::PictureRecorder (flutter/engine#38127)

* dbb5284f2 [Windows] Add more cursor plugin tests (flutter/engine#38112)

* 6e91204d9 Roll Fuchsia Mac SDK from pMV6A0ykZQ8aA3NG2... to 9SnrQ0vbR8IC7UIoP... (flutter/engine#38135)

* 3140ad924 [Impeller] order metal samplers according to declared order and not usage order (flutter/engine#38115)

* 84abf21d4 Remove autoninja. (flutter/engine#38136)

* 8a113d328 [embedder] Expose metal surface from test context (flutter/engine#38133)

* 1ef25b63f Roll Fuchsia Mac SDK from 9SnrQ0vbR8IC7UIoP... to aMW0DjntzFJj4RoR3... (flutter/engine#38139)

* 748b3bc15 Revert "Remove dlCanvasRecorder from flutter::PictureRecorder (#38127)" (flutter/engine#38137)

* b6daf3d06 [embedder] Consistent naming for GL/Metal tests (flutter/engine#38141)

* 339d04baf [web] Trivial fix for non-static interop JS interop class. (flutter/engine#38126)

* 1fcbb9c11 [tools] Eliminate version on Obj-C docs (flutter/engine#38145)

* 71928b6a4 [Impeller] Use DrawPath instead of Rect geometry when the paint style is stroke (flutter/engine#38146)

* 23ce8fdbc Roll Skia from dd3285a80b23 to f84dc9303045 (4 revisions) (flutter/engine#38123)

* 366f8663b Roll Skia from f84dc9303045 to 2691cd7b4110 (40 revisions) (flutter/engine#38151)

* 447e7013e Roll Skia from 2691cd7b4110 to 711396b81248 (1 revision) (flutter/engine#38152)

* cd5d91bf9 Pylint testing/run_tests.py (flutter/engine#38016)

* aafac083b Roll Skia from 711396b81248 to b253b10374e7 (7 revisions) (flutter/engine#38157)

* 799dc78e8 Roll Fuchsia Linux SDK from xn8ztWtp-zww-jObz... to rRJIjuO-dPNCpCTd9... (flutter/engine#38134)

* 3aa3d2a8f Massage the JS interop around `didCreateEngineInitializer` (flutter/engine#38147)

* 030950f30 Roll Skia from b253b10374e7 to ec407902999b (3 revisions) (flutter/engine#38158)
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…lutter#116802)

* bd8bcf956 Roll Fuchsia Mac SDK from crEcyXdyZ686cAqMV... to pMV6A0ykZQ8aA3NG2... (flutter/engine#38120)

* dec8b5221 Preliminary implementation of UIA for A11y on Windows (flutter/engine#37754)

* 5545ccf87 Roll Fuchsia Linux SDK from NlJGkMbtZqQ6_BCpu... to xn8ztWtp-zww-jObz... (flutter/engine#38122)

* 80a15a419 Create FlutterActivity/FlutterFragment using light weight engine with FlutterEngineGroup (flutter/engine#36963)

* 5caef8585 Full implementation of text-input-test (flutter/engine#37986)

* 8f6036e58 Reland fix wrong VSYNC event (flutter/engine#37865)

* 4101c363c [iOS] Change locale format for spell check (flutter/engine#38080)

* 2f5b67e4d [embedder] Ensure destruction called on present (flutter/engine#38078)

* 0bddc6045 [Impeller Scene] Depth attachment; baked lighting example (flutter/engine#38118)

* 6aa4ccd60 Remove dlCanvasRecorder from flutter::PictureRecorder (flutter/engine#38127)

* dbb5284f2 [Windows] Add more cursor plugin tests (flutter/engine#38112)

* 6e91204d9 Roll Fuchsia Mac SDK from pMV6A0ykZQ8aA3NG2... to 9SnrQ0vbR8IC7UIoP... (flutter/engine#38135)

* 3140ad924 [Impeller] order metal samplers according to declared order and not usage order (flutter/engine#38115)

* 84abf21d4 Remove autoninja. (flutter/engine#38136)

* 8a113d328 [embedder] Expose metal surface from test context (flutter/engine#38133)

* 1ef25b63f Roll Fuchsia Mac SDK from 9SnrQ0vbR8IC7UIoP... to aMW0DjntzFJj4RoR3... (flutter/engine#38139)

* 748b3bc15 Revert "Remove dlCanvasRecorder from flutter::PictureRecorder (flutter#38127)" (flutter/engine#38137)

* b6daf3d06 [embedder] Consistent naming for GL/Metal tests (flutter/engine#38141)

* 339d04baf [web] Trivial fix for non-static interop JS interop class. (flutter/engine#38126)

* 1fcbb9c11 [tools] Eliminate version on Obj-C docs (flutter/engine#38145)

* 71928b6a4 [Impeller] Use DrawPath instead of Rect geometry when the paint style is stroke (flutter/engine#38146)

* 23ce8fdbc Roll Skia from dd3285a80b23 to f84dc9303045 (4 revisions) (flutter/engine#38123)

* 366f8663b Roll Skia from f84dc9303045 to 2691cd7b4110 (40 revisions) (flutter/engine#38151)

* 447e7013e Roll Skia from 2691cd7b4110 to 711396b81248 (1 revision) (flutter/engine#38152)

* cd5d91bf9 Pylint testing/run_tests.py (flutter/engine#38016)

* aafac083b Roll Skia from 711396b81248 to b253b10374e7 (7 revisions) (flutter/engine#38157)

* 799dc78e8 Roll Fuchsia Linux SDK from xn8ztWtp-zww-jObz... to rRJIjuO-dPNCpCTd9... (flutter/engine#38134)

* 3aa3d2a8f Massage the JS interop around `didCreateEngineInitializer` (flutter/engine#38147)

* 030950f30 Roll Skia from b253b10374e7 to ec407902999b (3 revisions) (flutter/engine#38158)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants