Compare commits

...

258 Commits

Author SHA1 Message Date
59f2249e07 refactor(srp): add asset runtime invalidation seam 2026-04-20 03:06:04 +08:00
d196ec9264 refactor(srp): add renderer data invalidation seam
Introduce ScriptableRendererData dirty/invalidation support so renderer and feature caches can be released and rebuilt within the same managed asset runtime.

Add managed probes and scripting coverage for non-public dirty APIs and for renderer rebuild after invalidation, then archive the completed phase plan.
2026-04-20 02:48:16 +08:00
5e88449e3d refactor(srp): move renderer feature setup into renderer data
Introduce a formal ScriptableRendererData setup seam so renderer feature attachment is owned by renderer data instead of renderer constructors pulling feature caches.

Route lifecycle and reuse probes through the new setup path, lock the non-public setup seam in the API surface probe, and update scripting expectations accordingly.
2026-04-20 02:30:07 +08:00
778913ddcb refactor(srp): make universal renderer execution context-first
Promote ScriptableRenderer renderer-recording context methods to the primary Universal execution seam and route the renderer-driven pipeline through that seam.

Update managed probes and scripting expectations to cover the new non-public renderer recording contract, and archive the completed phase plan.
2026-04-20 02:15:47 +08:00
cd29c8b2bc feat(srp): add renderer-driven pipeline backbone
Introduce renderer-driven and renderer-backed managed pipeline base types in the Universal package.

Move shared renderer-data/default-renderer ownership out of UniversalRenderPipelineAsset, migrate probe assets onto the generic seam, and expose renderer recording/request context types for future SRP expansion.

Update scripting API-surface expectations and validate with build, unit tests, scripting tests, and old editor smoke.
2026-04-20 02:05:17 +08:00
9e6c473186 feat(srp): add managed camera frame planning seam
Expose native camera frame planning controls to managed pipeline assets and renderer features.

Allow managed planning to override fullscreen stage heuristics while keeping CameraFramePlan as the native execution contract.

Add scripting coverage, probe assets, and archive the phase plan after build, test, and editor smoke validation.
2026-04-20 01:48:16 +08:00
58dde75d3d refactor(srp): add managed lifecycle cleanup seams
Invoke managed pipeline disposal and asset runtime cleanup from the native bridge lifecycle. Add Universal renderer and feature cleanup hooks plus regression probes to verify runtime cache teardown semantics.
2026-04-20 01:14:37 +08:00
beaf5809d5 refactor(srp): unify managed pipeline instance ownership
Move shared managed ScriptableRenderPipeline instance ownership into MonoManagedRenderPipelineAssetRuntime.

Make stage recorders borrow the runtime-owned pipeline instead of creating and destroying private handles.

Add a regression test that locks one CreatePipeline call across multiple stage recorders.
2026-04-20 00:44:09 +08:00
cbc0ddbd42 refactor(srp): formalize universal renderer selection and caching 2026-04-20 00:16:32 +08:00
ad32d64269 refactor(srp): move universal backend ownership into renderer data 2026-04-20 00:04:24 +08:00
9c8f2ae84c refactor(srp): let universal assets declare native backend keys 2026-04-19 23:32:41 +08:00
21b790c2f8 refactor(srp): unify mono recorder backend ownership 2026-04-19 23:09:34 +08:00
74e790891c refactor(srp): decouple managed pipeline assets from fixed native backend 2026-04-19 21:46:05 +08:00
20e727e882 refactor(srp): close universal recording composition seam 2026-04-19 17:00:48 +08:00
6c605bbe20 refactor(srp): hide universal recording helpers behind base apis 2026-04-19 16:17:38 +08:00
93f06e84ed Refactor new editor boundaries and test ownership 2026-04-19 15:52:28 +08:00
dc13b56cf3 refactor(srp): collapse universal pipeline wrappers 2026-04-19 15:33:03 +08:00
237a628e2a refactor(srp): rename camera request context surface 2026-04-19 15:20:34 +08:00
8edc68f02b refactor(srp): move recording helpers into universal extensions 2026-04-19 14:42:57 +08:00
f4d4112e2f refactor(srp): move rendering data ownership into universal package 2026-04-19 14:19:57 +08:00
a7cda9375a refactor(srp): move renderer model into universal package 2026-04-19 14:11:25 +08:00
570467a083 refactor(srp): rename first-party renderer package to universal 2026-04-19 14:04:19 +08:00
537d7d99fc refactor(srp): remove managed frame planning hook
- derive fullscreen stage planning from pipeline render-graph support
- trim planning-only APIs from the managed SRP bridge and public surface
- update probes and tests to lock the slimmer SRP API boundary
2026-04-19 13:47:20 +08:00
08e2b38df2 refactor(srp): hide pipeline data behind rendering data 2026-04-19 13:12:26 +08:00
0cea7b80e8 refactor(srp): align renderer api with unity contexts 2026-04-19 13:05:57 +08:00
fe7e6dddf3 refactor(srp): move renderer request helpers out of core 2026-04-19 05:34:43 +08:00
9da85e9ad8 refactor(srp): move rendering data into renderer layer 2026-04-19 05:25:47 +08:00
11a03a4b46 refactor(srp): unify engine managed assembly discovery 2026-04-19 05:17:42 +08:00
5fa209ab5d refactor(srp): split universal managed pipeline assembly 2026-04-19 05:03:56 +08:00
f45b34a03a Refactor new editor state ownership model 2026-04-19 04:36:52 +08:00
48bfde28e3 refactor(rendering): formalize pipeline selection and engine asset discovery 2026-04-19 04:31:48 +08:00
78bcd2e9ca refactor(new_editor): unify panel input and rename primitives 2026-04-19 03:23:16 +08:00
c59cd83c38 refactor(new_editor): tighten app dependency boundaries 2026-04-19 02:48:41 +08:00
7429f22fb1 refactor(rendering): split managed SRP layers and namespaces 2026-04-19 02:38:48 +08:00
612e3ba0b3 refactor(new_editor): internalize legacy viewport gizmo support 2026-04-19 00:36:24 +08:00
0819424e94 feat(reference): add urp nahida sample project 2026-04-19 00:33:03 +08:00
a65d5cfd21 chore(gitignore): ignore local capture and packaging artifacts 2026-04-19 00:31:59 +08:00
6e26ec7103 refactor(mvs): simplify 3dgs d3d12 render path 2026-04-19 00:30:42 +08:00
1405ef6a29 feat(project): refresh sample scenes and Nahida assets 2026-04-19 00:29:32 +08:00
f4fef59b2f feat(rendering): add volumetric performance coverage 2026-04-19 00:27:13 +08:00
d2017b251c feat(audio): formalize runtime effects and wav loading 2026-04-19 00:26:28 +08:00
8164baba0a docs(plan): archive thesis drafts and reference updates 2026-04-19 00:24:25 +08:00
56bfb0e298 chore(gitignore): ignore physx generated directories 2026-04-19 00:22:25 +08:00
b989edca91 feat(rendering): add managed SRP renderer runtime 2026-04-19 00:05:29 +08:00
a57b322bc7 feat(new_editor): wire project, inspector, and viewport runtime 2026-04-19 00:03:25 +08:00
8257403036 feat(editor): persist graphics settings and shadow overrides 2026-04-19 00:01:49 +08:00
9ca7960346 docs(plan): archive editor and SRP milestones 2026-04-18 23:57:55 +08:00
7dfdda2b11 Refine new_editor scene viewport flow 2026-04-18 23:56:17 +08:00
f544b2792b Refactor new editor scene viewport tools 2026-04-18 18:55:19 +08:00
b8e84001fa fix(rendering): preserve managed SRP selection across scene replace 2026-04-18 17:47:11 +08:00
cac6e34fa5 fix(rendering): clear managed SRP selection on runtime stop 2026-04-18 16:52:59 +08:00
30ee70a4d1 feat(rendering): select managed SRP through asset instances 2026-04-18 16:41:53 +08:00
849625e732 feat(rendering): expose managed SRP asset final color defaults 2026-04-18 16:19:54 +08:00
5fd474d08d feat(rendering): add shader-vector fullscreen SRP seam
Generalize the native fullscreen pass and descriptor plumbing so managed SRP can request shader-driven fullscreen stages without being locked to the ColorScale path.

Keep ColorScale as a convenience descriptor mapped to the builtin color-scale shader, and add native fullscreen factory coverage for the new shader-vector path.
2026-04-18 16:08:01 +08:00
2b6d62a127 refactor(rendering): unify managed fullscreen planning stage api
replace post-process and final-output specific planning calls with a single fullscreen stage bridge

align managed planning with the native CameraFrameStage fullscreen seam
2026-04-18 15:12:41 +08:00
eb39f87cdd docs: rewrite MiniEngine Core graphics feature guide 2026-04-18 15:02:48 +08:00
c4adbcd83e refactor(rendering): genericize native fullscreen pass descriptors
replace camera-specific post-process descriptor naming with generic fullscreen pass types

