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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

UVs on Sky Sphere

So, I'm editing a material attempting to render a moon texture. I've found the section of the material that controls the sun disc, and I'm attempting to replace that with a texture. My issue comes with the fact that the sky sphere uses spherical coordinates, so attempts to map a 0,0; 0,1; 1,0; 1,1 box to it (around its origin no less) are meeting with trouble. However, if I leave the UV node blank in the blueprint, the texture renders correctly, but oversized and on the wrong side of the skybox (in fact, both sides of the skybox). The node itself claims that the UVs are set to a constant 0 if not assigned, but this is clearly not the case. I believe I could render this perfectly if I could find out what these default UVs are, but nothing I seem to have access to allows me to find this.

Does anyone know how I could render a texture onto the sky sphere? I already tried using a billboard placed at effectively infinite depth, but the fact that the moon appears in front of the procedurally generated clouds just made it look incredibly odd.

Product Version: Not Selected
Tags:
more ▼

asked Aug 06 '14 at 08:45 PM in Rendering

avatar image

Hoeloe
388 41 46 60

avatar image Hoeloe Aug 06 '14 at 10:56 PM

Update! I have managed to get a single moon rendering at the right scale using the TexCoords input. However, I can't seem to position it over the light source. When I do, the image stretches obscenely. I suspect this is to do with the fact that the light source is on the origin of the sphere. It really is rather irritating.

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

2 answers: sort voted first

I figured this out! The idea was quite simple. First, I split the TexCoord object into x and y components. Then, treating each separately, I applied a multiplier (a high multiplier scales the texture down), followed by an addition (adding values translates the texture). After that, I combined the results together and clamped the value between 0 and 1. Feeding this vector in as the UV coordinates of a texture sample, I could replace the "Sun color" node with a texture, and it provided the result I wanted. It took a lot of fiddling to make sure it all worked. Part of the problem was that those operation have to be done in order. Previously, I was clamping before translating, which caused a lot of problems later. In that order, though, it should all work just fine.

more ▼

answered Aug 07 '14 at 12:11 AM

avatar image

Hoeloe
388 41 46 60

avatar image Hoeloe Sep 15 '14 at 10:01 PM

I should add to this that some of the more recent builds seem to have changed the UV mapping on the sky sphere, such that separating the hemispheres is no longer possible (thus, attempting to draw a planet in the sky will draw another on the opposite side). I fixed this by copying over the old sky sphere mesh, but it is something worth noting.

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

The skysphere is rendering a single material that is the accumulation of all the sky colouring, sun, clouds, cloud colour and your new texture

Are you adding the texture into the rest of the material that is being generated correctly?

more ▼

answered Aug 06 '14 at 09:56 PM

avatar image

SolarVelocity
596 31 77 51

avatar image Hoeloe Aug 06 '14 at 10:04 PM

Yes, of course. I'm getting a result rendering, it's just the positioning on the sky sphere that is a problem, hence my focus on the UV coordinates.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

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

Answers to this question