Commit Graph

33 Commits

Author SHA1 Message Date
Jack Porter
35064cbda6 Fix index buffer overflow crash when rendering tessellation on landscapes with more than 1 subsection. (UE-14187)
[CL 2528096 by Jack Porter in Main branch]
2015-04-28 03:32:03 -04:00
David Ratti
4cfa4288d4 Merge
CL 2505532 Moved custom depth checking to CanBeOccluded()
CL 2500364 Don't consider static meshes with precomputed shadows to be dynamic

[CL 2510964 by David Ratti in Main branch]
2015-04-13 18:27:47 -04:00
PaulEremeeff
3d878d5a79 PR #996: Fixing PVS-Studio warnings (Contributed by PaulEremeeff)
I have reviewed each change carefully, but it is a large change and I could have missed something! Here is a summary of the types of changes in this CL:
 * Made nullptr checks consistent (the plurality of the changes are of this type)
 * Completed switch statements (IE, switch did not explicitly handle default case, but had unhandled enum entries - this is the second most popular type of fix)
 * Removed unused variables
 * Removed redundant initializations
 * WidgetNavigationCustomization.cpp was fixed by the owner
 * integers converted to floats where result was stored in a float
 * Removed redundent null checks (e.g. before delete statements)
 * Renamed variables to prevent non-obvious shadowing
 * Fixed use of bitwise & when checking for equality to an enum entry (which is often 0)
 * Fixes for some copy paste errors (e.g. FoliageEdMode.cpp)

[CL 2498053 by Dan Oconnor in Main branch]
2015-03-31 20:12:31 -04:00
Jack Porter
72e3b99ec1 Fix ensure selecting landscape view LOD override exceeding landscape's MaxLOD setting.
[CL 2485719 by Jack Porter in Main branch]
2015-03-20 01:44:05 -04:00
Jack Porter
9510848571 Fix ensure/missing landscape when using the viewport Override LOD greater than the landscape's maximum LOD.
[CL 2482650 by Jack Porter in Main branch]
2015-03-17 23:34:50 -04:00
Jack Porter
218071f97b Fix crashes in FLandscapeComponentSceneProxy::GetStaticBatchElementVisibility when using ForcedLOD or LODBias on landscape components during texture streaming UE-11321
[CL 2478340 by Jack Porter in Main branch]
2015-03-13 04:42:50 -04:00
Marc Audy
037d007078 Fix shadowed variables
[CL 2471506 by Marc Audy in Main branch]
2015-03-06 15:13:38 -05:00
Jack Porter
be9e597db5 Fix for Crash in FLandscapeComponentSceneProxy::GetStaticBatchElementVisibility with tiny component size
UE-11046

[CL 2463446 by Jack Porter in Main branch]
2015-02-26 20:50:53 -05:00
Daniel Wright
4000d45935 Integrate - Heightfield occlusion is now applied to objects without a distance field representation
* Added HasHeightfieldRepresentation bit to GBuffer to accomplish this

[CL 2452200 by Daniel Wright in Main branch]
2015-02-19 16:18:18 -05:00
Daniel Wright
a0bf3e21e3 Heightfield GI uses baked diffuse color textures from Landscape
[CL 2440854 by Daniel Wright in Main branch]
2015-02-10 20:55:30 -05:00
Daniel Wright
d05993f885 Heightfield dynamic Global Illumination
* Enable with 'r.DistanceFieldGI 1' on console
* Surfel GI is currently disabled as it doesn't interop yet
* A GBuffer atlas is created for Landscape from components that can affect indirect lighting based on the current view
* Shadowing from a directional light is computed by reusing shadowmaps and ray tracing distance fields
* Lighting is computed for the atlas using GBuffer properties
* First bounce GI light transfer is computed for a receiver by iterating over all the nearby lit texels of the heightfield and treating them as Virtual Point Lights.  Two gather regions are used, the larger one skips through the heightfield to achieve a larger bounce distance.  Distance field AO is used to provide local shadowing.
* Material diffuse color not yet supported, and regions outside of the view don't have valid shadowing.

[CL 2436606 by Daniel Wright in Main branch]
2015-02-06 23:31:19 -05:00
Jack Porter
89f3aea1f7 Ignore all neighbor LOD calculations for LOD override used to render grass maps
[CL 2426090 by Jack Porter in Main branch]
2015-01-30 13:32:53 -05:00
Jack Porter
7db2b69955 Automatically flush landscape grass when changing or recompiling the material
Automatically generate grass maps for all components, streaming in textures and weightmaps where needed
Status window when building grass maps
Grass data is now shared between Editor and PIE
Fixed issue where it didn't wait for streaming after updating grass map after painting landscape

[CL 2425895 by Jack Porter in Main branch]
2015-01-30 11:17:08 -05:00
Daniel Wright
ba3963fcaf Surfel Global Illumination with Distance Field shadowing
* Disabled by default, need a movable skylight with r.DistanceFieldGI enabled at load time (ConsoleVariables.ini)
* Surfels (oriented disks) are placed on mesh surfaces and capture diffuse color by evaluating the material with actual UVs and world position
* Surfels are lit and shadowed by ray tracing through mesh distance fields (directional light only so far)
* Irradiance cache records are lit with nearby Virtual Point Lights created from lit surfels.  Only using camera based LOD of the surfel representation and object based surfel culling, no hierarchy yet.
* Shadowing of the VPLs is provided by distance field cone tracing.  A depth visibility function is constructed along each of the 9 cone trace directions, and used to shadow the incoming VPL lighting.
* Component reregistration and transform updating causes surfels to be generated again which can be slow.  In the future only the material needs to be re-evaluated.
* Geometry shaders with stream out are now supported, by implementing FShader::GetStreamOutElements
* Compute shaders can now evaluate materal attributes like BaseColor
* SkyLight MaxOcclusionDistance increased to 10m, which is the minimum useful amount for GI

[CL 2424208 by Daniel Wright in Main branch]
2015-01-29 14:46:20 -05:00
Jack Porter
5065cf0d0d Grass generation using material
#code_review: gil.gribb, nick.penwarden

[CL 2417004 by Jack Porter in Main branch]
2015-01-23 12:56:04 -05:00
Martin Mittring
d32b58aaf0 fixed UE-7498 Launching or Stopping PIE when Running 'Effects Cave' and 'Elemental' Demos
[CL 2406158 by Martin Mittring in Main branch]
2015-01-14 13:40:15 -05:00
Jack Porter
24c133befa Fix seams between proxy streaming levels and real landscape
[CL 2400802 by Jack Porter in Main branch]
2015-01-08 06:59:31 -05:00
Daniel Wright
e5b9932ce5 DF AO from heightfields view frustum culling
* 21ms in GDC level for landscape occlusion down to .12ms
* Also fixed heightfield occlusion from Landscapes with subsections

[CL 2400088 by Daniel Wright in Main branch]
2015-01-07 14:29:28 -05:00
Jack Porter
f053a4a2dc Fix for potential crash when shutting down landscape
[CL 2399457 by Jack Porter in Main branch]
2015-01-06 21:34:44 -05:00
Jack Porter
8faf874fb7 Fix for Mac compilation
[CL 2393647 by Jack Porter in Main branch]
2014-12-19 06:42:26 -05:00
Jack Porter
bce653d631 Fix various landscape LOD discontinuities between neighbors and while texture streaming
[CL 2393633 by Jack Porter in Main branch]
2014-12-19 05:52:40 -05:00
Dmitriy Dyomin
d3cbe0d10a Fixed: Texture streaming TexelFactor calculation for mirrored landscapes
[CL 2384873 by Dmitriy Dyomin in Main branch]
2014-12-10 21:34:11 -05:00
Jack Porter
eb0cd3eaa2 Landscape wireframe on top visualization mode
[CL 2380272 by Jack Porter in Main branch]
2014-12-08 09:30:58 -05:00
Ben Marsh
149375b14b Update copyright notices to 2015.
[CL 2379638 by Ben Marsh in Main branch]
2014-12-07 19:09:38 -05:00
Gareth Martin
63e5fff961 Fix Landscape cracks:
This was mostly caused by rounding to the nearest vertex on multiple LOD transitions, which wasn't stable (On one component in LOD 0, vertex A in LOD 0 would round to vertex B in LOD 1 and vertex C in LOD 2 (vertex C being the nearest to vertex A, not necessarily vertex B), but the next component would be in LOD 1 and so would start with vertex B, and round it to a different LOD 2 vertex)
Partly responsible was also the "DistLOD" hack, because it used different shader code for if LodValues.x (aka "DistLOD") was <1 or >1, so would cause a beautiful seam between components which hit each case

There will still be temporary seams between landscape components that are still streaming their heightmap textures, a solution to that is in the works.

Also:
Removed FLandscapeXYOffsetVertexFactoryVertexShaderParameters and merged it with FLandscapeVertexFactoryVertexShaderParameters to remove a large amount of code duplication, and did some cleanup of LandscapeRender.cpp/.h (e.g. autoformatting)

[CL 2377758 by Gareth Martin in Main branch]
2014-12-05 12:13:10 -05:00