route camera planning and managed SRP runtime through the same fullscreen pass seam
2026-04-18 14:59:55 +08:00
c91e87f2e2 refactor(rendering): queue managed fullscreen pass descriptors 2026-04-18 13:51:09 +08:00
788b1b971e refactor(rendering): rename native scene recorder seam 2026-04-18 13:36:37 +08:00
cf54014de9 refactor(rendering): remove builtin naming from managed srp context 2026-04-18 13:30:45 +08:00
2409f479e9 refactor(rendering): route managed scene recording through native scene renderer factory 2026-04-18 01:24:21 +08:00
1ba73fdf0a refactor(rendering): extract native scene renderer contract for srp 2026-04-18 01:19:02 +08:00
df02a4e741 fix(rendering): refresh managed pipelines on srp environment changes 2026-04-18 01:10:45 +08:00
e388b6fbe3 fix(rendering): rebind managed srp asset runtime after bridge reset 2026-04-18 01:01:30 +08:00
afb2c1579c test(rendering): prove managed forward pipeline scene render path 2026-04-18 00:51:51 +08:00
b48760ca3d Refactor new editor scene runtime ownership 2026-04-18 00:45:14 +08:00
2fe1076218 test(rendering): add managed default pipeline selection probe 2026-04-18 00:22:15 +08:00
a6c78af54c feat(rendering): add managed camera request planning seam 2026-04-18 00:07:13 +08:00
fa9a5ffb00 refactor(rendering): retain managed pipeline asset runtime per native asset 2026-04-17 23:54:04 +08:00
6838b00d97 feat(rendering): add managed fullscreen stage planning seam 2026-04-17 23:39:08 +08:00
4a4e921eb1 new_editor: fix detached multi-tab tab dragging 2026-04-17 23:18:05 +08:00
b9f78c29b8 feat(rendering): add managed fullscreen stage recording seam 2026-04-17 22:58:39 +08:00
ed9b5178f8 docs: archive old plans 2026-04-17 22:43:27 +08:00
a10d1d80b0 docs: clarify new_editor closure status 2026-04-17 22:37:26 +08:00
bf9a906464 new_editor: filter closing windows from interaction 2026-04-17 22:35:16 +08:00
ba8437d919 new_editor: make window sync rollback safe 2026-04-17 22:32:58 +08:00
6f6c8877fa feat(rendering): expose builtin forward scene steps to srp context 2026-04-17 22:26:51 +08:00
69319b4a7b new_editor: filter dead windows from live workspace sets 2026-04-17 22:20:06 +08:00
8f051fd1d1 new_editor: harden cross-window drag validation 2026-04-17 22:16:34 +08:00
066442cee5 new_editor: revalidate same-window workspace mutations 2026-04-17 22:12:01 +08:00
0ef6d2a365 new_editor: tighten detached window transfer invariants 2026-04-17 22:03:56 +08:00
af6e0858be new_editor: close integration build boundary 2026-04-17 21:57:24 +08:00
9026aff881 feat(rendering): add scriptable render context v1 2026-04-17 21:53:52 +08:00
4e2261ad37 docs: fix MiniEngine Core guide encoding 2026-04-17 21:42:06 +08:00
f4fb859972 feat(scripting): add managed SRP runtime bridge 2026-04-17 21:38:22 +08:00
8f847db816 new_editor: tighten window workspace validation 2026-04-17 21:23:47 +08:00
a8b3877f4b docs: add MiniEngine Core beginner guide 2026-04-17 19:53:42 +08:00
e087f1f2b0 docs(rendering): add rendergraph and SRP architecture overview 2026-04-17 19:42:38 +08:00
52af8e3a6f refactor(new_editor): close docking loop and app internals 2026-04-15 23:13:09 +08:00
cd8ce5947c refactor(rendering): move old editor viewport passes out of engine 2026-04-15 22:54:38 +08:00
dde03c5241 refactor(new_editor): continue architecture closeout 2026-04-15 22:47:42 +08:00
a458f2838c refactor(rendering): remove unused object id outline pass 2026-04-15 22:36:38 +08:00
e9da6b290d refactor(rendering): shrink render pass graph compatibility helpers 2026-04-15 22:32:21 +08:00
a8c1337774 refactor(rendering): move scene request shadow planning behind pipeline assets 2026-04-15 22:25:04 +08:00
cf1d6e1c1a refactor(rendering): extract default pipeline resolution from camera renderer 2026-04-15 21:55:35 +08:00
e23d9710e7 refactor(rendering): move directional shadow execution defaults into pipeline 2026-04-15 21:48:41 +08:00
02438762fd refactor(rendering): move host standalone pass defaults into assets 2026-04-15 21:32:50 +08:00
f2eebfc842 refactor(rendering): move scene data policy into render pipelines 2026-04-15 21:28:02 +08:00
215c353ace refactor(rendering): move frame plan defaults behind pipeline assets 2026-04-15 21:22:29 +08:00
02aa9a8ea5 refactor(rendering): auto-initialize scriptable render pipeline host 2026-04-15 21:15:39 +08:00
966106e0c0 refactor(rendering): make camera frame plans own generated sequences 2026-04-15 21:06:30 +08:00
8798e63e32 refactor(rendering): formalize native graph recording helpers 2026-04-15 20:46:00 +08:00
7b9e172dbf test(scripting): cover scriptable render pipeline asset selection 2026-04-15 20:16:50 +08:00
04ecac26d6 feat(scripting): add managed srp base api 2026-04-15 20:14:48 +08:00
cafe3c8076 refactor(rendering): add srp host stage recorder bridge 2026-04-15 20:07:52 +08:00
22a2b982ef refactor(rendering): clean native scene graph naming 2026-04-15 20:00:30 +08:00
5e841ddd1b refactor(rendering): rename stage graph contract files 2026-04-15 19:36:21 +08:00
7671663b12 refactor(rendering): generalize pipeline stage render graph boundary 2026-04-15 19:31:52 +08:00
df8f433fbb refactor(new_editor): streamline internal layout and command routing 2026-04-15 19:30:58 +08:00
9654f4d91a test(editor): verify physics play session runtime closure 2026-04-15 17:51:22 +08:00
308fbd0aac refactor(rendering): drive main scene graph usage through stage policy 2026-04-15 16:49:21 +08:00
bf0b81d034 refactor(rendering): centralize stage graph output policies 2026-04-15 16:42:36 +08:00
c853f67c56 refactor(rendering): remove main scene stage recording special cases 2026-04-15 16:18:35 +08:00
03ee1706ae refactor(rendering): formalize fallback stage policy 2026-04-15 16:09:20 +08:00
e93196c7d0 refactor(rendering): share stage runtime request resolution 2026-04-15 15:55:16 +08:00
5d54799f05 refactor(rendering): unify stage runtime request dispatch 2026-04-15 15:46:27 +08:00
93b5c446cb refactor(rendering): formalize shared stage output surfaces 2026-04-15 15:35:38 +08:00
ce573d4e2d refactor(rendering): unify fullscreen stage color-chain queries 2026-04-15 15:31:05 +08:00
3afe44d2fa refactor(rendering): centralize camera frame stage graph policy 2026-04-15 15:28:15 +08:00
1ad3bfc702 refactor(rendering): centralize fullscreen stage surface resolution 2026-04-15 15:20:59 +08:00
795eaf80df refactor(rendering): formalize camera frame stage contracts 2026-04-15 15:14:06 +08:00
3937badf37 docs: restructure thesis chapters 4 to 6 2026-04-15 14:55:52 +08:00
65cb212020 fix(scripting): stabilize mono wrapper test teardown 2026-04-15 14:27:21 +08:00
982a877714 docs: refine thesis chapters 3 and 7 2026-04-15 14:23:51 +08:00
bda8a35d77 feat(scripting): expose PhysX rigidbody and raycast APIs 2026-04-15 13:58:30 +08:00
914c9361ed refactor(rendering): shorten camera-frame graph file layout 2026-04-15 13:53:44 +08:00
aec7d79d83 fix(new_editor/cursor): stabilize multi-window resize cursors 2026-04-15 13:44:07 +08:00
608f33d4d3 fix(new_editor/docking): darken overlay and use full center preview 2026-04-15 13:37:39 +08:00
51aea47c83 feat(physics): dispatch PhysX simulation events to scene scripts 2026-04-15 13:36:39 +08:00
077786e4c7 docs: update thesis draft chapters 2026-04-15 13:23:32 +08:00
7e21e3887e fix(new_editor/docking): restore cross-window drop preview 2026-04-15 13:22:58 +08:00
07516b8c2c refactor(rendering): formalize camera-frame fallback surface io modes 2026-04-15 13:16:13 +08:00
b97f9a1555 refactor(rendering): formalize compatible raster pass recording helpers 2026-04-15 13:12:07 +08:00
3f0f279000 refactor(rendering): infer raster pass graph io from declared context 2026-04-15 13:07:09 +08:00
2605608685 fix(new_editor/tab-drag): keep floating window under cursor 2026-04-15 13:03:44 +08:00
ea2e44976a refactor(rendering): add override helpers for shared recording contexts 2026-04-15 13:01:04 +08:00
8aee665d32 refactor(rendering): add callback helpers for common graph pass contracts 2026-04-15 12:55:51 +08:00
1d207cf251 feat(physics): add rigidbody velocity control 2026-04-15 12:53:36 +08:00
8645334e38 refactor(rendering): formalize common raster pass graph contracts 2026-04-15 12:52:44 +08:00
c5dcfaedd5 feat(physics): sync runtime physx body state 2026-04-15 12:47:40 +08:00
7cbc992bd8 feat(physics): add physx raycast queries 2026-04-15 12:43:38 +08:00
f90f449745 refactor(rendering): route feature pass recording through shared context 2026-04-15 12:40:31 +08:00
d501e895eb fix(new_editor/window): move detached root tab into title bar 2026-04-15 12:38:45 +08:00
59941626a7 feat(physics): sync scene actors into physx 2026-04-15 12:37:57 +08:00
c0b61df417 refactor(rendering): reuse shared recording context in forward builder 2026-04-15 12:37:37 +08:00
f020bb759e refactor(rendering): derive stage recording contexts from shared defaults 2026-04-15 12:31:16 +08:00
31f40e2cbb feat(physics): wire physx sdk into build 2026-04-15 12:22:15 +08:00
5bf258df6d refactor(rendering): formalize shared render-graph recording context 2026-04-15 12:17:33 +08:00
9c5b19a928 feat(editor): add audio and physics component editor coverage 2026-04-15 12:15:13 +08:00
34aca206ce fix(physics): keep stub backend buildable without physx 2026-04-15 12:09:09 +08:00
92ba032660 refactor(new_editor/fields): split color field rendering 2026-04-15 11:59:12 +08:00
3317e47009 feat(physics): add runtime physics scaffolding 2026-04-15 11:58:27 +08:00
d17ddffdef refactor(new_editor/shell): split shell interaction responsibilities 2026-04-15 11:52:30 +08:00
78548b610c refactor(new_editor/fields): split property grid rendering and interaction 2026-04-15 11:42:56 +08:00
053c5a1242 refactor(rendering): move recorded stage execution into contract 2026-04-15 11:39:06 +08:00
4fa178cfd1 refactor(new_editor/docking): split dock host interaction helpers 2026-04-15 11:23:39 +08:00
1c84520738 refactor(new_editor/docking): split dock host rendering and hit testing 2026-04-15 11:18:48 +08:00
701ddd9e9d refactor(new_editor/workspace): split workspace controller responsibilities 2026-04-15 11:13:16 +08:00
dedf149f59 docs: update thesis draft 2026-04-15 11:11:22 +08:00
feffa36692 refactor(new_editor/workspace): split workspace model responsibilities 2026-04-15 11:08:18 +08:00
936b10590a refactor(rendering): move standalone stage graph inputs into contract 2026-04-15 10:49:16 +08:00
57f61b05eb refactor(new_editor/app): split editor window frame runtime 2026-04-15 10:47:57 +08:00
b5ca544d31 refactor(new_editor/app): unify borderless dwm attribute dispatch 2026-04-15 10:42:58 +08:00
ddfed4c37b refactor(rendering): move stage resource publication into contract 2026-04-15 10:42:10 +08:00
e95bdb3149 refactor(new_editor/app): split viewport render target cleanup 2026-04-15 10:40:37 +08:00
2606d15e26 refactor(new_editor/app): split native renderer draw responsibilities 2026-04-15 10:36:09 +08:00
5e2693a16a refactor(new_editor/app): move entry point and split window synchronization 2026-04-15 10:31:01 +08:00
e42b0dc50b refactor(rendering): move sequence graph pass authoring into contract 2026-04-15 10:30:04 +08:00
1c9f9a835d refactor(new_editor/app): isolate cross-window drop support 2026-04-15 08:56:57 +08:00
31a979f779 refactor(rendering): route camera-stage graph pass recording through contract 2026-04-15 08:51:40 +08:00
302a13bc99 refactor(new_editor/app): split native renderer lifecycle hotspots 2026-04-15 08:49:14 +08:00
6f1a7120d2 refactor(rendering): move stage graph pass context into contract 2026-04-15 08:45:42 +08:00
0e7bf8d16e refactor(new_editor/app): split frame support and texture decoding 2026-04-15 08:45:04 +08:00
9f3ea11dbc refactor(rendering): move fullscreen stage source binding into contract 2026-04-15 08:38:58 +08:00
f049d9d29e refactor(new_editor/app): split window manager and editor context hotspots 2026-04-15 08:37:07 +08:00
ecb7f24794 refactor(rendering): share camera-stage sequence recording loop 2026-04-15 08:25:48 +08:00
9e5954cf0a refactor(new_editor/app): reorganize host structure and add smoke test 2026-04-15 08:24:06 +08:00
3617b4840b refactor(rendering): route camera-stage fallback pass through graph contract 2026-04-15 08:18:36 +08:00
ac5bf9976d refactor(rendering): formalize camera-stage fallback surface contract 2026-04-15 08:14:13 +08:00
c7241338c9 refactor(rendering): route camera-stage recording through shared graph contract 2026-04-15 08:10:06 +08:00
2cda9fd24a Rendering: formalize main-scene graph contract 2026-04-15 07:56:00 +08:00
8b156dd112 docs(new_editor): archive legacy plans and define consolidation roadmap 2026-04-15 07:52:56 +08:00
0c9a67aaca Rendering: formalize render-pass graph contract 2026-04-15 07:39:28 +08:00
c58c28529f Rendering: formalize camera-frame graph builder context 2026-04-15 07:27:09 +08:00
83f55ed5c0 Rendering: formalize render graph recording context 2026-04-15 07:15:48 +08:00
aa727202af Add managed render pipeline selection bridge 2026-04-15 01:57:14 +08:00
ec6965b0dd Add scriptable render pipeline host 2026-04-15 01:33:42 +08:00
82b8bd22cc Introduce native render pipeline host 2026-04-15 01:26:25 +08:00
d0ce2d7883 Centralize render-graph recording context builders 2026-04-15 01:18:15 +08:00
65b3078c7f Extract builtin forward main-scene graph builder 2026-04-15 01:07:59 +08:00
f6fb396a41 Move camera frame plan logic out of public header 2026-04-15 01:00:40 +08:00
f064d6ed68 Extract camera frame fullscreen stage planner 2026-04-15 00:53:51 +08:00
0afcaa0b3b Move render-graph stage policy into internal host 2026-04-15 00:36:11 +08:00
00fa6fffa0 Group camera frame fullscreen color chain intent 2026-04-15 00:32:23 +08:00
ac836ae961 Extract camera frame stage surface resolver 2026-04-15 00:25:19 +08:00
5edc4ed242 Extract camera frame render-graph stage pass runtime 2026-04-15 00:13:35 +08:00
d92afa27da Extract camera frame render-graph stage record context 2026-04-15 00:08:39 +08:00
8232f59276 Extract camera frame render-graph recording session 2026-04-15 00:01:37 +08:00
16f994b5e5 Extract camera frame render-graph stage dispatcher 2026-04-14 23:44:15 +08:00
bc6fb25ff0 Fix XCUI editor app composition source paths 2026-04-14 23:43:44 +08:00
f26b0024f2 Move camera frame render-graph lifecycle into execution module 2026-04-14 23:38:22 +08:00
3e5b7287c7 Split camera frame render-graph stage recording helpers 2026-04-14 23:33:35 +08:00
39c7ef5fdf Extract camera frame render-graph stage state module 2026-04-14 23:15:40 +08:00
abf30ecfd3 Extract camera frame render-graph stage recording module 2026-04-14 23:03:44 +08:00
61ecb7146d Extract camera frame render-graph execution module 2026-04-14 22:50:16 +08:00
599f622ba4 Extract camera frame render-graph surface utilities 2026-04-14 22:39:35 +08:00
3ea8ce81d6 Factor camera frame render-graph stage build state 2026-04-14 22:28:13 +08:00
a67f8597ba Extract camera frame render-graph stage policy helpers 2026-04-14 22:17:12 +08:00
a02ff65651 Extract camera frame render-graph resource contract header 2026-04-14 22:05:28 +08:00
a3efcda550 Unify camera frame graph resource binding helpers 2026-04-14 22:00:03 +08:00
86eb455ab9 Remove explicit feature-pass shadow graph handle 2026-04-14 21:40:02 +08:00
5b0a1743d9 Formalize camera frame render-graph blackboard resources 2026-04-14 21:34:34 +08:00
1e189ff558 Unify builtin forward phase render graph recording 2026-04-14 21:22:56 +08:00
9980aa9be5 Harden render graph pass capture and feature source-color contract 2026-04-14 21:11:04 +08:00
1d171ea61c Split builtin forward pipeline into feature and internal modules 2026-04-14 20:50:31 +08:00
e1734181a0 audio: return thread-safe state snapshots 2026-04-14 20:44:56 +08:00
c710063d92 Graph-manage camera fullscreen stage routing 2026-04-14 19:32:27 +08:00
c4fe643427 audio: remove unused state lock helpers 2026-04-14 19:24:20 +08:00
23bdf9ed48 audio: snapshot mixer state for render thread 2026-04-14 19:22:24 +08:00
78556ea683 audio: narrow render locking to snapshots 2026-04-14 19:15:23 +08:00
5a938935e1 Remove legacy camera sequence execution path 2026-04-14 19:04:55 +08:00
882df1ae5a audio: switch waveout backend to pull rendering 2026-04-14 19:04:18 +08:00
e77dbe40b1 Graph-ify camera pass sequences 2026-04-14 18:56:04 +08:00
4c79554050 Graph-ify camera stage render passes 2026-04-14 17:16:08 +08:00
4fe456c1a2 Add render-graph blackboard for camera frame resources 2026-04-14 16:59:10 +08:00
3e6e997485 Refine detached tab drag host behavior 2026-04-14 16:56:30 +08:00
2a9264cfe4 Graph-ify forward feature injection points 2026-04-14 16:49:06 +08:00
a4c48c1b3f audio: clear mixer routes on destruction 2026-04-14 16:48:39 +08:00
ee03f7035b audio: extract mix render block from update 2026-04-14 16:42:25 +08:00
3e56757910 audio: make system own master gain semantics 2026-04-14 16:39:29 +08:00
a91df8b4cd Split render-graph main scene into forward segments 2026-04-14 16:31:32 +08:00
0060a348f6 audio: clarify waveout device contract 2026-04-14 16:30:02 +08:00
2eaab2481f audio: reuse audio system scratch buffers 2026-04-14 16:25:11 +08:00
c495581878 Add render-graph main-scene pipeline recording 2026-04-14 16:22:58 +08:00
307259091e Implement multi-window detached tab host flow 2026-04-14 16:19:23 +08:00
4b58df9a61 audio: share decoded clip cache across sources 2026-04-14 16:17:17 +08:00
5de4848d70 Graph-manage single-pass fullscreen stages 2026-04-14 15:08:08 +08:00
3f871a4f45 Lay groundwork for detached editor windows 2026-04-14 15:07:52 +08:00
804e5138d7 Graph-manage main scene imported surfaces 2026-04-14 14:58:40 +08:00
af6de86647 Add render graph runtime UAV support 2026-04-14 14:46:13 +08:00
91c62c6b14 Refine new editor shell host and embedded icons 2026-04-14 14:41:45 +08:00
4ee1bcc599 Integrate graph-managed depth surfaces into camera stages 2026-04-14 14:27:30 +08:00
31a8125fc1 Add render graph runtime depth support 2026-04-14 14:05:59 +08:00
87bf83451b Add render graph depth access semantics 2026-04-14 13:56:08 +08:00
9950e0a44f Move fullscreen graph ownership out of pass transitions 2026-04-14 13:48:59 +08:00
8bd375cd24 Add render graph texture transition plans 2026-04-14 04:45:39 +08:00
c0d62dc749 Support graph-owned imported texture transitions 2026-04-14 04:41:58 +08:00
c98b41f6f4 Implement render graph compiler and transient fullscreen execution 2026-04-14 04:37:07 +08:00
72d09a1c49 Fix editor host resize and dock splitter behavior 2026-04-14 03:34:31 +08:00
ba91e0f5dd Fix borderless host resize presentation ordering 2026-04-14 01:42:44 +08:00
9064c2f5f2 Add borderless editor host chrome 2026-04-14 01:14:45 +08:00
5797a75619 Extract frame-plan fullscreen stage builder 2026-04-14 01:01:45 +08:00
e83f911aef Add borderless host migration plan 2026-04-14 00:56:23 +08:00
dd2299c8b0 Clarify frame plan compatibility adapters 2026-04-14 00:54:47 +08:00
b8d29e39f6 Migrate scene renderer callers to frame plans 2026-04-14 00:52:43 +08:00
72914b3865 Keep shadow execution state out of scene planner 2026-04-14 00:43:55 +08:00
e6950fa704 Switch scene viewport flow to frame plans 2026-04-14 00:40:11 +08:00
21b0530f7b Separate request and frame-stage execution contracts 2026-04-14 00:30:15 +08:00
3445 changed files with 8663573 additions and 28476 deletions

