예제 #1
0
    /*****************************************************************************
    * GENERAL UPDATE FUNCTION
    *****************************************************************************/
    /// <summary>
    /// Updates both the transfer function UI and buffers over the transfer function texture to the shader.
    /// </summary>
    private void updateTransferFunction()
    {
        // Update the transfer function texture
        transferFunction.TransferTexture = transferFunction.generateTransferTexture();

        // Buffer over the new transfer texture to each of the materials
        volumeController.getCurrentVolume().updateMaterialPropTexture2DAll("_TransferFunctionTex", transferFunction.TransferTexture);

        // Generate the texture to display in the user interface
        //Color[] transferColors = new Color[transferFunction.IsovalueRange * 2];
        //transferFunction.generateTransferTextureColors(transferColors);

        //Texture2D colorTextureDisplay = new Texture2D(transferFunction.IsovalueRange, 2, TextureFormat.RGBA32, false);
        //      colorTextureDisplay.SetPixels(transferColors);
        //colorTextureDisplay.Apply();

        // Generate the texture to display in the user interface
        transferTextureDisplay.texture = transferFunction.generateDisplayTransferTexture();

        // Update the Vectrosity graph for the alpha panel
        alphaPanelHandler.updateAlphaLineRendererGraph();

        // Update the Vectrosity graph for the color panel
        colorPanelHandler.updateColorGraph();

        // Highlight the active point
        highlightActivePoint();
    }
예제 #2
0
 /// <summary>
 /// Steps slider update function.
 /// </summary>
 /// <param name="newVal"></param>
 public void updateStepsValue(float newVal)
 {
     volumeController.getCurrentVolume().updateMaterialPropFloatAll("_Steps", newVal);
     maxStepsValueText.text = newVal.ToString();
 }