Commit Graph

165 Commits

Author SHA1 Message Date
jimmy andrews
78fbcb1c6b Use deprecated typedef to fix FSelectedOjectsChangeList typo in ITF's ToolContextInterfaces
#jira UE-192620
#rb matija.kecman
#rb lonnie.li

[CL 27782397 by jimmy andrews in ue5-main branch]
2023-09-12 00:11:43 -04:00
charles lefebvre
dccce9d7f8 Remove impossible Cast to UInterchangeGenericAssetsPipeline from UInterchangePythonPipelineBase
#rb Alexis.Matte
#rnx

[CL 27290593 by charles lefebvre in ue5-main branch]
2023-08-22 18:20:02 -04:00
zach bethel
28be363548 Resubmitted render command pipe CL's: 27048554, 27048589, 27048615, 27049788, 27049950, 27050314, 27050334.
- Niagara dynamic data
 - Cable component
 - Skinned mesh

[CL 27076836 by zach bethel in ue5-main branch]
2023-08-14 13:39:43 -04:00
bob tellez
9a6ca97f78 [Backout] - CL27048554, 27048589, 27048615, 27049788, 27049950, 27050314, 27050334
[FYI] zach.bethel
First Original CL Desc
-----------------------------------------------------------------
Moved volumetric volume to RHICmdList.

[CL 27054300 by bob tellez in ue5-main branch]
2023-08-11 20:13:53 -04:00
zach bethel
c94edfce4c Moved skeletal mesh and GPU skin cache updates off the render thread to a dedicated render command pipe.
[CL 27049967 by zach bethel in ue5-main branch]
2023-08-11 18:17:15 -04:00
balazs toereki
a49c81062a [Interchange] Warnings when cooking a game with Interchange plugins disabled fixes.
Serializing NodeContainer and Pipellines for UInterchangeImportAssetData.

#jira UE-174312
#rb Alexis.Matte

[CL 26459650 by balazs toereki in ue5-main branch]
2023-07-19 10:01:34 -04:00
kirill zorin
de8db5ff76 Converting ARO-facing raw pointers to TObjectPtr ahead of raw pointer ARO API deprecation.
#rb zousar.shaker
#rb markus.breyer
#rb robert.manuszewski

#preflight 646391406b1406b54ab15460

[CL 25489627 by kirill zorin in ue5-main branch]
2023-05-16 10:52:49 -04:00
bryan sefcik
da92084a12 Optimized out more private modules includes and dependencies.
#preflight 64627c382965f6ea8ea83bd6

[CL 25479683 by bryan sefcik in ue5-main branch]
2023-05-15 16:26:12 -04:00
cedric caillaud
81bb5ab492 Geometry collection optimization : Change GlobalMatrices array of FMatrix to ComponentSpaceTransforms array of FTransform
- This reduces the number of back and forth conversion between FTransform and FMatrix

[FYI] jeremy.moore
#rb benn.gallagher, michael.bao, chris.caulfield, vincent.robert
#preflight 645c9285ea1c7ba4d67d0fbc

[CL 25438640 by cedric caillaud in ue5-main branch]
2023-05-11 19:37:23 -04:00
charles bloom
ffe45866e0 clean up code using GetMipData without checking return value
GetMipData can return false on textures that have no sources
Textures without source is common now in UEFN
also comment about some code that is broken or more fragile than necessary

#preflight https://horde.devtools.epicgames.com/job/6423434d710ec8400fe83bd6
#rb fabian.giesen,dan.thompson

[CL 24831862 by charles bloom in ue5-main branch]
2023-03-29 02:28:14 -04:00
Johan Duparc
b0ed73fb3b mesh paint tools: Fix broken keyboard shortcuts
#jira UE-180797
#rb Ronald.Koppers
#preflight 641b14f137382f6bf5192bfb

[CL 24747795 by Johan Duparc in ue5-main branch]
2023-03-22 10:53:51 -04:00
Marc Audy
0931579e66 Fix non-unity
#fyi graham.wihlidal, juan.canada
#rnx
#preflight

[CL 24744348 by Marc Audy in ue5-main branch]
2023-03-22 01:08:27 -04:00
sebastien lussier
f222818298 Use the new FBoxSphereBounds::Builder to clean other initialization of FBoxSphereBounds
* Those where correct, but did manual job to ensure the origin wasn't automatically included in the bounds
#rb jeanfrancois.dube, patrick.enfedaque