14
.gitignore vendored
View File

@@ -24,3 +24,17 @@ Res/NanoVDB/
!engine/third_party/assimp/bin/*.dll
工作/
.trae/
engine/third_party/physx/compiler/
engine/third_party/physx/documentation/
engine/third_party/physx/tools/
.tmp/
imgui.ini
docs/used/draft_docx_extracted.txt
docs/used/draft_docx_reconverted.md
docs/used/draft_docx_reconverted.txt
docs/used/test_capture.ppm
docs/used/test_capture2.ppm
bu.png
屏幕截图 2026-04-13 030852.png
屏幕截图 2026-04-13 031110.png
毕设版打包/

16
.gitmessage Normal file
View File

@@ -0,0 +1,16 @@
# <type>(<scope>): <summary>
#
# Preferred types:
# fix
# refactor
# feat
# docs
# test
# chore
#
# Examples:
# fix(new_editor/window): correct resize invalidation order
# refactor(new_editor/rendering): split D3D12 host device lifecycle
# feat(new_editor/project): add breadcrumb navigation
#
# Keep the summary short and imperative.

View File

@@ -178,7 +178,6 @@
- `tests/Fixtures/`
- `tests/Input/`
- `tests/Memory/`
- `tests/NewEditor/`
- `tests/Rendering/`
- `tests/Resources/`
- `tests/RHI/`

View File

@@ -1,15 +1,20 @@
cmake_minimum_required(VERSION 3.15)
if(MSVC)
if(POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
endif()
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT
"$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
if(POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
endif()
project(XCEngine)
if(MSVC)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT
"$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:/MP>")
if(CMAKE_GENERATOR MATCHES "Visual Studio")
set(CMAKE_VS_GLOBALS "UseMultiToolTask=true")
endif()
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -37,15 +42,198 @@ enable_testing()
option(XCENGINE_ENABLE_MONO_SCRIPTING "Build the Mono-based C# scripting runtime" ON)
option(XCENGINE_BUILD_XCUI_EDITOR_APP "Build the XCUI editor shell app" ON)
set(
XCENGINE_PHYSX_ROOT_DIR
"${CMAKE_SOURCE_DIR}/engine/third_party/physx"
CACHE PATH
"Path to the bundled PhysX SDK root")
set(XCENGINE_PHYSX_INCLUDE_DIR "${XCENGINE_PHYSX_ROOT_DIR}/include")
set(XCENGINE_ENABLE_PHYSX OFF)
set(XCENGINE_PHYSX_LINK_TARGETS)
set(XCENGINE_PHYSX_RUNTIME_DLL_TARGETS)
if(EXISTS "${XCENGINE_PHYSX_INCLUDE_DIR}/PxPhysicsAPI.h")
file(GLOB XCENGINE_PHYSX_BIN_ROOT_CANDIDATES_MD LIST_DIRECTORIES true
"${XCENGINE_PHYSX_ROOT_DIR}/bin/win.x86_64.vc*.md")
file(GLOB XCENGINE_PHYSX_BIN_ROOT_CANDIDATES_MT LIST_DIRECTORIES true
"${XCENGINE_PHYSX_ROOT_DIR}/bin/win.x86_64.vc*.mt")
if(XCENGINE_PHYSX_BIN_ROOT_CANDIDATES_MD)
list(SORT XCENGINE_PHYSX_BIN_ROOT_CANDIDATES_MD COMPARE NATURAL ORDER DESCENDING)
list(GET XCENGINE_PHYSX_BIN_ROOT_CANDIDATES_MD 0 XCENGINE_PHYSX_BIN_ROOT_DIR)
elseif(XCENGINE_PHYSX_BIN_ROOT_CANDIDATES_MT)
list(SORT XCENGINE_PHYSX_BIN_ROOT_CANDIDATES_MT COMPARE NATURAL ORDER DESCENDING)
list(GET XCENGINE_PHYSX_BIN_ROOT_CANDIDATES_MT 0 XCENGINE_PHYSX_BIN_ROOT_DIR)
else()
set(XCENGINE_PHYSX_BIN_ROOT_DIR "")
endif()
set(XCENGINE_PHYSX_BIN_DIR_DEBUG "${XCENGINE_PHYSX_BIN_ROOT_DIR}/debug")
set(XCENGINE_PHYSX_BIN_DIR_RELEASE "${XCENGINE_PHYSX_BIN_ROOT_DIR}/release")
set(XCENGINE_PHYSX_BIN_DIR_PROFILE "${XCENGINE_PHYSX_BIN_ROOT_DIR}/profile")
set(XCENGINE_PHYSX_BIN_DIR_CHECKED "${XCENGINE_PHYSX_BIN_ROOT_DIR}/checked")
if(WIN32 AND
EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PhysXFoundation_64.lib" AND
EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PhysXFoundation_64.dll" AND
EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PhysXCommon_64.lib" AND
EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PhysXCommon_64.dll" AND
EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PhysX_64.lib" AND
EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PhysX_64.dll" AND
EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PhysXExtensions_static_64.lib")
set(XCENGINE_ENABLE_PHYSX ON)
message(STATUS "PhysX SDK headers found: ${XCENGINE_PHYSX_INCLUDE_DIR}")
message(STATUS "PhysX SDK binaries found: ${XCENGINE_PHYSX_BIN_DIR_DEBUG}")
function(xcengine_add_physx_imported_shared target base_name)
add_library(${target} SHARED IMPORTED GLOBAL)
set(imported_configs)
foreach(config_name DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
if(config_name STREQUAL "DEBUG")
set(config_dir "${XCENGINE_PHYSX_BIN_DIR_DEBUG}")
elseif(config_name STREQUAL "RELEASE")
set(config_dir "${XCENGINE_PHYSX_BIN_DIR_RELEASE}")
elseif(config_name STREQUAL "RELWITHDEBINFO")
set(config_dir "${XCENGINE_PHYSX_BIN_DIR_PROFILE}")
else()
set(config_dir "${XCENGINE_PHYSX_BIN_DIR_CHECKED}")
endif()
set(import_lib "${config_dir}/${base_name}.lib")
set(runtime_dll "${config_dir}/${base_name}.dll")
if(EXISTS "${import_lib}" AND EXISTS "${runtime_dll}")
list(APPEND imported_configs ${config_name})
set_property(TARGET ${target} PROPERTY "IMPORTED_IMPLIB_${config_name}" "${import_lib}")
set_property(TARGET ${target} PROPERTY "IMPORTED_LOCATION_${config_name}" "${runtime_dll}")
endif()
endforeach()
if(NOT imported_configs)
message(FATAL_ERROR "PhysX target ${target} has no available runtime binaries.")
endif()
set_property(TARGET ${target} PROPERTY IMPORTED_CONFIGURATIONS "${imported_configs}")
endfunction()
function(xcengine_add_physx_imported_static target base_name)
add_library(${target} STATIC IMPORTED GLOBAL)
set(imported_configs)
foreach(config_name DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
if(config_name STREQUAL "DEBUG")
set(config_dir "${XCENGINE_PHYSX_BIN_DIR_DEBUG}")
elseif(config_name STREQUAL "RELEASE")
set(config_dir "${XCENGINE_PHYSX_BIN_DIR_RELEASE}")
elseif(config_name STREQUAL "RELWITHDEBINFO")
set(config_dir "${XCENGINE_PHYSX_BIN_DIR_PROFILE}")
else()
set(config_dir "${XCENGINE_PHYSX_BIN_DIR_CHECKED}")
endif()
set(static_lib "${config_dir}/${base_name}.lib")
if(EXISTS "${static_lib}")
list(APPEND imported_configs ${config_name})
set_property(TARGET ${target} PROPERTY "IMPORTED_LOCATION_${config_name}" "${static_lib}")
endif()
endforeach()
if(NOT imported_configs)
message(FATAL_ERROR "PhysX target ${target} has no available static libraries.")
endif()
set_property(TARGET ${target} PROPERTY IMPORTED_CONFIGURATIONS "${imported_configs}")
endfunction()
function(xcengine_copy_physx_runtime_dlls target)
foreach(physx_target IN LISTS XCENGINE_PHYSX_RUNTIME_DLL_TARGETS)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:${physx_target}>
$<TARGET_FILE_DIR:${target}>/$<TARGET_FILE_NAME:${physx_target}>
)
endforeach()
endfunction()
xcengine_add_physx_imported_shared(XCPhysXFoundation "PhysXFoundation_64")
xcengine_add_physx_imported_shared(XCPhysXCommon "PhysXCommon_64")
xcengine_add_physx_imported_shared(XCPhysXCore "PhysX_64")
if(EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PVDRuntime_64.lib" AND
EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PVDRuntime_64.dll")
xcengine_add_physx_imported_shared(XCPhysXPVDRuntime "PVDRuntime_64")
list(APPEND XCENGINE_PHYSX_RUNTIME_DLL_TARGETS XCPhysXPVDRuntime)
endif()
if(EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PhysXCooking_64.lib" AND
EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PhysXCooking_64.dll")
xcengine_add_physx_imported_shared(XCPhysXCooking "PhysXCooking_64")
list(APPEND XCENGINE_PHYSX_RUNTIME_DLL_TARGETS XCPhysXCooking)
endif()
xcengine_add_physx_imported_static(XCPhysXExtensions "PhysXExtensions_static_64")
if(EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PhysXPvdSDK_static_64.lib")
xcengine_add_physx_imported_static(XCPhysXPvdSDK "PhysXPvdSDK_static_64")
endif()
if(EXISTS "${XCENGINE_PHYSX_BIN_DIR_DEBUG}/PhysXTask_static_64.lib")
xcengine_add_physx_imported_static(XCPhysXTask "PhysXTask_static_64")
endif()
list(APPEND XCENGINE_PHYSX_LINK_TARGETS
XCPhysXCore
XCPhysXCommon
XCPhysXFoundation
XCPhysXExtensions
)
if(TARGET XCPhysXPVDRuntime)
list(APPEND XCENGINE_PHYSX_LINK_TARGETS XCPhysXPVDRuntime)
endif()
if(TARGET XCPhysXCooking)
list(APPEND XCENGINE_PHYSX_LINK_TARGETS XCPhysXCooking)
endif()
if(TARGET XCPhysXPvdSDK)
list(APPEND XCENGINE_PHYSX_LINK_TARGETS XCPhysXPvdSDK)
endif()
if(TARGET XCPhysXTask)
list(APPEND XCENGINE_PHYSX_LINK_TARGETS XCPhysXTask)
endif()
list(APPEND XCENGINE_PHYSX_RUNTIME_DLL_TARGETS
XCPhysXFoundation
XCPhysXCommon
XCPhysXCore
)
else()
message(STATUS "PhysX SDK headers found, but required binaries are missing; native PhysX backend will stay disabled until the SDK is built")
endif()
else()
message(STATUS "PhysX SDK headers not found; PhysicsWorld will build without native PhysX backend")
endif()
set(
XCENGINE_MONO_ROOT_DIR
"${CMAKE_SOURCE_DIR}/参考/Fermion/Fermion/external/mono"
CACHE PATH
"Path to the bundled Mono distribution used by the scripting runtime")
if(EXISTS "${CMAKE_SOURCE_DIR}/engine/third_party/mono/binary/mscorlib.dll")
set(
XCENGINE_MONO_ROOT_DIR
"${CMAKE_SOURCE_DIR}/engine/third_party/mono"
CACHE PATH
"Path to the bundled Mono distribution used by the scripting runtime"
FORCE)
endif()
add_subdirectory(engine)
add_subdirectory(managed)
add_subdirectory(editor)
add_subdirectory(new_editor)
add_subdirectory(managed)
add_subdirectory(mvs/RenderDoc)
add_subdirectory(tests)

View File

@@ -42,8 +42,6 @@ add_executable(xc_3dgs_d3d12_mvs
shaders/DeviceRadixSort.hlsl
shaders/DebugPointsVS.hlsl
shaders/DebugPointsPS.hlsl
shaders/CompositeVS.hlsl
shaders/CompositePS.hlsl
)
set_source_files_properties(
@@ -54,8 +52,6 @@ set_source_files_properties(
shaders/DeviceRadixSort.hlsl
shaders/DebugPointsVS.hlsl
shaders/DebugPointsPS.hlsl
shaders/CompositeVS.hlsl
shaders/CompositePS.hlsl
PROPERTIES
HEADER_FILE_ONLY TRUE
)

View File

@@ -67,12 +67,10 @@ private:
bool InitializePreparePassResources();
bool InitializeSortResources();
bool InitializeDebugDrawResources();
bool InitializeCompositeResources();
void ShutdownGaussianGpuResources();
void ShutdownPreparePassResources();
void ShutdownSortResources();
void ShutdownDebugDrawResources();
void ShutdownCompositeResources();
void Shutdown();
bool CaptureSortSnapshot();
bool CapturePass3HistogramDebug();
@@ -139,13 +137,6 @@ private:
XCEngine::RHI::RHIPipelineState* m_debugPipelineState = nullptr;
XCEngine::RHI::RHIDescriptorPool* m_debugDescriptorPool = nullptr;
XCEngine::RHI::RHIDescriptorSet* m_debugDescriptorSet = nullptr;
XCEngine::RHI::D3D12Texture m_splatRenderTargetTexture;
std::unique_ptr<XCEngine::RHI::D3D12ResourceView> m_splatRenderTargetRtv;
std::unique_ptr<XCEngine::RHI::D3D12ResourceView> m_splatRenderTargetSrv;
XCEngine::RHI::RHIPipelineLayout* m_compositePipelineLayout = nullptr;
XCEngine::RHI::RHIPipelineState* m_compositePipelineState = nullptr;
XCEngine::RHI::RHIDescriptorPool* m_compositeDescriptorPool = nullptr;
XCEngine::RHI::RHIDescriptorSet* m_compositeDescriptorSet = nullptr;
XCEngine::RHI::D3D12Device m_device;
XCEngine::RHI::D3D12CommandQueue m_commandQueue;

View File

@@ -1,12 +0,0 @@
Texture2D<float4> gSplatTexture : register(t0);
struct PixelInput
{
float4 position : SV_Position;
};
float4 MainPS(PixelInput input) : SV_Target0
{
float4 color = gSplatTexture.Load(int3(int2(input.position.xy), 0));
return float4(color.rgb, color.a);
}

View File

@@ -1,12 +0,0 @@
struct VertexOutput
{
float4 position : SV_Position;
};
VertexOutput MainVS(uint vertexId : SV_VertexID)
{
VertexOutput output = (VertexOutput)0;
float2 quadPosition = float2(vertexId & 1, (vertexId >> 1) & 1) * 4.0 - 1.0;
output.position = float4(quadPosition, 1.0, 1.0);
return output;
}

View File

@@ -37,8 +37,10 @@ VertexOutput MainVS(uint vertexId : SV_VertexID, uint instanceId : SV_InstanceID
float2 quadPosition = float2(vertexId & 1, (vertexId >> 1) & 1) * 2.0 - 1.0;
quadPosition *= 2.0;
float2 scaledAxis1 = view.axis1 * gSettings.w;
float2 scaledAxis2 = view.axis2 * gSettings.w;
float2 deltaScreenPosition =
(quadPosition.x * view.axis1 + quadPosition.y * view.axis2) * 2.0 / gScreenParams.xy;
(quadPosition.x * scaledAxis1 + quadPosition.y * scaledAxis2) * 2.0 / gScreenParams.xy;
output.position = view.clipPosition;
output.position.xy += deltaScreenPosition * view.clipPosition.w;

View File

@@ -115,7 +115,7 @@ float3x3 CalcMatrixFromRotationScale(float4 rotation, float3 scale)
2 * (x * y + w * z), 1 - 2 * (x * x + z * z), 2 * (y * z - w * x),
2 * (x * z - w * y), 2 * (y * z + w * x), 1 - 2 * (x * x + y * y));
return mul(rotationMatrix, scaleMatrix);
return mul(transpose(rotationMatrix), scaleMatrix);
}
void CalcCovariance3D(float3x3 rotationScaleMatrix, out float3 sigma0, out float3 sigma1)
@@ -129,9 +129,8 @@ float3 CalcCovariance2D(float3 worldPosition, float3 covariance0, float3 covaria
{
float3 viewPosition = mul(float4(worldPosition, 1.0), gView).xyz;
float aspect = gProjection._m00 / gProjection._m11;
float tanFovX = rcp(gProjection._m00);
float tanFovY = rcp(gProjection._m11 * aspect);
float tanFovY = rcp(gProjection._m11);
float clampX = 1.3 * tanFovX;
float clampY = 1.3 * tanFovY;
viewPosition.x = clamp(viewPosition.x / viewPosition.z, -clampX, clampX) * viewPosition.z;
@@ -253,9 +252,6 @@ void MainCS(uint3 dispatchThreadId : SV_DispatchThreadID)
float3 covariance0;
float3 covariance1;
CalcCovariance3D(rotationScale, covariance0, covariance1);
float splatScaleSquared = gSettings.w * gSettings.w;
covariance0 *= splatScaleSquared;
covariance1 *= splatScaleSquared;
float3 covariance2D = CalcCovariance2D(position, covariance0, covariance1);
DecomposeCovariance(covariance2D, view.axis1, view.axis2);

View File

@@ -134,7 +134,7 @@ void StoreMatrixTransposed(const DirectX::XMMATRIX& matrix, float* destination)
DirectX::XMMATRIX BuildSortViewMatrix() {
using namespace DirectX;
const XMVECTOR eye = XMVectorSet(0.0f, 0.5f, 1.0f, 1.0f);
const XMVECTOR target = XMVectorSet(0.0f, 0.5f, -5.0f, 1.0f);
const XMVECTOR target = XMVectorSet(3.0f, 0.5f, 6.196152f, 1.0f);
const XMVECTOR up = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f);
return XMMatrixLookAtRH(eye, target, up);
}
@@ -1140,118 +1140,6 @@ bool App::InitializeDebugDrawResources() {
return true;
}
bool App::InitializeCompositeResources() {
D3D12_RESOURCE_DESC splatRenderTargetDesc = {};
splatRenderTargetDesc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
splatRenderTargetDesc.Alignment = 0;
splatRenderTargetDesc.Width = static_cast<UINT64>(m_width);
splatRenderTargetDesc.Height = static_cast<UINT>(m_height);
splatRenderTargetDesc.DepthOrArraySize = 1;
splatRenderTargetDesc.MipLevels = 1;
splatRenderTargetDesc.Format = DXGI_FORMAT_R16G16B16A16_FLOAT;
splatRenderTargetDesc.SampleDesc.Count = 1;
splatRenderTargetDesc.SampleDesc.Quality = 0;
splatRenderTargetDesc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
splatRenderTargetDesc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
if (!m_splatRenderTargetTexture.Initialize(
m_device.GetDevice(),
splatRenderTargetDesc,
D3D12_RESOURCE_STATE_RENDER_TARGET)) {
m_lastErrorMessage = L"Failed to create the splat accumulation render target texture.";
return false;
}
m_splatRenderTargetTexture.SetState(ResourceStates::RenderTarget);
ResourceViewDesc renderTargetViewDesc = {};
renderTargetViewDesc.dimension = ResourceViewDimension::Texture2D;
renderTargetViewDesc.format = static_cast<uint32_t>(Format::R16G16B16A16_Float);
m_splatRenderTargetRtv.reset(static_cast<D3D12ResourceView*>(
m_device.CreateRenderTargetView(&m_splatRenderTargetTexture, renderTargetViewDesc)));
if (!m_splatRenderTargetRtv) {
m_lastErrorMessage = L"Failed to create the splat accumulation render target view.";
return false;
}
m_splatRenderTargetSrv.reset(static_cast<D3D12ResourceView*>(
m_device.CreateShaderResourceView(&m_splatRenderTargetTexture, renderTargetViewDesc)));
if (!m_splatRenderTargetSrv) {
m_lastErrorMessage = L"Failed to create the splat accumulation shader resource view.";
return false;
}
DescriptorSetLayoutBinding bindings[1] = {};
bindings[0].binding = 0;
bindings[0].type = static_cast<uint32_t>(DescriptorType::SRV);
bindings[0].count = 1;
bindings[0].visibility = static_cast<uint32_t>(ShaderVisibility::Pixel);
bindings[0].resourceDimension = ResourceViewDimension::Texture2D;
DescriptorSetLayoutDesc setLayout = {};
setLayout.bindings = bindings;
setLayout.bindingCount = 1;
RHIPipelineLayoutDesc pipelineLayoutDesc = {};
pipelineLayoutDesc.setLayouts = &setLayout;
pipelineLayoutDesc.setLayoutCount = 1;
m_compositePipelineLayout = m_device.CreatePipelineLayout(pipelineLayoutDesc);
if (m_compositePipelineLayout == nullptr) {
m_lastErrorMessage = L"Failed to create the composite pipeline layout.";
return false;
}
DescriptorPoolDesc poolDesc = {};
poolDesc.type = DescriptorHeapType::CBV_SRV_UAV;
poolDesc.descriptorCount = 1;
poolDesc.shaderVisible = true;
m_compositeDescriptorPool = m_device.CreateDescriptorPool(poolDesc);
if (m_compositeDescriptorPool == nullptr) {
m_lastErrorMessage = L"Failed to create the composite descriptor pool.";
return false;
}
m_compositeDescriptorSet = m_compositeDescriptorPool->AllocateSet(setLayout);
if (m_compositeDescriptorSet == nullptr) {
m_lastErrorMessage = L"Failed to allocate the composite descriptor set.";
return false;
}
m_compositeDescriptorSet->Update(0, m_splatRenderTargetSrv.get());
GraphicsPipelineDesc pipelineDesc = {};
pipelineDesc.pipelineLayout = m_compositePipelineLayout;
pipelineDesc.topologyType = static_cast<uint32_t>(PrimitiveTopologyType::Triangle);
pipelineDesc.renderTargetCount = 1;
pipelineDesc.renderTargetFormats[0] = static_cast<uint32_t>(Format::R8G8B8A8_UNorm);
pipelineDesc.depthStencilFormat = static_cast<uint32_t>(Format::Unknown);
pipelineDesc.sampleCount = 1;
pipelineDesc.sampleQuality = 0;
pipelineDesc.rasterizerState.cullMode = static_cast<uint32_t>(CullMode::None);
pipelineDesc.depthStencilState.depthTestEnable = false;
pipelineDesc.depthStencilState.depthWriteEnable = false;
pipelineDesc.blendState.blendEnable = true;
pipelineDesc.blendState.srcBlend = static_cast<uint32_t>(BlendFactor::SrcAlpha);
pipelineDesc.blendState.dstBlend = static_cast<uint32_t>(BlendFactor::InvSrcAlpha);
pipelineDesc.blendState.srcBlendAlpha = static_cast<uint32_t>(BlendFactor::One);
pipelineDesc.blendState.dstBlendAlpha = static_cast<uint32_t>(BlendFactor::InvSrcAlpha);
pipelineDesc.vertexShader.fileName = ResolveShaderPath(L"CompositeVS.hlsl").wstring();
pipelineDesc.vertexShader.entryPoint = L"MainVS";
pipelineDesc.vertexShader.profile = L"vs_5_0";
pipelineDesc.fragmentShader.fileName = ResolveShaderPath(L"CompositePS.hlsl").wstring();
pipelineDesc.fragmentShader.entryPoint = L"MainPS";
pipelineDesc.fragmentShader.profile = L"ps_5_0";
m_compositePipelineState = m_device.CreatePipelineState(pipelineDesc);
if (m_compositePipelineState == nullptr) {
m_lastErrorMessage = L"Failed to create the composite pipeline state.";
return false;
}
return true;
}
void App::ShutdownGaussianGpuResources() {
m_gaussianColorView.reset();
m_gaussianShView.reset();
@@ -1368,20 +1256,6 @@ void App::ShutdownDebugDrawResources() {
ShutdownAndDelete(m_debugPipelineLayout);
}
void App::ShutdownCompositeResources() {
if (m_compositeDescriptorSet != nullptr) {
m_compositeDescriptorSet->Shutdown();
delete m_compositeDescriptorSet;
m_compositeDescriptorSet = nullptr;
}
ShutdownAndDelete(m_compositeDescriptorPool);
ShutdownAndDelete(m_compositePipelineState);
ShutdownAndDelete(m_compositePipelineLayout);
m_splatRenderTargetSrv.reset();
m_splatRenderTargetRtv.reset();
m_splatRenderTargetTexture.Shutdown();
}
void App::Shutdown() {
AppendTrace("Shutdown: begin");
if (!m_isInitialized && m_hwnd == nullptr) {
@@ -1796,8 +1670,8 @@ void App::RenderFrame(bool captureScreenshot) {
const int currentBackBufferIndex = m_swapChain.GetCurrentBackBufferIndex();
D3D12Texture& backBuffer = m_swapChain.GetBackBuffer(currentBackBufferIndex);
m_commandList.TransitionBarrier(backBuffer.GetResource(), ResourceStates::Present, ResourceStates::RenderTarget);
backBuffer.SetState(ResourceStates::RenderTarget);
const CPUDescriptorHandle rtvCpuHandle = m_rtvHeap.GetCPUDescriptorHandle(currentBackBufferIndex);
const CPUDescriptorHandle dsvCpuHandle = m_dsvHeap.GetCPUDescriptorHandle(0);
@@ -2160,14 +2034,12 @@ void App::RenderFrame(bool captureScreenshot) {
m_commandAllocator.Reset();
m_commandList.Reset();
m_commandList.TransitionBarrier(backBuffer.GetResource(), ResourceStates::RenderTarget, ResourceStates::Present);
backBuffer.SetState(ResourceStates::Present);
m_commandList.Close();
void* presentCommandLists[] = { &m_commandList };
AppendTrace("RenderFrame: execute final present-transition list");
m_commandQueue.ExecuteCommandLists(1, presentCommandLists);
} else {
m_commandList.TransitionBarrier(backBuffer.GetResource(), ResourceStates::RenderTarget, ResourceStates::Present);
backBuffer.SetState(ResourceStates::Present);
m_commandList.Close();
void* commandLists[] = { &m_commandList };
AppendTrace("RenderFrame: execute+present");

72
MVS/NahidaRender/.gitignore vendored Normal file
View File

@@ -0,0 +1,72 @@
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/
# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/
# Recordings can get excessive in size
/[Rr]ecordings/
# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*
# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*
# Visual Studio cache directory
.vs/
# Gradle cache directory
.gradle/
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db
# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta
# Unity3D generated file on crash reports
sysinfo.txt
# Builds
*.apk
*.aab
*.unitypackage
*.app
# Crashlytics generated file
crashlytics-build.properties
# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*

View File

@@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 68bbc4cba3b6dbb4b86a7c53808f8638
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8979e00a9c434454885c4bf6711f1589
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9302fe3896889a84782905c6238755b4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 395a4648ad8e29949875f724cef51c19
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,109 @@
fileFormatVersion: 2
guid: 6eb560da14e928447b90b7dcd5c26c80
ModelImporter:
serializedVersion: 22200
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ebd426cddc3f2bb45a717a91e44a04a8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

View File

@@ -0,0 +1,140 @@
fileFormatVersion: 2
guid: 3ea5c91be5b2cbf41af5e76906541a28
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

@@ -0,0 +1,140 @@
fileFormatVersion: 2
guid: e093901fe428bd143b564aa1c3332d7d
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@@ -0,0 +1,140 @@
fileFormatVersion: 2
guid: 364af43ac586d65439fa133e843e2832
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@@ -0,0 +1,140 @@
fileFormatVersion: 2
guid: 5d192aff5bc6121438505d1f9989df41
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,129 @@
fileFormatVersion: 2
guid: d3fd0a1dc342d4b4fab8ef4b8d009052
ModelImporter:
serializedVersion: 22200
internalIDToNameTable: []
externalObjects:
- first:
type: UnityEngine:Texture2D
assembly: UnityEngine.CoreModule
name: Ellen_Body_Map1_D
second: {fileID: 2800000, guid: 3532f977100283548867748b15658232, type: 3}
- first:
type: UnityEngine:Texture2D
assembly: UnityEngine.CoreModule
name: Ellen_Body_Map2_D
second: {fileID: 2800000, guid: e382c6705a3468e4ca57a8d16897ab19, type: 3}
- first:
type: UnityEngine:Texture2D
assembly: UnityEngine.CoreModule
name: Ellen_Face_D
second: {fileID: 2800000, guid: 7c3ba8d23a564894984da6d374ca3731, type: 3}
- first:
type: UnityEngine:Texture2D
assembly: UnityEngine.CoreModule
name: Ellen_Weapon_D
second: {fileID: 2800000, guid: 6881926d8786b304a8bf06ae1afa9bef, type: 3}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 3
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 1
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 3
humanoidOversampling: 1
avatarSetup: 1
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,96 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1107 &-1397466275883854417
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 5128555461953376154}
m_Position: {x: 308, y: 155.20001, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 5128555461953376154}
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Ellen
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: -1397466275883854417}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1101 &792017938168458971
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 5128555461953376154}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.93775934
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &5128555461953376154
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Take 001
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 792017938168458971}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 1827226128182048838, guid: d3fd0a1dc342d4b4fab8ef4b8d009052,
type: 3}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1033ab15ae22d2244849dc2d4303382f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0c1a2b98a2475f14788ef684b83f22fb
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Ellen_Body_Map1_D
m_Shader: {fileID: -6465566751694194690, guid: 44245ab89240f51459a5077d7145c452,
type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords:
- _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BASE_COLOR_MAP:
m_Texture: {fileID: 2800000, guid: 3ea5c91be5b2cbf41af5e76906541a28, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BUMP_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EMISSION_COLOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _METALNESS_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _REFLECTIONS_COLOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _REFLECTIONS_IOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _REFLECTIONS_ROUGHNESS_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TRANSPARENCY_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _BASE_COLOR_WEIGHT: 1
- _BUMP_MAP_STRENGTH: 0.3
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EMISSION_WEIGHT: 1
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _METALNESS: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueControl: 0
- _QueueOffset: 0
- _REFLECTIONS_IOR: 1.52
- _REFLECTIONS_ROUGHNESS: 0
- _REFLECTIONS_WEIGHT: 1
- _ReceiveShadows: 1
- _Smoothness: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _TRANSPARENCY: 0
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BASE_COLOR: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EMISSION_COLOR: {r: 0, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _REFLECTIONS_COLOR: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &5074316965000976425
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8fb8894d655641346b205dc67b07366a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-6965004337211005254
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Ellen_Body_Map2_D
m_Shader: {fileID: -6465566751694194690, guid: 44245ab89240f51459a5077d7145c452,
type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords:
- _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BASE_COLOR_MAP:
m_Texture: {fileID: 2800000, guid: e093901fe428bd143b564aa1c3332d7d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BUMP_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EMISSION_COLOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _METALNESS_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _REFLECTIONS_COLOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _REFLECTIONS_IOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _REFLECTIONS_ROUGHNESS_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TRANSPARENCY_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _BASE_COLOR_WEIGHT: 1
- _BUMP_MAP_STRENGTH: 0.3
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EMISSION_WEIGHT: 1
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _METALNESS: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueControl: 0
- _QueueOffset: 0
- _REFLECTIONS_IOR: 1.52
- _REFLECTIONS_ROUGHNESS: 0
- _REFLECTIONS_WEIGHT: 1
- _ReceiveShadows: 1
- _Smoothness: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _TRANSPARENCY: 0
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BASE_COLOR: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EMISSION_COLOR: {r: 0, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _REFLECTIONS_COLOR: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d58ddc93721772c43a133b364f387d12
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-7105605433481396130
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Ellen_Face_D
m_Shader: {fileID: -6465566751694194690, guid: 44245ab89240f51459a5077d7145c452,
type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords:
- _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BASE_COLOR_MAP:
m_Texture: {fileID: 2800000, guid: 364af43ac586d65439fa133e843e2832, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BUMP_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EMISSION_COLOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _METALNESS_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _REFLECTIONS_COLOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _REFLECTIONS_IOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _REFLECTIONS_ROUGHNESS_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TRANSPARENCY_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _BASE_COLOR_WEIGHT: 1
- _BUMP_MAP_STRENGTH: 0.3
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EMISSION_WEIGHT: 1
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _METALNESS: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueControl: 0
- _QueueOffset: 0
- _REFLECTIONS_IOR: 1.52
- _REFLECTIONS_ROUGHNESS: 0
- _REFLECTIONS_WEIGHT: 1
- _ReceiveShadows: 1
- _Smoothness: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _TRANSPARENCY: 0
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BASE_COLOR: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EMISSION_COLOR: {r: 0, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _REFLECTIONS_COLOR: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0aeabd15ad371ad4484e3399a9de63b2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,136 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-193573160482100292
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Ellen_Weapon_D
m_Shader: {fileID: -6465566751694194690, guid: 44245ab89240f51459a5077d7145c452,
type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords:
- _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BASE_COLOR_MAP:
m_Texture: {fileID: 2800000, guid: 5d192aff5bc6121438505d1f9989df41, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BUMP_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EMISSION_COLOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _METALNESS_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _REFLECTIONS_COLOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _REFLECTIONS_IOR_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _REFLECTIONS_ROUGHNESS_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TRANSPARENCY_MAP:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _BASE_COLOR_WEIGHT: 1
- _BUMP_MAP_STRENGTH: 0.3
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EMISSION_WEIGHT: 1
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _METALNESS: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueControl: 0
- _QueueOffset: 0
- _REFLECTIONS_IOR: 1.52
- _REFLECTIONS_ROUGHNESS: 0
- _REFLECTIONS_WEIGHT: 1
- _ReceiveShadows: 1
- _Smoothness: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _TRANSPARENCY: 0
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BASE_COLOR: {r: 1, g: 1, b: 1, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EMISSION_COLOR: {r: 0, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _REFLECTIONS_COLOR: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2f23de5ccc06a124195001de1ffc4c2c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,187 @@
Shader "Genshin"
{
Properties
{
[Header(General)]
[MainTexture]_BaseMap("Base Map", 2D) = "white" {}
[MainColor] _BaseColor("Base Color", Color) = (1,1,1,1)
[ToggleUI] _IsDay("Is Day", Float) = 1
[Toggle(_DOUBLE_SIDED)] _DoubleSided("Double Sided", Float) = 0
[Enum(UnityEngine.Rendering.CullMode)] _Cull("Cull", Float) = 2
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("Src Blend", Float) = 1
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("Dst Blend", Float) = 0
[Header(Shadow)]
_LightMap("Light Map", 2D) = "white" {}
_LightDirectionMultiplier("Light Direction Multiplier", Vector) = (1,1,1,0)
_ShadowOffset("Shadow Offset", Float) = 0
_ShadowSmoothness("Shadow Smoothness", Float) = 0
[HDR] _ShadowColor("Shadow Color", Color) = (1,1,1,1)
_ShadowRamp("Shadow Ramp", 2D) = "white" {}
[ToggleUI] _UseCustomMaterialType("Use Custom Material Type", Float) = 0
_CustomMaterialType("Custom Material Type", Float) = 1
[Header(Emission)]
[Toggle(_EMISSION)] _UseEmission("Use Emission", Float) = 0
_EmissionIntensity("Emission Intensity", Float) = 1
[Header(Normal)]
[Toggle(_NORMAL_MAP)] _UseNormalMap("Use Normal Map", Float) = 0
[Normal] _NormalMap("Normal Map", 2D) = "bump" {}
[Header(Face)]
[Toggle(_IS_FACE)] _IsFace("Is Face", Float) = 0
_FaceDirection("Face Direction", Vector) = (0,0,1,0)
_FaceShadowOffset("Face Shadow Offset", Float) = 0
_FaceBlushColor("Face Blush Color", Color) = (1,1,1,1)
_FaceBlushStrength("Face Blush Strength", Float) = 1
_FaceLightMap("Face Light Map", 2D) = "white" {}
_FaceShadow("Face Shadow", 2D) = "white" {}
[Header(Specular)]
[Toggle(_SPECULAR)] _UseSpecular("Use Specular", Float) = 0
_SpecularSmoothness("Specular Smoothness", Float) = 1
_NonmetallicIntensity("Nonmetallic Intensity", Float) = 1
_MetallicIntensity("Metallic Intensity", Float) = 1
_MetalMap("Metal Map", 2D) = "white" {}
[Header(Rim Light)]
[Toggle(_RIM)] _UseRim("Use Rim", Float) = 0
_RimOffset("Rim Offset", Float) = 1
_RimThreshold("Rim Threshold", Float) = 1
_RimIntensity("Rim Intensity", Float) = 1
[Header(Outline)]
[ToggleUI] _UseSmoothNormal("Use Smooth Normal", Float) = 0
_OutlineWidth("Outline Width", Float) = 1
_OutlineWidthParams("Outline Width Params", Vector) = (0,1,0,1)
_OutlineZOffset("Outline Z Offset", Float) = 0
_ScreenOffset("Screen Offset", Vector) = (0,0,0,0)
_OutlineColor("Outline Color", Color) = (0,0,0,1)
_OutlineColor2("Outline Color 2", Color) = (0,0,0,1)
_OutlineColor3("Outline Color 3", Color) = (0,0,0,1)
_OutlineColor4("Outline Color 4", Color) = (0,0,0,1)
_OutlineColor5("Outline Color 5", Color) = (0,0,0,1)
}
Subshader
{
Tags
{
"RenderType" = "Opaque"
"RenderPipeline" = "UniversalPipeline"
"UniversalMaterialType" = "Lit"
"IgnoreProjector" = "True"
}
Pass
{
Name "Forward"
Tags {"LightMode" = "UniversalForward"}
Cull[_Cull]
ZWrite On
Blend[_SrcBlend][_DstBlend]
HLSLPROGRAM
// Universal Pipeline keywords
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
#pragma multi_compile_fragment _ _SHADOWS_SOFT
#pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
#pragma multi_compile_fragment _ _LIGHT_LAYERS
#pragma multi_compile_fragment _ _LIGHT_COOKIES
#pragma multi_compile _ _FORWARD_PLUS
#pragma multi_compile_fragment _ _WRITE_RENDERING_LAYERS
// Unity defined keywords
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
#pragma multi_compile _ SHADOWS_SHADOWMASK
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
#pragma multi_compile_fragment _ LOD_FADE_CROSSFADE
#pragma multi_compile_fog
#pragma multi_compile_fragment _ DEBUG_DISPLAY
#pragma shader_feature_local_fragment _DOUBLE_SIDED
#pragma shader_feature_local_fragment _EMISSION
#pragma shader_feature_local_fragment _NORMAL_MAP
#pragma shader_feature_local_fragment _IS_FACE
#pragma shader_feature_local_fragment _SPECULAR
#pragma shader_feature_local_fragment _RIM
#pragma vertex ForwardPassVertex
#pragma fragment ForwardPassFragment
#include "GenshinInput.hlsl"
#include "GenshinForwardPass.hlsl"
ENDHLSL
}
Pass
{
Name "ShadowCaster"
Tags{"LightMode" = "ShadowCaster"}
ZWrite On
ZTest LEqual
ColorMask 0
Cull[_Cull]
HLSLPROGRAM
#pragma vertex ShadowPassVertex
#pragma fragment ShadowPassFragment
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/ShadowCasterPass.hlsl"
ENDHLSL
}
Pass
{
Name "DepthOnly"
Tags{"LightMode" = "DepthOnly"}
ZWrite On
ColorMask R
Cull[_Cull]
HLSLPROGRAM
#pragma vertex DepthOnlyVertex
#pragma fragment DepthOnlyFragment
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/DepthOnlyPass.hlsl"
ENDHLSL
}
Pass
{
Name "Outline"
Tags {"LightMode" = "SRPDefaultUnlit"}
Cull Front
HLSLPROGRAM
#pragma vertex OutlinePassVertex
#pragma fragment OutlinePassFragment
#include "GenshinInput.hlsl"
#include "GenshinOutlinePass.hlsl"
ENDHLSL
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 43a94ff316d044749abc5a8bce3d6902
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,183 @@
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
struct Attributes
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 tangentOS : TANGENT;
float4 color : COLOR;
float2 uv : TEXCOORD0;
float2 backUV : TEXCOORD1;
};
struct Varyings
{
float2 uv : TEXCOORD0;
float2 backUV : TEXCOORD1;
float3 positionWS : TEXCOORD2;
half3 tangentWS : TEXCOORD3;
half3 bitangentWS : TEXCOORD4;
half3 normalWS : TEXCOORD5;
float4 positionNDC : TEXCOORD6;
half4 color : COLOR;
float4 positionCS : SV_POSITION;
};
half GetShadow(Varyings input, half3 lightDirection, half aoFactor)
{
half NDotL = dot(input.normalWS, lightDirection);
half halfLambert = 0.5 * NDotL + 0.5;
half shadow = saturate(2.0 * halfLambert * aoFactor);
return lerp(shadow, 1.0, step(0.9, aoFactor));
}
half GetFaceShadow(Varyings input, half3 lightDirection)
{
half3 F = SafeNormalize(half3(_FaceDirection.x, 0.0, _FaceDirection.z));
half3 L = SafeNormalize(half3(lightDirection.x, 0.0, lightDirection.z));
half FDotL = dot(F, L);
half FCrossL = cross(F, L).y;
half2 shadowUV = input.uv;
shadowUV.x = lerp(shadowUV.x, 1.0 - shadowUV.x, step(0.0, FCrossL));
half faceShadowMap = SAMPLE_TEXTURE2D(_FaceLightMap, sampler_FaceLightMap, shadowUV).r;
half faceShadow = step(-0.5 * FDotL + 0.5 + _FaceShadowOffset, faceShadowMap);
half faceMask = SAMPLE_TEXTURE2D(_FaceShadow, sampler_FaceShadow, input.uv).a;
half maskedFaceShadow = lerp(faceShadow, 1.0, faceMask);
return maskedFaceShadow;
}
half3 GetShadowColor(half shadow, half material, half day)
{
int index = 4;
index = lerp(index, 1, step(0.2, material));
index = lerp(index, 2, step(0.4, material));
index = lerp(index, 0, step(0.6, material));
index = lerp(index, 3, step(0.8, material));
half rangeMin = 0.5 + _ShadowOffset - _ShadowSmoothness;
half rangeMax = 0.5 + _ShadowOffset;
half2 rampUV = half2(smoothstep(rangeMin, rangeMax, shadow), index / 10.0 + 0.5 * day + 0.05);
half3 shadowRamp = SAMPLE_TEXTURE2D(_ShadowRamp, sampler_ShadowRamp, rampUV);
half3 shadowColor = shadowRamp * lerp(_ShadowColor, 1.0, smoothstep(0.9, 1.0, rampUV.x));
shadowColor = lerp(shadowColor, 1.0, step(rangeMax, shadow));
return shadowColor;
}
half3 GetSpecular(Varyings input, half3 lightDirection, half3 albedo, half3 lightMap)
{
half3 V = GetWorldSpaceNormalizeViewDir(input.positionWS);
half3 H = SafeNormalize(lightDirection + V);
half NDotH = dot(input.normalWS, H);
half blinnPhong = pow(saturate(NDotH), _SpecularSmoothness);
half3 normalVS = TransformWorldToViewNormal(input.normalWS, true);
half2 matcapUV = 0.5 * normalVS.xy + 0.5;
half3 metalMap = SAMPLE_TEXTURE2D(_MetalMap, sampler_MetalMap, matcapUV);
half3 nonMetallic = step(1.1, lightMap.b + blinnPhong) * lightMap.r * _NonmetallicIntensity;
half3 metallic = blinnPhong * lightMap.b * albedo * metalMap * _MetallicIntensity;
half3 specular = lerp(nonMetallic, metallic, step(0.9, lightMap.r));
return specular;
}
half GetRim(Varyings input)
{
half3 normalVS = TransformWorldToViewNormal(input.normalWS, true);
float2 uv = input.positionNDC.xy / input.positionNDC.w;
float2 offset = float2(_RimOffset * normalVS.x / _ScreenParams.x, 0.0);
float depth = LinearEyeDepth(SampleSceneDepth(uv), _ZBufferParams);
float offsetDepth = LinearEyeDepth(SampleSceneDepth(uv + offset), _ZBufferParams);
half rim = smoothstep(0.0, _RimThreshold, offsetDepth - depth) * _RimIntensity;
half3 V = GetWorldSpaceNormalizeViewDir(input.positionWS);
half NDotV = dot(input.normalWS, V);
half fresnel = pow(saturate(1.0 - NDotV), 5.0);
return rim * fresnel;
}
Varyings ForwardPassVertex(Attributes input)
{
VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz);
VertexNormalInputs normalInput = GetVertexNormalInputs(input.normalOS, input.tangentOS);
Varyings output = (Varyings)0;
output.uv = TRANSFORM_TEX(input.uv, _BaseMap);
output.backUV = TRANSFORM_TEX(input.backUV, _BaseMap);
output.positionWS = vertexInput.positionWS;
output.tangentWS = normalInput.tangentWS;
output.bitangentWS = normalInput.bitangentWS;
output.normalWS = normalInput.normalWS;
output.positionNDC = vertexInput.positionNDC;
output.color = input.color;
output.positionCS = vertexInput.positionCS;
output.positionCS.xy += _ScreenOffset.xy * output.positionCS.w;
return output;
}
half4 ForwardPassFragment(Varyings input, FRONT_FACE_TYPE facing : FRONT_FACE_SEMANTIC) : SV_TARGET
{
#if _DOUBLE_SIDED
input.uv = lerp(input.uv, input.backUV, IS_FRONT_VFACE(facing, 0.0, 1.0));
#endif
half4 baseMap = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, input.uv);
half3 albedo = baseMap.rgb * _BaseColor.rgb;
half alpha = baseMap.a;
#if _IS_FACE
albedo = lerp(albedo, _FaceBlushColor.rgb, _FaceBlushStrength * alpha);
#endif
#if _NORMAL_MAP
half3x3 tangentToWorld = half3x3(input.tangentWS, input.bitangentWS, input.normalWS);
half4 normalMap = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, input.uv);
half3 normalTS = UnpackNormal(normalMap);
half3 normalWS = TransformTangentToWorld(normalTS, tangentToWorld, true);
input.normalWS = normalWS;
#endif
Light mainLight = GetMainLight();
half3 lightDirection = SafeNormalize(mainLight.direction * _LightDirectionMultiplier);
half4 lightMap = SAMPLE_TEXTURE2D(_LightMap, sampler_LightMap, input.uv);
half material = lerp(lightMap.a, _CustomMaterialType, _UseCustomMaterialType);
#if _IS_FACE
half shadow = GetFaceShadow(input, lightDirection);
#else
half aoFactor = lightMap.g * input.color.r;
half shadow = GetShadow(input, lightDirection, aoFactor);
#endif
half3 shadowColor = GetShadowColor(shadow, material, _IsDay);
half3 specular = 0.0;
#if _SPECULAR
specular = GetSpecular(input, lightDirection, albedo, lightMap.rgb);
#endif
half3 emission = 0.0;
#if _EMISSION
emission = albedo * _EmissionIntensity * alpha;
#endif
half3 rim = 0.0;
#if _RIM
rim = albedo * GetRim(input);
#endif
half3 finalColor = albedo * shadowColor + specular + emission + rim;
half finalAlpha = 1.0;
return half4(finalColor, finalAlpha);
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2aea4fee83e5bb145874b2f3bd9bbbbe
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,51 @@
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
CBUFFER_START(UnityPerMaterial)
float4 _BaseMap_ST;
half4 _BaseColor;
half _IsDay;
half _Cull;
half _SrcBlend;
half _DstBlend;
half4 _LightDirectionMultiplier;
half _ShadowOffset;
half _ShadowSmoothness;
half4 _ShadowColor;
half _UseCustomMaterialType;
half _CustomMaterialType;
half _EmissionIntensity;
half4 _FaceDirection;
half _FaceShadowOffset;
half4 _FaceBlushColor;
half _FaceBlushStrength;
half _SpecularSmoothness;
half _NonmetallicIntensity;
half _MetallicIntensity;
half _RimOffset;
half _RimThreshold;
half _RimIntensity;
half _UseSmoothNormal;
half _OutlineWidth;
half4 _OutlineWidthParams;
half _OutlineZOffset;
half4 _ScreenOffset;
half4 _OutlineColor;
half4 _OutlineColor2;
half4 _OutlineColor3;
half4 _OutlineColor4;
half4 _OutlineColor5;
CBUFFER_END
TEXTURE2D(_BaseMap); SAMPLER(sampler_BaseMap);
TEXTURE2D(_LightMap); SAMPLER(sampler_LightMap);
TEXTURE2D(_ShadowRamp); SAMPLER(sampler_ShadowRamp);
TEXTURE2D(_NormalMap); SAMPLER(sampler_NormalMap);
TEXTURE2D(_FaceLightMap); SAMPLER(sampler_FaceLightMap);
TEXTURE2D(_FaceShadow); SAMPLER(sampler_FaceShadow);
TEXTURE2D(_MetalMap); SAMPLER(sampler_MetalMap);

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7cc59e5485498594da26921b972bff29
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,81 @@
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
struct Attributes
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 tangentOS : TANGENT;
float4 color : COLOR;
float2 uv : TEXCOORD0;
float3 smoothNormal : TEXCOORD7;
};
struct Varyings
{
float2 uv : TEXCOORD0;
float4 positionCS : SV_POSITION;
};
float GetOutlineWidth(float positionVS_Z)
{
float fovFactor = 2.414 / UNITY_MATRIX_P[1].y;
float z = abs(positionVS_Z * fovFactor);
float4 params = _OutlineWidthParams;
float k = saturate((z - params.x) / (params.y - params.x));
float width = lerp(params.z, params.w, k);
return 0.01 * _OutlineWidth * width;
}
float4 GetOutlinePosition(VertexPositionInputs vertexInput, VertexNormalInputs normalInput, half4 vertexColor)
{
float z = vertexInput.positionVS.z;
float width = GetOutlineWidth(z) * vertexColor.a;
half3 normalVS = TransformWorldToViewNormal(normalInput.normalWS);
normalVS = SafeNormalize(half3(normalVS.xy, 0.0));
float3 positionVS = vertexInput.positionVS;
positionVS += 0.01 * _OutlineZOffset * SafeNormalize(positionVS);
positionVS += width * normalVS;
float4 positionCS = TransformWViewToHClip(positionVS);
positionCS.xy += _ScreenOffset.zw * positionCS.w;
return positionCS;
}
Varyings OutlinePassVertex(Attributes input)
{
VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz);
VertexNormalInputs normalInput = GetVertexNormalInputs(input.normalOS, input.tangentOS);
half3x3 tangentToWorld = half3x3(normalInput.tangentWS, normalInput.bitangentWS, normalInput.normalWS);
half3 normalTS = 2.0 * (input.smoothNormal - 0.5);
half3 normalWS = TransformTangentToWorld(normalTS, tangentToWorld, true);
normalInput.normalWS = lerp(normalInput.normalWS, normalWS, _UseSmoothNormal);
float4 positionCS = GetOutlinePosition(vertexInput, normalInput, input.color);
Varyings output = (Varyings)0;
output.uv = TRANSFORM_TEX(input.uv, _BaseMap);
output.positionCS = positionCS;
return output;
}
half4 OutlinePassFragment(Varyings input) : SV_TARGET
{
half4 lightMap = SAMPLE_TEXTURE2D(_LightMap, sampler_LightMap, input.uv);
half material = lightMap.a;
half4 color = _OutlineColor5;
color = lerp(color, _OutlineColor4, step(0.2, material));
color = lerp(color, _OutlineColor3, step(0.4, material));
color = lerp(color, _OutlineColor2, step(0.6, material));
color = lerp(color, _OutlineColor, step(0.8, material));
return color;
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 813f7698d2376604ca6a0be4a32948e8
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,190 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-3290751858395990286
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Nahida_Base
m_Shader: {fileID: 4800000, guid: 43a94ff316d044749abc5a8bce3d6902, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FaceLightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FaceShadow:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetalMap:
m_Texture: {fileID: 2800000, guid: d7d1337cec6422b4f9db7325b520d61f, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ShadowRamp:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _CustomMaterialType: 1
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DoubleSided: 0
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EmissionIntensity: 0.2
- _EnvironmentReflections: 1
- _FaceBlushStrength: 0
- _FaceShadowOffset: 0
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _IsDay: 1
- _IsFace: 0
- _Metallic: 0
- _MetallicIntensity: 8
- _NonmetallicIntensity: 0.3
- _OcclusionStrength: 1
- _OutlineWidth: 1.6
- _OutlineZOffset: 0.1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _RimIntensity: 0.5
- _RimOffset: 5
- _RimThreshold: 0.5
- _ShadowOffset: 0.1
- _ShadowSmoothness: 0.4
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SpecularSmoothness: 5
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _UseCustomMaterialType: 0
- _UseEmission: 0
- _UseNormalMap: 0
- _UseRim: 0
- _UseSmoothNormal: 0
- _UseSpecular: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _FaceBlushColor: {r: 1, g: 0.72156864, b: 0.69803923, a: 1}
- _FaceDirection: {r: 0, g: 0, b: 1, a: 0}
- _LightDirectionMultiplier: {r: 1, g: 0.5, b: 1, a: 0}
- _OutlineColor: {r: 0.5176471, g: 0.35686275, b: 0.34117648, a: 1}
- _OutlineColor2: {r: 0.3529412, g: 0.3529412, b: 0.3529412, a: 1}
- _OutlineColor3: {r: 0.47058824, g: 0.47058824, b: 0.5647059, a: 1}
- _OutlineColor4: {r: 0.5176471, g: 0.35686275, b: 0.34117648, a: 1}
- _OutlineColor5: {r: 0.35, g: 0.35, b: 0.35, a: 1}
- _OutlineWidthParams: {r: 0, g: 6, b: 0.1, a: 0.6}
- _ScreenOffset: {r: 0, g: 0, b: 0, a: 0}
- _ShadowColor: {r: 1.1, g: 1.1, b: 1.1, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 30ad25ccfe2f70b4e8544dc4c3a455fa
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,70 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-3290751858395990286
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Nahida_Body
m_Shader: {fileID: 4800000, guid: 43a94ff316d044749abc5a8bce3d6902, type: 3}
m_Parent: {fileID: 2100000, guid: 30ad25ccfe2f70b4e8544dc4c3a455fa, type: 2}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
- _NORMAL_MAP
- _RIM
- _SPECULAR
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 57a770f4365fbb14c84e40cfa596739c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LightMap:
m_Texture: {fileID: 2800000, guid: 16957b0cd55aa5543a2de2ec31fb4c85, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: bf09bf6ec9e03bf40a0ec73e7a3f4c5b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ShadowRamp:
m_Texture: {fileID: 2800000, guid: 1b40895a669bdab449fecf3c904f1a40, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _DoubleSided: 0
- _IsDay: 1
- _OutlineWidth: 1.6
- _UseEmission: 1
- _UseNormalMap: 1
- _UseRim: 1
- _UseSmoothNormal: 1
- _UseSpecular: 1
m_Colors: []
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d079260ac5e43bf498e2b925db67ca2d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,65 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-3290751858395990286
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Nahida_Brow
m_Shader: {fileID: 4800000, guid: 43a94ff316d044749abc5a8bce3d6902, type: 3}
m_Parent: {fileID: 2100000, guid: 30ad25ccfe2f70b4e8544dc4c3a455fa, type: 2}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _IS_FACE
- _RIM
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: e44c095e8f6db98499384bf085687aa5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FaceLightMap:
m_Texture: {fileID: 2800000, guid: d933369d3fe294a4da5485a61032669e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FaceShadow:
m_Texture: {fileID: 2800000, guid: d4fe3d81f5078b240a29ad0d13d5ebcc, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ShadowRamp:
m_Texture: {fileID: 2800000, guid: 1b40895a669bdab449fecf3c904f1a40, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _IsFace: 1
- _OutlineWidth: 0
- _UseCustomMaterialType: 1
- _UseRim: 1
m_Colors:
- _BaseColor: {r: 0.9764706, g: 0.80103135, b: 0.76164705, a: 1}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bc3ba53397bde5a40bc70af4d711403c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,71 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-3290751858395990286
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Nahida_Dress1
m_Shader: {fileID: 4800000, guid: 43a94ff316d044749abc5a8bce3d6902, type: 3}
m_Parent: {fileID: 2100000, guid: 30ad25ccfe2f70b4e8544dc4c3a455fa, type: 2}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _DOUBLE_SIDED
- _EMISSION
- _NORMAL_MAP
- _RIM
- _SPECULAR
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 57a770f4365fbb14c84e40cfa596739c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LightMap:
m_Texture: {fileID: 2800000, guid: 16957b0cd55aa5543a2de2ec31fb4c85, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: bf09bf6ec9e03bf40a0ec73e7a3f4c5b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ShadowRamp:
m_Texture: {fileID: 2800000, guid: 1b40895a669bdab449fecf3c904f1a40, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Cull: 0
- _DoubleSided: 1
- _OutlineZOffset: 0.5
- _UseEmission: 1
- _UseNormalMap: 1
- _UseRim: 1
- _UseSmoothNormal: 1
- _UseSpecular: 1
m_Colors: []
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1aa7d64a95b4c4a47a42956733646dfb
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,70 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-3290751858395990286
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Nahida_Dress2
m_Shader: {fileID: 4800000, guid: 43a94ff316d044749abc5a8bce3d6902, type: 3}
m_Parent: {fileID: 2100000, guid: 30ad25ccfe2f70b4e8544dc4c3a455fa, type: 2}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _DOUBLE_SIDED
- _EMISSION
- _NORMAL_MAP
- _RIM
- _SPECULAR
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: f771c421ae0f7e84891ad26baa73e626, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LightMap:
m_Texture: {fileID: 2800000, guid: 7c407627b6cc5474d87601dddeddf75b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: b3dd0683c060c8b4d8e23df5776b9d56, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ShadowRamp:
m_Texture: {fileID: 2800000, guid: 59a761e1753da09429a2c063c23def23, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Cull: 0
- _DoubleSided: 1
- _OutlineZOffset: 0.5
- _UseEmission: 1
- _UseNormalMap: 1
- _UseRim: 1
- _UseSpecular: 1
m_Colors: []
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5ec9821a77e85744ea957a936e163194
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,66 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-3290751858395990286
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Nahida_Face
m_Shader: {fileID: 4800000, guid: 43a94ff316d044749abc5a8bce3d6902, type: 3}
m_Parent: {fileID: 2100000, guid: 30ad25ccfe2f70b4e8544dc4c3a455fa, type: 2}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _IS_FACE
- _RIM
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: e44c095e8f6db98499384bf085687aa5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FaceLightMap:
m_Texture: {fileID: 2800000, guid: d933369d3fe294a4da5485a61032669e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FaceShadow:
m_Texture: {fileID: 2800000, guid: d4fe3d81f5078b240a29ad0d13d5ebcc, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ShadowRamp:
m_Texture: {fileID: 2800000, guid: 1b40895a669bdab449fecf3c904f1a40, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _FaceBlushStrength: 0.3
- _IsFace: 1
- _OutlineZOffset: 0.5
- _UseCustomMaterialType: 1
- _UseRim: 1
m_Colors:
- _OutlineWidthParams: {r: 0, g: 6, b: 0.1, a: 0.6}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: aed51a8e6b3fcff48b4a0c036be81a0d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,69 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-3290751858395990286
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Nahida_Hair
m_Shader: {fileID: 4800000, guid: 43a94ff316d044749abc5a8bce3d6902, type: 3}
m_Parent: {fileID: 2100000, guid: 30ad25ccfe2f70b4e8544dc4c3a455fa, type: 2}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _EMISSION
- _NORMAL_MAP
- _RIM
- _SPECULAR
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: f771c421ae0f7e84891ad26baa73e626, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LightMap:
m_Texture: {fileID: 2800000, guid: 7c407627b6cc5474d87601dddeddf75b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 2800000, guid: b3dd0683c060c8b4d8e23df5776b9d56, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ShadowRamp:
m_Texture: {fileID: 2800000, guid: 59a761e1753da09429a2c063c23def23, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _UseEmission: 1
- _UseNormalMap: 1
- _UseRim: 1
- _UseSmoothNormal: 1
- _UseSpecular: 1
m_Colors:
- _OutlineColor: {r: 0.2784314, g: 0.18039216, b: 0.14901961, a: 1}
- _OutlineWidthParams: {r: 0, g: 6, b: 0.1, a: 0.6}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e014b380f94128542b5dfb89a7e6457c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,262 @@
Shader "URPGenshinPostProcess"
{
HLSLINCLUDE
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
#pragma multi_compile_local_fragment _ _BLOOM_COLOR _BLOOM_BRIGHTNESS
#pragma multi_compile_local_fragment _ _TONEMAPPING
float2 _BlitTexture_TexelSize;
half _BloomThreshold;
half _BloomIntensity;
half4 _BloomWeights;
half4 _BloomColor;
half _BlurRadius;
half _Exposure;
half _Contrast;
half _Saturation;
TEXTURE2D(_BloomTextureA);
TEXTURE2D(_BloomTextureB);
TEXTURE2D(_BloomTextureC);
TEXTURE2D(_BloomTextureD);
const static int kernelSize = 9;
const static float kernelOffsets[9] = {
-4.0,
-3.0,
-2.0,
-1.0,
0.0,
1.0,
2.0,
3.0,
4.0,
};
const static float kernel[9] = {
0.01621622,
0.05405405,
0.12162162,
0.19459459,
0.22702703,
0.19459459,
0.12162162,
0.05405405,
0.01621622
};
half4 Prefilter(Varyings input) : SV_TARGET
{
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
half4 color = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv);
#if _BLOOM_BRIGHTNESS
half brightness = max(max(color.r, color.g), color.b);
color.rgb *= saturate(brightness - _BloomThreshold);
#else
color.rgb = max(color.rgb - _BloomThreshold, 0.0);
#endif
return color;
}
half4 GaussianBlur(float2 uv, float2 direction)
{
float2 offset = _BlurRadius * _BlitTexture_TexelSize * direction;
half4 color = 0.0;
UNITY_UNROLL
for (int i = 0; i < kernelSize; i++)
{
float2 sampleUV = uv + kernelOffsets[i] * offset;
color += kernel[i] * SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, sampleUV);
}
return color;
}
half4 HorizontalBlur1x(Varyings input) : SV_TARGET
{
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
return GaussianBlur(uv, float2(1.0, 0.0));
}
half4 HorizontalBlur2x(Varyings input) : SV_TARGET
{
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
return GaussianBlur(uv, float2(2.0, 0.0));
}
half4 VerticalBlur1x(Varyings input) : SV_TARGET
{
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
return GaussianBlur(uv, float2(0.0, 1.0));
}
half4 VerticalBlur2x(Varyings input) : SV_TARGET
{
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
return GaussianBlur(uv, float2(0.0, 2.0));
}
half4 Upsample(Varyings input) : SV_TARGET
{
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
half4 color = 0.0;
half4 weights = _BloomWeights;
color += SAMPLE_TEXTURE2D_X(_BloomTextureA, sampler_LinearClamp, uv) * weights.x;
color += SAMPLE_TEXTURE2D_X(_BloomTextureB, sampler_LinearClamp, uv) * weights.y;
color += SAMPLE_TEXTURE2D_X(_BloomTextureC, sampler_LinearClamp, uv) * weights.z;
color += SAMPLE_TEXTURE2D_X(_BloomTextureD, sampler_LinearClamp, uv) * weights.w;
return color;
}
half3 Tonemap(half3 color)
{
half3 c0 = (1.36 * color + 0.047) * color;
half3 c1 = (0.93 * color + 0.56) * color + 0.14;
return saturate(c0 / c1);
}
half4 ColorGrading(Varyings input) : SV_TARGET
{
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
half4 baseMap = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv);
half3 color = baseMap.rgb;
half alpha = baseMap.a;
#if _BLOOM_COLOR || _BLOOM_BRIGHTNESS
// Bloom
half3 bloom = SAMPLE_TEXTURE2D_X(_BloomTextureA, sampler_LinearClamp, uv).rgb;
bloom *= _BloomIntensity * _BloomColor.rgb;
color += bloom;
#endif
// Exposure
color *= _Exposure;
#if _TONEMAPPING
// Tonemapping
color = Tonemap(color);
#endif
// Contrast
half3 colorLog = LinearToLogC(color);
colorLog = lerp(ACEScc_MIDGRAY, colorLog, _Contrast);
color = LogCToLinear(colorLog);
// Saturation
half luma = dot(color, half3(0.2126, 0.7152, 0.0722));
color = lerp(luma, color, _Saturation);
return float4(color, alpha);
}
ENDHLSL
Subshader
{
Tags { "RenderPipeline" = "UniversalPipeline" }
ZWrite Off ZTest Always Blend Off Cull Off
Pass
{
Name "Blit"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment FragBilinear
ENDHLSL
}
Pass
{
Name "BloomPrefilter"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment Prefilter
ENDHLSL
}
Pass
{
Name "BloomHorizontalBlur1x"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment HorizontalBlur1x
ENDHLSL
}
Pass
{
Name "BloomHorizontalBlur2x"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment HorizontalBlur2x
ENDHLSL
}
Pass
{
Name "BloomVerticalBlur1x"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment VerticalBlur1x
ENDHLSL
}
Pass
{
Name "BloomVerticalBlur2x"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment VerticalBlur2x
ENDHLSL
}
Pass
{
Name "BloomUpsample"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment Upsample
ENDHLSL
}
Pass
{
Name "ColorGrading"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment ColorGrading
ENDHLSL
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b0d6c4974782c8942a7269d3635777ce
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 703981ff6984b434f96bb2a1bea9cddf
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 99c9720ab356a0642a771bea13969a05
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cec25f6e216db8448aae1aeb2acd8257
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,33 @@
using System.Collections.Generic;
using UnityEngine;
namespace Nahida
{
public class MaterialUpdater : MonoBehaviour
{
[SerializeField]
private GameObject m_HeadBone;
[SerializeField]
private Vector3 m_HeadDirection = Vector3.up;
[SerializeField]
private List<SkinnedMeshRenderer> m_FaceRenderers;
private void Update()
{
if (m_FaceRenderers == null || m_HeadBone == null)
{
return;
}
Vector3 direction = m_HeadBone.transform.rotation * m_HeadDirection;
foreach (var renderer in m_FaceRenderers)
{
foreach (var material in renderer.materials)
{
material.SetVector("_FaceDirection", direction);
}
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 711d20640ba9a76428eb565b58d22d72
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: af8894628809a3745b95419580b8e8a0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
namespace Nahida.Rendering
{
public enum BloomMode
{
None,
Color,
Brightness
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: eca541d34b6a4d84d8286343d86edfee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,36 @@
using System;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
namespace Nahida.Rendering
{
[Serializable]
[VolumeComponentMenuForRenderPipeline("Custom/Bloom", typeof(UniversalRenderPipeline))]
public class BloomVolume : VolumeComponent, IPostProcessComponent
{
public VolumeParameter<BloomMode> mode = new VolumeParameter<BloomMode>();
public MinFloatParameter threshold = new MinFloatParameter(0.7f, 0f);
public MinFloatParameter intensity = new MinFloatParameter(1.5f, 0f);
public Vector4Parameter weights = new Vector4Parameter(0.25f * Vector4.one);
public ColorParameter color = new ColorParameter(Color.white);
public MinFloatParameter blurRadius = new MinFloatParameter(2f, 0f);
public ClampedFloatParameter downSampleScale = new ClampedFloatParameter(0.5f, 0.1f, 1f);
public bool IsActive()
{
return mode.value != BloomMode.None;
}
public bool IsTileCompatible()
{
return false;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 76dafa8030f42e648a782b9ab29b6ccb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,29 @@
using System;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
namespace Nahida.Rendering
{
[Serializable]
[VolumeComponentMenuForRenderPipeline("Custom/ColorGrading", typeof(UniversalRenderPipeline))]
public class ColorGradingVolume : VolumeComponent, IPostProcessComponent
{
public BoolParameter useTonemapping = new BoolParameter(false);
public MinFloatParameter exposure = new MinFloatParameter(1f, 0f);
public ClampedFloatParameter contrast = new ClampedFloatParameter(0f, -100f, 100f);
public ClampedFloatParameter saturation = new ClampedFloatParameter(0f, -100f, 100f);
public bool IsActive()
{
return useTonemapping.value || exposure.value != 1f || contrast.value != 0f || saturation.value != 0f;
}
public bool IsTileCompatible()
{
return false;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b065805f0c20d0946afc33f94ae2f89d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,36 @@
using UnityEngine;
using UnityEngine.Rendering.Universal;
namespace Nahida.Rendering
{
public class PostProcessFeature : ScriptableRendererFeature
{
[SerializeField]
private RenderPassEvent m_RenderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing;
[SerializeField]
private Shader m_Shader;
private PostProcessPass _postProcessPass;
public const int BloomIterations = 4;
public override void Create()
{
if (m_Shader == null)
m_Shader = Shader.Find("URPGenshinPostProcess");
_postProcessPass = new PostProcessPass(m_RenderPassEvent, m_Shader, BloomIterations);
}
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
{
renderer.EnqueuePass(_postProcessPass);
}
protected override void Dispose(bool disposing)
{
_postProcessPass?.Dispose();
_postProcessPass = null;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a75e1afdd7c0c4644bf9681fa79463d8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,165 @@
using System;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
namespace Nahida.Rendering
{
public class PostProcessPass : ScriptableRenderPass
{
private Material _material;
private RTHandle[] _bloomBufferA;
private RTHandle[] _bloomBufferB;
private bool _useBloom;
private int _iterations;
private float _downSampleScale;
public PostProcessPass(RenderPassEvent renderPassEvent, Shader shader, int iterations)
{
_material = CoreUtils.CreateEngineMaterial(shader);
_iterations = iterations;
_bloomBufferA = new RTHandle[_iterations];
_bloomBufferB = new RTHandle[_iterations];
base.profilingSampler = new ProfilingSampler(nameof(PostProcessPass));
base.renderPassEvent = renderPassEvent;
}
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
{
var cameraType = renderingData.cameraData.cameraType;
if (cameraType == CameraType.Preview || cameraType == CameraType.Reflection)
{
return;
}
var stack = VolumeManager.instance.stack;
var bloomVolume = stack.GetComponent<BloomVolume>();
var colorGradingVolume = stack.GetComponent<ColorGradingVolume>();
if (!bloomVolume.IsActive() && !colorGradingVolume.IsActive())
{
return;
}
_useBloom = bloomVolume.IsActive();
_downSampleScale = bloomVolume.downSampleScale.value;
SetupBuffer(ref renderingData);
SetupMaterial(bloomVolume, colorGradingVolume, ref renderingData);
var command = CommandBufferPool.Get();
Render(command, ref renderingData);
context.ExecuteCommandBuffer(command);
CommandBufferPool.Release(command);
}
private void SetupBuffer(ref RenderingData renderingData)
{
var cameraDescriptor = renderingData.cameraData.cameraTargetDescriptor;
var descriptor = new RenderTextureDescriptor(cameraDescriptor.width, cameraDescriptor.height, cameraDescriptor.graphicsFormat, 0, 0);
if (_useBloom)
{
descriptor.width = (int)Math.Round(descriptor.width * _downSampleScale);
descriptor.height = (int)Math.Round(descriptor.height * _downSampleScale);
for (int i = 0; i < _iterations; i++)
{
RenderingUtils.ReAllocateIfNeeded(ref _bloomBufferA[i], descriptor, FilterMode.Bilinear, name: $"_BloomBufferA_{i}");
RenderingUtils.ReAllocateIfNeeded(ref _bloomBufferB[i], descriptor, FilterMode.Bilinear, name: $"_BloomBufferB_{i}");
descriptor.width = Math.Max(descriptor.width / 2, 1);
descriptor.height = Math.Max(descriptor.height / 2, 1);
}
}
}
private void SetupMaterial(BloomVolume bloomVolume, ColorGradingVolume colorGradingVolume, ref RenderingData renderingData)
{
float screenFactor = renderingData.cameraData.cameraTargetDescriptor.height / 1080f;
CoreUtils.SetKeyword(_material, "_BLOOM_COLOR", bloomVolume.mode.value == BloomMode.Color);
CoreUtils.SetKeyword(_material, "_BLOOM_BRIGHTNESS", bloomVolume.mode.value == BloomMode.Brightness);
CoreUtils.SetKeyword(_material, "_TONEMAPPING", colorGradingVolume.useTonemapping.value);
_material.SetFloat("_Exposure", colorGradingVolume.exposure.value);
_material.SetFloat("_Contrast", 1f + colorGradingVolume.contrast.value / 100f);
_material.SetFloat("_Saturation", 1f + colorGradingVolume.saturation.value / 100f);
if (_useBloom)
{
_material.SetFloat("_BloomThreshold", bloomVolume.threshold.value);
_material.SetFloat("_BloomIntensity", bloomVolume.intensity.value);
_material.SetVector("_BloomWeights", bloomVolume.weights.value);
_material.SetColor("_BloomColor", bloomVolume.color.value);
_material.SetFloat("_BlurRadius", bloomVolume.blurRadius.value * _downSampleScale * screenFactor);
}
}
private void Render(CommandBuffer commandBuffer, ref RenderingData renderingData)
{
var source = renderingData.cameraData.renderer.cameraColorTargetHandle;
using (new ProfilingScope(commandBuffer, profilingSampler))
{
if (_useBloom)
{
RTHandle[] bufferA = _bloomBufferA, bufferB = _bloomBufferB;
Blit(commandBuffer, source, bufferA[0], Pass.BloomPrefilter);
Blit(commandBuffer, bufferA[0], bufferB[0], Pass.BloomHorizontalBlur1x);
Blit(commandBuffer, bufferB[0], bufferA[0], Pass.BloomVerticalBlur1x);
for (int i = 1; i < _iterations; i++)
{
Blit(commandBuffer, bufferA[i - 1], bufferB[i], Pass.BloomHorizontalBlur2x);
Blit(commandBuffer, bufferB[i], bufferA[i], Pass.BloomVerticalBlur1x);
}
commandBuffer.SetGlobalTexture("_BloomTextureA", bufferA[0]);
commandBuffer.SetGlobalTexture("_BloomTextureB", bufferA[1]);
commandBuffer.SetGlobalTexture("_BloomTextureC", bufferA[2]);
commandBuffer.SetGlobalTexture("_BloomTextureD", bufferA[3]);
Blit(commandBuffer, bufferB[0], bufferB[0], Pass.BloomUpsample);
commandBuffer.SetGlobalTexture("_BloomTextureA", bufferB[0]);
}
base.Blit(commandBuffer, ref renderingData, _material, (int)Pass.ColorGrading);
}
}
private void Blit(CommandBuffer commandBuffer, RTHandle source, RTHandle destination, Pass pass)
{
const RenderBufferLoadAction Load = RenderBufferLoadAction.DontCare;
const RenderBufferStoreAction Save = RenderBufferStoreAction.Store;
Blitter.BlitCameraTexture(commandBuffer, source, destination, Load, Save, _material, (int)pass);
}
public void Dispose()
{
for (int i = 0; i < _iterations; i++)
{
_bloomBufferA[i]?.Release();
_bloomBufferB[i]?.Release();
}
CoreUtils.Destroy(_material);
}
public enum Pass
{
Blit,
BloomPrefilter,
BloomHorizontalBlur1x,
BloomHorizontalBlur2x,
BloomVerticalBlur1x,
BloomVerticalBlur2x,
BloomUpsample,
ColorGrading
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c02e00032f3ae5741802c9c3f8f159ee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,29 @@
using UnityEngine;
namespace Nahida
{
public class TransformRotator : MonoBehaviour
{
[SerializeField]
private float m_Cycle;
[SerializeField]
private Vector3 m_Axis;
private Quaternion _rotation;
private float _startTime;
private void OnEnable()
{
_rotation = transform.rotation;
_startTime = Time.time;
}
private void Update()
{
float angle = 360f * (Time.time - _startTime) / m_Cycle;
transform.rotation = Quaternion.AngleAxis(angle, m_Axis) * _rotation;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7e3dba08e0aa80041b5851de7eb4b984
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8a91b80380d2e7645a41490ca179f3ff
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: da51638b519fbd14fbac4de01b43551b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ca60285cf76f6c148aad8e69a749aaec
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d1934e58fa8b8cf4c97000eb611939a2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

View File

@@ -0,0 +1,136 @@
fileFormatVersion: 2
guid: 8d0725e4ea2aee94c98ab0192535db14
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

View File

@@ -0,0 +1,136 @@
fileFormatVersion: 2
guid: d1a512d3310db4d4994af5c284375a5b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

View File

@@ -0,0 +1,136 @@
fileFormatVersion: 2
guid: c925f4ff0a6937e49b70bafde2eeb710
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More