Commit Graph

63 Commits

Author SHA1 Message Date
sebastien lussier
daa2f8be29 Material Baking - Made baking more resilient to materials that output none of the requested properties (diffuse, normal, etc)
#rb philippe.deseve

[CL 24542666 by sebastien lussier in ue5-main branch]
2023-03-07 12:25:14 -05:00
sebastien lussier
25d57df2f5 Material Baking - Fix incorrect use of ProcessEmissiveOutput()
* Pitch in is pixels, not bytes
#rnx
#rb jeanfrancois.dube

[CL 24251953 by sebastien lussier in ue5-main branch]
2023-02-16 02:09:13 -05:00
sebastien lussier
d5b66a61f2 Material Baking - Added optimized code path when baking a set of meshes with remapped UVs
* In this case, instead of baking each mesh material property to it's own buffer, we can write all the meshes to the same buffer as their UVs are already the final ones that do not overlap
* Memory usage is greatly reduced (in test case with ~300 materials to bake, peak is reduced by 5.5GB)
* A lot faster to process (~2x in most cases) as we are doing a single RT readback per baked material property
* We can also skip the final merge of the baked outputs, as we have a single one

Refactored the material baking module to have both code paths (single output and multi outputs) share as much code as possible

#rb jeanfrancois.dube
#preflight 63eba6e0284e76cdadbecb48

[CL 24226039 by sebastien lussier in ue5-main branch]
2023-02-14 22:23:44 -05:00
sebastien lussier
f026ca0289 Material Baking - When force streaming in all the referenced textures mips, use a better(faster) mechanism to wait for completion
#rb jeanfrancois.dube

[CL 24174522 by sebastien lussier in ue5-main branch]
2023-02-13 10:07:21 -05:00
sebastien lussier
4f5f06aea0 Added a CRC to the MaterialBaking module, to be able to detect if code (by changing the base key) or setting changes could require an HLOD rebuild
#rb jeanfrancois.dube

[CL 24082386 by sebastien lussier in ue5-main branch]
2023-02-08 16:14:18 -05:00
sebastien lussier
bda8942ff2 Material Baking - Added "MaterialBaking.ForceDisableEmissiveScaling" CVar (disabled by default)
* If set to true, values stored in the emissive textures will be clamped to the [0, 1] range rather than being normalized and scaled back using the EmissiveScale material static parameter
#rb jeanfrancois.dube

[CL 24075476 by sebastien lussier in ue5-main branch]
2023-02-08 12:33:41 -05:00
aidin abedi
7205306d48 Add FMaterialBakingModule::IsLinearBake to determine if a material property is baked to a linear texture or not
#jira none
#review @Jason.Nadro @Kevin.Ortegren
#preflight 63c9795a0225f00e14a99bd8

[CL 23808244 by aidin abedi in ue5-main branch]
2023-01-23 01:21:39 -05:00
aidin abedi
86152b0bc7 Add support for material baking custom output transmittance color and fix crash when baking invalid custom output
#jira UE-131149
#preflight 63ae50efc16855964d09967c
#review @Kevin.Ortegren @Massimo.Tristano

