void Render(VoxelTexture colorTex, VoxelCameraDirection.DirectionEnum cameraDirectionMode) { Shader.SetGlobalVector(shaderConstants.PROP_VOXEL_SIZE, colorTex.ResolutionVector); cameraDirection.Direction = cameraDirectionMode; Shader.SetGlobalMatrix(shaderConstants.PROP_VOXEL_ROTATION_MAT, cameraDirection.VoxelDirection); var targetTex = RenderTexture.GetTemporary(colorTex.CurrentResolution, colorTex.CurrentResolution); try { Graphics.SetRandomWriteTarget(1, colorTex.Texture); renderCam.RenderWithShader(targetTex, voxelizer, null); Graphics.ClearRandomWriteTargets(); } finally { RenderTexture.ReleaseTemporary(targetTex); } }
public VoxelTexture this[VoxelCameraDirection.DirectionEnum dir] { get { return(colorTextures[(int)dir]); } }