[CL 24739720 by sebastien lussier in ue5-main branch]
2023-03-21 17:09:36 -04:00
sebastien lussier
0c3948ad71 FBoxSphereBounds - Fixed many potential issues with bounds initialization containing the origin (0,0,0)
* Added a FBoxSphereBounds::Builder class to help avoid these kind of issues
#rb jeanfrancois.dube, patrick.enfedaque
[FYI] Graham.Wihlidal
#preflight 6419e677ec01de1664d3e95c

[CL 24739078 by sebastien lussier in ue5-main branch]
2023-03-21 16:38:42 -04:00
graham wihlidal
074f8f6431 Fix static analysis warning in MeshPaintModeHelpers.cpp
#preflight trivial
#rb juan.canada

[CL 24675792 by graham wihlidal in ue5-main branch]
2023-03-16 14:29:50 -04:00
graham wihlidal
ca6136ac1e Fix up deprecated APIs
#preflight trivial

[CL 24668016 by graham wihlidal in ue5-main branch]
2023-03-16 01:42:33 -04:00
graham wihlidal
d1bd26aca8 Texture Painting Improvements - from Jacob Nelson (jacob.nelson@disbelief.com) from the Coalition
#rb graham.wihlidal, brian.karis
#preflight skip

This changelist contains all of the improvements we've made to the texture painting system during our development time.

Here is the full list of included CLs:

1)
"
Improved texture painting debug draw
Before this change, debug draw for the vertex/texture painting tool only displayed vertex colors. This changelist improves the debug draw to show the texture painting data on the mesh proxy in a similar way as the vertex painting.

As part of this changelist, I fix a bug found in FColoredTexturedMaterialRenderProxy::GetParameterValue. The problem was that the FColoredTexturedMaterialRenderProxy overrides a color and a texture parameter, but we only considered the texture parameter. This was preventing the texture painting to display different color channels on request.
Full list of changes:
Added directory of new special material, TexturePaintingMaskMaterial, to BaseEngine.ini
Updated Engine.h/UnrealEngine.cpp to keep a texture painting mask material. (TexturePaintingMaskMaterial.uasset). This material splits has a color parameter and a texture parameter. The texture parameter is filtered based on the color parameter for RBG channels. When all channels (RBG) are set to 0, we display the alpha as the color purple instead of opacity because alpha is typically used as a texture mask in the use cases for texture painting.
Updated FColoredTexturedMaterialRenderProxy::GetParameterValue to call base class functions in order to correctly query the color parameter.
Added the transient weak object pointer "OverridePaintTexture" to "UMeshPaintingSubsystem". This is set by the texture painting system to override the texture painting debug draw during active drawing.
Added the weak object pointer global "GVertexViewModeOverrideTexture" which is used to propagate debug draw behavior to relevant meshes that are being painted. This follows the method already in place for the vertex color debug draw.
Updated StaticMeshRender.cpp/SkeletalMesh.cpp to now handle the new "GVertexViewModeOverrideTexture" weak object pointer.
Added the enum class "EMeshPaintActiveMode" which is used by the paint mode subsystem when setting the viewport color mode. This is used to differentiate when to show debug draw for normal color, weights, and texture. The names chosen here follow the same names as the tools themselves.

"


2)
"
Support for Texture Painting Flood Fill tool
This changelist adds the feature for a "Flood Fill" tool option for Texture painting.
To use the new feature:
1) Change to Mesh Paint Mode using the gamemode drop-down in the top right corner of the editor.
2) Change to the "Textures" tab in the Mesh Paint window.
3) Click on the new "Paint Bucket" button near the paint button on the texture painting tool to fill the texture using the current options.
The flood fill tool takes into consideration the UV channel, brush texture, alpha channel, and all color channels on the option configuration. This is accomplished by using the same texture painting shader passes as normal painting. The difference is there is now a new permutation for the paint bucket fill which no longer limits the draw to just the selected area.
Full list of changes:
Added the boolean "bUseFillBucket" to FMeshPaintParameters to pass forward whether or not we are using the fill bucket tool.
Updated "UMeshPaintMode::BindCommands" with a new action for the paint bucket "TextureFill".
Updated UMeshPaintMode with a new function "FillWithTextureColor" which is bound to the paint mode command "TextureFill".
Updated "MeshPaintPixelShader.usf" with the shader permutation macro for "MESH_PAINT_USE_FILL_BUCKET" which will output a simple flood if no paint brush is selected. If a paint brush is selected, it will fill the texture using the brush texture which respects an input rotation.
Added permutation FMeshPaintUseFillBucket to "TMeshPaintVertexShader".
Added logic in "UMeshTexturePaintingTool::OnTick" to handle paint bucket requests.
"

