Skip to content

Instantly share code, notes, and snippets.

@Frooxius
Created February 10, 2020 04:58
Show Gist options
  • Save Frooxius/82d8487bf1b80a0bf2658ba7d55c2398 to your computer and use it in GitHub Desktop.
Save Frooxius/82d8487bf1b80a0bf2658ba7d55c2398 to your computer and use it in GitHub Desktop.
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