x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] How can I dynamically update a Skylight?

SkyLight allows input from a UTextureCube: a cubemap texture. But if I render to a cubemap, that's a UTextureRenderTargetCube. But UTextureRenderTargetCube does not derive from UTextureCube. I can generate a UTextureCube from a UTextureRenderTargetCube, but that's a one-off, expensive operation. How can I dynamically update a SkyLight - using a cubemap rendertarget or otherwise?

Product Version: Not Selected
Tags:
more ▼

asked Sep 19 '16 at 07:52 PM in Rendering

avatar image

Answers.Archive STAFF
1.9k 206 313 684

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed Sep 19 '16 at 07:53 PM by AndrewHurley for the following reason:

The question is answered, right answer was accepted


2 answers: sort voted first

I've implemented TrueSkyLight, derived from SkyLight to solve this. It amortizes the cubemap faces over frames (for reflections), and also updates the spherical harmonics coefficients (for ambient lighting). Most of the calculation is internal to TrueSky however, so it needs the plugin.

more ▼

answered Sep 19 '16 at 07:52 PM

avatar image

Answers.Archive STAFF
1.9k 206 313 684

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

There are a few methods for changing a sky light in game:

  • Call RecaptureSky on the SkyLightComponent from a blueprint. This will recapture the scene which will cause a hitch.

  • Use SetCubemapBlend to blend between two pre-captured cubemaps, this will not hitch.

  • Keep the cubemap constant and change the tint color

There's no path for a skylight to reference a UTextureRenderTargetCube at the moment, but that would not be too hard to add. You would still have to call RecaptureSky on the skylight to re-process the source cubemap (build mips) which would cause a hitch.

more ▼

answered Sep 19 '16 at 07:52 PM

avatar image

Answers.Archive STAFF
1.9k 206 313 684

avatar image Answers.Archive STAFF Sep 19 '16 at 07:52 PM

I've been able to modify SkyLightComponent to use either a Cubemap or a Render Target Cube. How do I submit a pull request for this? Also, using SetCubemapBlend, if skies are dynamic, seems to mean a hitch at the changeover. Is there any way to amortize the processing over the course of the blend? Or is there some way I can completely replace the FTexture* OutProcessedTexture and the FSHVectorRGB3 OutIrradianceEnvironmentMap, and do my own amortization?

avatar image Answers.Archive STAFF Sep 19 '16 at 07:52 PM

How do I submit a pull request for this?

I haven't done this before myself, but there seems to be some documentation here: https://help.github.com/articles/creating-a-pull-request/

Is there any way to amortize the processing over the course of the blend?

The hitch comes from blocking the CPU during readback from the GPU, so it can't be amortized. It can be changed to do the readback async, although that would require some refactoring of the code into two phases.

Or is there some way I can completely replace the FTexture* OutProcessedTexture and the FSHVectorRGB3 OutIrradianceEnvironmentMap, and do my own amortization?

Not out of the box, but you could write code to do it.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question