3)
"
Fixes for Mesh Painting Texture Filter, Infinite Loop
This change resolves two mesh painting UI bugs.

The first issue was the Paint Texture filter always returning no results, resulting in only the first texture in the list being paintable.  This was due to the filtering function using a generic editor asset name instead of the candidate texture's full name when comparing against the list of valid paintable textures.  This change resolves this issue by using the full name from the asset's associated UTexture2D instead.

The second issue was an infinite loop that freezes the editor UI.  This would occur when opening the texture painting options for a mesh with a non-instance material associated to it.  This change resolves this issue by adding the appropriate break condition to handle this case.

"

4)
"
Fixed Material Texture Parameter Override not refreshing

Before this change, the texture painting system would not properly show active textures being drawn on layered materials. This was because "UMaterialInstance::OverrideTextureParameterValue" only overrode the surface level material and did not consider parent materials.

To fix this, I have now updated "UMaterialInstance::OverrideTextureParameterValue" to also call this function on any existing parents. Along with this, "UMaterialInstance::ResetAllTextureParameterOverrides" is now recursive on its parent for proper texture parameter override cleanup.
As part of this change, I have now also updated IMeshPaintComponentAdapter::DefaultQueryPaintableTextures to query parent material instances for suitable textures for painting. This is needed because parent paintable textures were not being shown in the texture painting tool.
"

5)
"
Fixing a mesh painting bug due to the source texture not being checked for validity. This happens on a "Default_RenderTarget_Clear" texture that has  no source texture.
"


6)
"
Texture Painting - Improved material parameter visiblity

Before this change, the texture painting tool only considered textures visible on the top level of a material script. This meant artists needed to to purposely expose any textures needed for painting outside of any material functions in order to paint the texture using the tool. This changelist fixes this problem by now iterating on a given material's texture parameters when filtering out paintable textures.

Full list of changes:
Added helper function "IsTextureSuitableForTexturePainting" in "IMeshPaintComponentAdapter.cpp" to avoid code duplication.
Updated "IMeshPaintComponentAdapter::DefaultQueryPaintableTextures" to iterate through texture parameter values.
Removed the local boolean "bIsTextureUsed" from "UMeshTexturePaintingTool::StartPaintingTexture". This is because "IMeshPaintComponentAdapter::DefaultQueryPaintableTextures" already filters out any unused textures, so filtering again here is unnecessary.
This change was needed in this CL because "UTexturePaintToolset::DoesMeshComponentUseTexture" does not consider texture parameters. I opted to completely remove "bIsTextureUsed" instead of updating the function. This is to prevent any future bugs relating to "DoesMeshComponentUseTexture" not matching "DefaultQueryPaintableTextures".
"

7)
"
Improved texture painting undo/redo stability
Before this change, a 2 crashes could occur when rapidly hitting the undo/redo key when using the texture painting tool. This changelist fixes both crashes.
The first crash would happen due to the internal bulk data being invalid. This can happen when texture streaming is cancelled mid-stream and a new texture 2D is assigned. To fix this, I now use the "Texture2D::Modify" function to refresh the bulk data if needed and wait for any streaming before doing any painting.
The second crash would happen if undo/redo was triggered while the user is currently painting. This is because the function "UMeshTexturePaintingTool::StartPaintingTexture" would assume that the current texture is streamed in if "bStartedPainting" is true. However, this isn't the case if the user "undos" a painting operation while holding down the paint button. To fix this, I now condition both "bStartedPainting" and "bIsSourceTextureStreamedIn" when attempting to continue a painting operation.
"

8)
"
Fixing a Texture Painting crash that occurs when editor is using SM6
"

9)
"
Feature Support for Texture Painting Brushes

Before this changelist, it was only possible to use the texture painting tool to paint a single color using a solid brush. This changelist adds support for custom texture painting brushes on the texture painting tool.
To use the new feature:
1) Change to Mesh Paint Mode using the gamemode drop-down in the top right corner of the editor.
2) Change to the "Textures" tab in the Mesh Paint window.
3) Use the "Paint Brush" parameter to select from any texture in-editor as a brush.
4) Use the "Paint Brush Rotation Offset" parameter to set the initial 2D rotation of the texture on a mesh.
5) Optionally select "Rotate Brush Towards Direction" to continously paint a texture in a given direction on a mesh.
6) Paint onto any surface