(based on PR #8498)

[CL 23767003 by aidin abedi in ue5-main branch]
2023-01-18 18:21:18 -05:00
aidin abedi
7d0da30082 Add support for material baking refraction property
#jira UE-131147
#review @Kevin.Ortegren @Massimo.Tristano

(based on PR #8496)
#preflight 63c6ce4f3f587d9e14ece2b0

[CL 23739612 by aidin abedi in ue5-main branch]
2023-01-17 11:53:37 -05:00
aidin abedi
8fe4cdb936 Add support for using material baking to efficiently check UV overlap
#jira UE-131151
#review @Kevin.Ortegren @Massimo.Tristano

(based on PR #8500)
#preflight 63c6c7ff02024f93d861359e

[CL 23739117 by aidin abedi in ue5-main branch]
2023-01-17 11:26:41 -05:00
aidin abedi
cd6a77b27f Add support for material baking shading model property
#jira UE-131148
#review @Kevin.Ortegren @Massimo.Tristano

(based on PR #8497)
#preflight 63c6c0220b358b97d1983695

[CL 23738607 by aidin abedi in ue5-main branch]
2023-01-17 10:53:19 -05:00
christopher waters
0d5b23e2e3 Adding includes to prepare for a header dependency cleanup.
#preflight 63b5e0bfff7b9ad7030f0f81

[CL 23581920 by christopher waters in ue5-main branch]
2023-01-04 17:07:40 -05:00
daniel coelho
7b71ba4b8c USD: Allow disabling the shrinking of baked textures to a single value.
#jira UE-156488
#rb Anousack.Kitisa, Sebastien.Lussier
#preflight 637e0deb4364ef8d14699d50

[CL 23247798 by daniel coelho in ue5-main branch]
2022-11-23 07:15:12 -05:00
henrik karlsson
b5b86c796c This change is a strategical submit for a coming change that removes lots of includes in headers that are included by many files. This change contains adding of includes in files that previously got those includes transitively from other inclkudes
#preflight 6355d4940313c24974b2107b
#rb none

[CL 22783162 by henrik karlsson in ue5-main branch]
2022-10-26 12:57:32 -04:00
Jeremy Moore
2e03d242fa Bind virtual texture feedback buffer for DrawTileMesh
Also create a FViewFamilyInfo for DrawTileMesh so that we have a valid SceneTexturesConfig when setting up view uniforms.
Moved material baking renderdoc capture so that it captures warm up frames.
#rb jason.hoerner
#preflight 62aa0ce7273ce16835c64006

[CL 20673323 by Jeremy Moore in ue5-main branch]
2022-06-15 13:28:56 -04:00
zach bethel
2e0b2920c1 Fix transition errors in staging texture.
#preflight 628d354f1f11bc7326dcc251
#jira UE-153560

[CL 20370182 by zach bethel in ue5-main branch]
2022-05-25 15:43:02 -04:00
Jeremy Moore
0186b7d7bc Added virtual texture warmup for material baking.
Number of warmup frames is controlled by MaterialBaking.VTWarmupFrames CVar and defaults to 5
Warmup should only happen if material samples virtual textures.
#preflight 627ec42a5a0a06a57ea838e6

[CL 20189296 by Jeremy Moore in ue5-main branch]
2022-05-13 17:01:46 -04:00
christopher waters
4b9e68073c Deprecating RHICreateTexture2D and RHICreateTextureExternal2D.
#jira none
#rb zach.bethel
#preflight 627a6ec010766ef8c1f54f1e

[CL 20129702 by christopher waters in ue5-main branch]
2022-05-10 17:13:37 -04:00
zach bethel
2156756315 Replaced use of CopyToResolveTarget with CopyTexture.
#preflight 627a90ff7e5f24d1edd73422
#rb luke.thatcher, jason.hoerner

[CL 20127337 by zach bethel in ue5-main branch]
2022-05-10 14:47:34 -04:00
Kevin Ortegren
be9daf93f6 PR #8499: Add support for transforming normals in material baking from world-space (Contributed by aidinabedi)
#jira UE-131150
#rnx
#rb none
#fyi sebastien.lussier
#preflight 61f3fce3f628752a568a332d

[CL 18770923 by Kevin Ortegren in ue5-main branch]
2022-01-28 09:40:17 -05:00
jon nabozny
cdc65f654f Reland: Fixes motion blur lengths when using time dilation
#rb josie.yang
#lockdown michal.valient
#preflight 614a44526c96990001c47143

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 17606608 via CL 17962735 via CL 18364937 via CL 18364960
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18365023 by jon nabozny in ue5-release-engine-test branch]
2021-12-02 23:53:56 -05:00
jon nabozny
9693ad4915 Undo //UE5/Private-Frosty/Engine/... changelist 17586431
#lockdown michal.valient
#preflight revert for build breakage

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 17587410 via CL 17948832 via CL 18364580 via CL 18364616
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18364712 by jon nabozny in ue5-release-engine-test branch]
2021-12-02 23:34:52 -05:00
jon nabozny
c418c40de0 Fixes motion blur lengths when using time dilation
#rb josie.yang
#lockdown michal.valient
#preflight 614a1e3259380f0001888d92

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 17586431 via CL 17948712 via CL 18364381 via CL 18364522
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18364604 by jon nabozny in ue5-release-engine-test branch]
2021-12-02 23:30:35 -05:00
sebastien lussier
412cf1d7a1 MaterialBaking - Use correct linear bake for all texture property by default
Providing a new flatten material with the correct texture samplers.
Retrieve texture properties from the default textures in the material (linear vs srgb, compression, vt enabled, lod group...)

Previously generated material instances are unchanged.
All MergeActor engine tests pass successfully.

#rb patrick.enfedaque

#ROBOMERGE-SOURCE: CL 16484038 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v823-16466674)

[CL 16484318 by sebastien lussier in ue5-main branch]
2021-05-27 10:31:36 -04:00
sebastien lussier
3b200ed189 PR #7916: Lucasfilm: MaterialBaking: Fixes and improvements for material baking (Contributed by lflecunneen)
- Fixes for baking decal materials
- Option to return full HDR emissive color value
- Option to make all values linear by default, except for colors
#jira UE-115192
#rb sebastien.lussier

#ushell-cherrypick of 16289332 by ben.ingram
#ushell-cherrypick of 16373665 by sebastien.lussier
#ushell-cherrypick of 16413094 by sebastien.lussier

#ROBOMERGE-SOURCE: CL 16480669 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v823-16466674)

[CL 16480676 by sebastien lussier in ue5-main branch]
2021-05-27 00:01:31 -04:00