How to dynamically change the light direction of a planet material.
So recently i've been following a tutorial on how to make a planet material but i wanted to take it one step further and actually change the incoming light's direction dynamically, because now the only thing i can do is change it manually from the material instance menu as seen in the screenshot below.
What i originally thought of doing was to somehow change the vector colour automatically from inside the material with maybe a material function and somehow parametrize the speed at which the colour would change, however i didn't really figure out how I could do that (still learning ue4), I also thought that this might be possible through blueprints and/or a parameter collection + timeline.
This is the part in the master material that i'm trying to automatically change.
What i was trying to achieve was to actually make the light follow the sun (which I would add later) 's movement and light the earth accordingly instead of just staying static as seen in the picture. I'm guessing this would be better explained with a gif but i didn't know how to upload one. I'm sorry if i didn't explain very well what i'm after but this is the best way i found to explain it.
Thanks in advance to anyone that answers.
P.S. Sorry if this is in the wrong section of the forum i didn't know under which category this should be posted.
asked Aug 31 '17 at 06:36 PM in Using UE4
if the sun is object in the world, and planet moves around it, you can find direction by formula:
LightDirection = Normalize(PlanetLocation - SunLocation)
Now you need to pass this value to that material using DynamicMaterialInstance in blueprint.
answered Sep 01 '17 at 03:18 AM
can you share the other answer please?
answered Sep 04 '17 at 04:09 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here