Full list of changes:
Added the variable "BrushPosition2D" to FMeshPaintParameters which is now used for tracking our current and previous 2D brush position.
Added the variable "PaintBrushRenderTargetTexture" to "FPaintTexture2DData" to hold  a local copy of any texture brush being used for painting.
Updated "MeshPaintPixelShader.usf" with seperate painting paths for applying a paint brush texture.
Updated "TMeshPaintPixelShader" to now bind and pass in the new paint brush parameters.
Updated "TMeshPaintPixelShader" with two new permutation domains (FMeshPaintUsePaintBrush and FMeshPaintUseRotateTowardDirection).
Fixed a small bug in SetMeshPaintShaders where the normal mesh paint pass was using the GMeshPaintDilateVertexDeclaration instead of the GMeshPaintVertexDeclaration declaration. I have opted to correct this in this changelist since I was already editing this area of code with the new permutation vectors.
Updated "FMeshPaintShaderParameters" with the new paint brush related parameters.
Updated "UMeshTexturePaintingToolProperties" with the new paint brush related parameters.
Added optional parameter to "UMeshTexturePaintingTool::PaintTexture" to pass in last attempt's parameters which is used for calculating our 2D movement vector for the "Rotate Brush towards direction" feature.
Updated "UMeshTexturePaintingTool" to now keep track of LastPaintRayResults to use when determining the 2D movement vector.

Potential improvements:
Update the dilate texture painting to also support the texture painting brushes. Currently, it doesn't seem that artists are using the dilate feature, so this changelist only targets the normal texture painting.
Add support for triplanar mapping.
"

10)
"
Updated Active Texture Painting Selection

This changelist is a quality of life improvement for texture painting to always have paintable texture selected if one is available.
Before this change, it was possible to have no paint texture selected even if we have available options. This ended up causing confusion when debug draw was enabled. In this case, the debug draw would show no texture painting information because the draw shows only the currently active paintable texture.
This changelist fixes that by now recaching the paint texture in the function "UMeshTexturePaintingTool::OnTick" when a paintable texture is available but the texture properties has the active texture set to nullptr.
"

11)
"
Default UV Channel to light map coordinate index

Before this change, the default value for UV Channel was always 0 which doesn't always align with what the user would like to paint. This caused confusion when trying to paint, but the channel was incorrect. This change updates the constructor for UMeshTexturePaintingToolProperties to now set the default UVChannel value to the light map coordinate index of the first selected mesh. It is still possible to change the UVChannel manually, but this index is likely the one users would be wanting to paint when using the mesh painting tool.

"

12)
"
Fixed texture parameters not taken for consideration for texture painting

Before this change, it was not possible to texture paint a material's texture if that texure was registered as a texture parameter. This was clearly not intentional because the texture painting tool gathers texture parameters as paintable textures in the function "IMeshPaintGeometryAdapter::DefaultQueryPaintableTextures". The reason why texture parameters weren't being painted is because the "UMaterialInterface::OverrideTexture" editor only function did not consider texture parameters when assigning an override texture. This meant that the painted texture would never override the texture parameter actually being used for render.

To fix this, I have now updated the "OverrideTexture" method to also override any appropiate texture parameters. I believe this is an overlooked edge case of the override texture functionality, so it is necessary to modify the function here instead of creating a workaround in the texture painting system. My implementation  in this changelist stores an array of "texture parameter overrides" which is a custom struct with an object pointer to the old texture and the new one, and then on setting new textures, we reference this array. This is editor-only.

With these changes, I have tested the texture painting tool on materials with and without texture parameters along with the following scenarios:
saving/loading texture painted materials in-progress and committed/saved.
undo/redo
copy/paste
destroy/creation
moving/edit transform
All cases tested worked as expected.
Detailed changes:
Updated UMaterialInstance::GetTextureExpressionValues to consider the override textures. This function is used to collect all textures used by a given material instance.
Updated UMaterialInstance::OverrideTexture to now also override the texture parameter value.
Updated UMaterialInstance::Serialize to reset all texture parameter overrides on serialize to avoid serializing any in-progress texture parameters.
Updated UMaterialInstance::ClearParameterValuesInternal to reset the texture parameter overrides if we are resetting the normal texture parameters.
Created the new function "UMaterialInstance::OverrideTextureParameterValue", which is used to manage any registered overridden textures in editor. Requesting an override texture with "nullptr" will remove a given entry from the overrides. This function is meant to work the same way on the texture parameters as "UMaterialInstance::OverrideTexture" does on the internal texture transient overrides.
Created the new helper function "UMaterialInstance::ResetAllTextureParameterOverrides" which iterates through all of our overrides and properly removes them.
Made the function "UMaterialInterface::GetTextureParameterValue" virtual and created the function "UMaterialInstance::GetTextureParameterValue" which overrides any relevant texture parameter value using the internal transient texture parameter overide array. Outside of editor, the function will end up only calling the base function.
Updated "UMeshTexturePaintingTool::OnTick" to clear all texture overrides when a recache is necessary. This fixes a problem where "undo" wasn't reflecting in the texture at times because a stal texture override was being used. By clearing at this spot, any necessary texture overrides will be registered later.

