Example #1
0
 void Update()
 {
     if (substance == null)
     {
         GetMat();
         Debug.LogWarning("No Graph");
         return;
     }
     time += Time.smoothDeltaTime;
     if (lava)
     {
         substance.SetInputFloat("flow_speed", flow);
     }
     substance.SetInputFloat("$time", time);
     substance.QueueForRender();
 }
Example #2
0
    public void generateNewCubemap()
    {
        //set the procedural material's properties if needed, before rendering
        inputMaterial.SetInputFloat("$randomseed", Random.Range(0.0f, 10000.0f));

        //have the procedural material render a new texture
        inputMaterial.QueueForRender();
        Substance.Game.Substance.RenderSubstancesAsync();

        /* render the cubemap
         *      This takes the input material and renders it to a cubemap of the specified size.
         *
         *      Remember, this is not increasing the resolution at which the procedural material is rendering the texture,
         *      that must be set in the procedural material itself. You will likely want the cubemap to be the same size
         *      or larger than the procedural material's size to retain all the quality.
         */
        cubemap = CubemapGeneratorHelper.instance.generateCubemap(inputMaterial, CubemapGenerator.Sizes._512);

        //set the skybox material to use the cubemap which was just rendered
        skyboxMaterial.SetTexture("_Tex", cubemap);
    }
Example #3
0
 private void Update()
 {
     if (!_right)
     {
         _value += Time.deltaTime / Velocity;
         if (_value > 1)
         {
             _right = true;
         }
     }
     else
     {
         _value -= Time.deltaTime / Velocity;
         if (_value < 0)
         {
             _right = false;
         }
     }
     WaterSubstance.SetInputFloat("disorder", _value);
     WaterSubstance.QueueForRender();
 }
Example #4
0
 private void OnLuminosityChanged(float value)
 {
     luminosityValueLabel.text = value.ToString("0.0");
     graph.SetInputFloat(luminosityParam.parameter, value);
 }