Search Unity

3D/2D Texture Generator

Discussion in 'General Graphics' started by themdubs, Jul 29, 2018.

  1. themdubs

    themdubs

    Joined:
    Jan 12, 2014
    Posts:
    26
    3D Textures are wonderful and allow for simply lifelike procedural generation, however as there is no true file format for 3D images I found that these textures are hard to come by. I decided to create a generator that allows you to save custom 3D (and 2D) textures defined by a compute shader. For example here is a 3D noise texture that I created for a volumetric cloud skybox.



    The system I created will capture the RWTexture from a compute shader kernel of choice and then save the output to a .asset file which will be stored in your project. If you're interested you can find the project on my Github.

    Currently the project is based on monobehaviour however I would like to transition it to a functionality similar to Render Textures. If you have any suggestions or comments feel free to reply to this thread or submit them as an issue on Github!
     
    shegway likes this.
  2. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    703
    You should totally look into custom render textures : https://docs.unity3d.com/Manual/CustomRenderTextures.html
    Instead of capturing a RWTexture from a compute shader and store it in a .asset, simply assign a material with the shader you want that can use uv.xyz to output a color in a 3D texture :)
     
    shegway and richardkettlewell like this.