"

13:
"
Fix Texture Painting Visualization

The visualization for texture painting was not showing before this change. The issue is that ShouldProxyUseVertexColorVisualization was returning false when it shouldn't be. GVertexViewModeOverrideOwnerName seems to be an empty string when it should still be the currently painted component name. The string is being set in UMeshTexturePaintingTool::CanBeginClickDragSequence but is then being immediately reset by a call to UMeshTexturePaintingTool::ClearAllTextureOverrides. To fix this I also set GVertexViewModeOverrideOwnerName in the function UMeshPaintModeSubsystem::SetViewportColorMode. This function gets called every frame and will re-register the name string after being cleared. It is also where another override variable, GVertexViewModeOverrideTexture, is already being re-registered.
"

#ushell-cherrypick of 24639501 by Jess.Kube

[CL 24667907 by graham wihlidal in ue5-main branch]
2023-03-16 01:21:33 -04:00
Florin Pascu
106ea7508c Preparation changes for removing FeatureLevel from World
FeatureLevel is Deprecated
Add Setter/Getter for FeatureLevel
NextStep: Make GetFeatureLevel returns DDSPI::GetFeatureLevel, remove FeatureLevel memberfrom UWorld
#jira UE-168551
#rb christopher.waters
#preflight 63ff5e49f43e53f6811c86a4

[CL 24461796 by Florin Pascu in ue5-main branch]
2023-03-01 09:41:33 -05:00
jimmy andrews
24982da9e9 fix mesh paint not updating vertex colors for geometry collection + losing exploded vectors on finishing paint transactions
#rb jeremy.moore
#preflight 63f0437b61378b7ea05d43d1

[CL 24298076 by jimmy andrews in ue5-main branch]
2023-02-18 00:01:10 -05:00
christopher waters
c6c2200520 Adding includes before cleaning up RHI dependencies.
[CL 23888475 by christopher waters in ue5-main branch]
2023-01-27 14:17:39 -05:00
henrik karlsson
9a1d5b1ad4 [Engine/Plugins]
* Ran IWYU on ~170 plugins to remove includes not needed. Public api still keep old includes inside #if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2

#preflight 63d09351574ab9cae4670216
#rb none

[CL 23844750 by henrik karlsson in ue5-main branch]
2023-01-25 02:42:36 -05:00
jimmy andrews
829a30210c rework how UVs are accessed in geometry collection: make each UV layer a separate attribute, so it is impossible to have an inconsistent number of UVs per vertex, and we do not allocate so many small arrays. Provide a variety of helper functions to make the transition as easy as possible.
#rb cedric.caillaud
#rb brice.criswell
#preflight 63d074be976daa618cdcd957

[CL 23844522 by jimmy andrews in ue5-main branch]
2023-01-25 01:36:28 -05:00
henrik karlsson
9183978e29 [Engine/Plugins]
* Removed includes (using IWYU) in private files

#preflight 63c79978ac35a0e9dabbe408
#rb none

[CL 23770038 by henrik karlsson in ue5-main branch]
2023-01-19 00:48:07 -05:00
christopher waters
78f037973c Compile fixes for IWYU and upcoming dependency changes.
#preflight 63bee6bcaf3ebedd997f0c08

[CL 23658416 by christopher waters in ue5-main branch]
2023-01-11 20:52:41 -05:00
bob tellez
971983eb65 [Backout] - CL23624045
[FYI] christopher.waters
Original CL Desc
-----------------------------------------------------------------
RHI header dependency cleanup
- Reducing other header dependencies from RHIDefinitions.h
- Moved a few functions to the new RHIStrings.h
- Uniform buffer layout initializer moved to its own file to reduce RHI dependency on MemoryLayout.

#preflight 63bca752577437afe604b097

[CL 23631957 by bob tellez in ue5-main branch]
2023-01-10 15:28:15 -05:00