Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Fletch on June 20, 2013, 11:10:46 AM
-
I'm trying to make a skybox and a sun change over time.
I've got the sun going round my scene, which effectively simulates the sun rising and falling, but I'm looking for a little guidance for making the sun intensity and color change over time.
The next step is to get two light boxes, (day and night) to blend so that the sky becomes dark at night and light in the day. Profound, I know.
What is the basic outline of how this might be done?
-
Hi,
Have you searched on Unity forum? if you find a solution, share it here and I'll see that can be done with Playmaker.
bye,
Jean
-
Here's a solution I found.
The sun and brightness are pretty simple. I created a directional light and added a flare I rotate the sun around the game area with a Rotate Around action.
The brightness is controlled by the angle of the sun.
The skybox is the hard part.
I've found this tutorial and the linked code that blends two skyboxes together in a shader. Then he uses code to shift the blend between the two.
http://wiki.unity3d.com/index.php/SkyboxBlended
-
Any movement on this one?
-
Have you looked at the texture blend shader .. just blend the two skybox textures, I have setup a custom system for mine which changes the sky color based on a gradient .. but it's pretty advanced :P
http://wiki.unity3d.com/index.php?title=Blend_2_Textures
-
I too would like to see this happen! :o
-
Hi,
It's simple then:
use the action "Set Material Float" and set the "Named Float" to "_Blend" then adjust that value from 0 to 1.
Bye,
Jean
-
Hi,
It's simple then:
use the action "Set Material Float" and set the "Named Float" to "_Blend" then adjust that value from 0 to 1.
Bye,
Jean
There's a problem with this approach. Material stays changed inside game project when I exit play mode. Is there a way to avoid this?
-
Hi ,
i found solution.
First 0/1 type solution is to use "Send message" and add script to directlight for example:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class intencje : MonoBehaviour
{
public void intencjee(float ile){
RenderSettings.ambientIntensity =ile;
}
// Start is called before the first frame update
void Start()
{
//RenderSettings.ambientIntensity = 0.0f;
}
// Update is called once per frame
void Update()
{
}
}
But bettor one was to duplicate action : Float Interpolate , and update instead of "store result" -> RenderSettings.ambientIntensity =........ ( liner or EaseInOut). Photo and file in attachment.
Best Regards
strawberryblur