Created
February 10, 2020 04:58
-
-
Save Frooxius/82d8487bf1b80a0bf2658ba7d55c2398 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using BaseX; | |
using CodeX; | |
namespace FrooxEngine | |
{ | |
[Category("Assets/Procedural Textures")] | |
public class UVTexture : ProceduralTexture | |
{ | |
protected override void PrepareAssetUpdateData() | |
{ | |
} | |
protected override void ClearTextureData() | |
{ | |
} | |
protected override void UpdateTextureData(Bitmap2D tex2D) | |
{ | |
for (int y = 0; y < tex2D.Size.y; y++) | |
for (int x = 0; x < tex2D.Size.x; x++) | |
tex2D.SetPixel(x, y, new color(x / (float)tex2D.Size.x, y / (float)tex2D.Size.y, 0)); | |
} | |
protected override void OnAttach() | |
{ | |
base.OnAttach(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment