public GenerateToTexture ( int width, int height, TextureFormat fmt = TextureFormat.RGBAFloat, FilterMode filtering = FilterMode.Bilinear, bool mipmaps = true ) : |
||
width | int | |
height | int | |
fmt | TextureFormat | |
filtering | FilterMode | |
mipmaps | bool | |
Результат |
/// <summary> /// Updates the preview texture of the graph's noise. /// </summary> private void UpdatePreviewTex(RuntimeGraph graph) { //Make sure the Texture2D is up to date. if (graph._PreviewTex == null) { graph._PreviewTex = new Texture2D(graph._PreviewTexWidth, graph._PreviewTexHeight); } else if (graph._PreviewTex.width != graph._PreviewTexWidth || graph._PreviewTex.height != graph._PreviewTexHeight) { graph._PreviewTex.Resize(graph._PreviewTexWidth, graph._PreviewTexHeight); } graph.GenerateToTexture(graph._PreviewTex, true); }
/// <summary> /// Updates the preview texture of the graph's noise. /// </summary> private void UpdatePreviewTex(RuntimeGraph graph) { //Make sure the Texture2D is up to date. if (graph._PreviewTex == null) { graph._PreviewTex = new Texture2D(graph._PreviewTexWidth, graph._PreviewTexHeight); } else if (graph._PreviewTex.width != graph._PreviewTexWidth || graph._PreviewTex.height != graph._PreviewTexHeight) { graph._PreviewTex.Resize(graph._PreviewTexWidth, graph._PreviewTexHeight); } graph.UpdateAllParams(); //TODO: Maybe using the instance's private fields like this is the cause of some display bugs? graph.GenerateToTexture(graph._PreviewTex); }