shader-bake-unity

所属分类:图形图像处理
开发工具:ShaderLab
文件大小:807KB
下载次数:0
上传日期:2019-08-07 05:01:03
上 传 者sh-1993
说明:  在Unity中将运行时着色器烘焙到纹理中
(Baking run-time shaders into textures in Unity)

文件列表:
Assets (0, 2019-08-07)
Assets\Materials.meta (172, 2019-08-07)
Assets\Materials (0, 2019-08-07)
Assets\Materials\Dilate.mat (2084, 2019-08-07)
Assets\Materials\Dilate.mat.meta (188, 2019-08-07)
Assets\Materials\FractalNoise.mat (2038, 2019-08-07)
Assets\Materials\FractalNoise.mat.meta (188, 2019-08-07)
Assets\Materials\FractalNoiseUnwrap.mat (2037, 2019-08-07)
Assets\Materials\FractalNoiseUnwrap.mat.meta (188, 2019-08-07)
Assets\Materials\UnlitTextureMat.mat (2097, 2019-08-07)
Assets\Materials\UnlitTextureMat.mat.meta (188, 2019-08-07)
Assets\Models.meta (172, 2019-08-07)
Assets\Models (0, 2019-08-07)
Assets\Models\tree1.fbx (198313, 2019-08-07)
Assets\Models\tree1.fbx.meta (2324, 2019-08-07)
Assets\Scenes.meta (172, 2019-08-07)
Assets\Scenes (0, 2019-08-07)
Assets\Scenes\ShaderBake.unity (13270, 2019-08-07)
Assets\Scenes\ShaderBake.unity.meta (155, 2019-08-07)
Assets\Scripts.meta (172, 2019-08-07)
Assets\Scripts (0, 2019-08-07)
Assets\Scripts\ShaderBaker.cs (1991, 2019-08-07)
Assets\Scripts\ShaderBaker.cs.meta (243, 2019-08-07)
Assets\Shaders.meta (172, 2019-08-07)
Assets\Shaders (0, 2019-08-07)
Assets\Shaders\Dilate.shader.shader (2356, 2019-08-07)
Assets\Shaders\Dilate.shader.shader.meta (204, 2019-08-07)
Assets\Shaders\FractalNoise.shader (1394, 2019-08-07)
Assets\Shaders\FractalNoise.shader.meta (204, 2019-08-07)
Assets\Shaders\FractalNoiseUnwrap.shader (1515, 2019-08-07)
Assets\Shaders\FractalNoiseUnwrap.shader.meta (204, 2019-08-07)
Assets\Shaders\fbm.cginc (710, 2019-08-07)
Assets\Shaders\fbm.cginc.meta (204, 2019-08-07)
Assets\Textures.meta (172, 2019-08-07)
Assets\Textures (0, 2019-08-07)
Assets\Textures\ObjectToBake.png (712650, 2019-08-07)
Assets\Textures\ObjectToBake.png.meta (1982, 2019-08-07)
Packages (0, 2019-08-07)
... ...

# Shader Baking in Unity Bake a pretty - or computationally challenging - shader into a texture in Unity. Check out this medium article for a more detailed explanation of the technique, and other related projects here. ## Description Texture baking is very common technique in computer graphics to transfer the details of your shader into a texture. This is useful if you're shader is computationally heavy, but produces a static result ( complex noises ). Many modeling applications have this functionality down. If you have a pipeline of transferring assets from Blender/Houdini/Maya, then you may want to do the texture baking there. However, if you primarily work out of Unity, this repo is for you. With this technique, you can effectively save a custom shader's results that were manipulated in real-time, and use the generated texture in any another application with a default shader ( Sketchfab? etc. ) . ## Usage Open the Shader Baker scene in the Unity project, and press play. Press the 'M' Key to bake the current shader values into a texture. Pointers if you want to dig in and use this for your own projects: `Shaders/FractalNoiseUnwrap.shader` - this shader is a duplicate of the one you want to bake, except with the vertex shader modified to render the vertices in UV space. `Shaders/Dilate.shader` - this shader is responsible for the dilation post processing of the output texture. `Scripts/ShaderBaker.cs` - attach this script to the camera, it is responsible for rendering the mesh to a texture. It has public fields where you should place the object you want to bake, a material with the unwrapped version of the shader you want to bake (`FractalNoiseUnwrap.shader` in this case), and a material with the dilate shader (`Dilate.shader`). You should also set the `backgroundColor` property to be a color that is distinct from the colors in your shader.

近期下载者

相关文件


收藏者