hi all, i played a bit with the terain texturing and found that it could be really awesome to have this same tool but for standard 3d application meshes.
i dont know if its possible or if its already somewhere but it tried quite hard to find an older post or anything that could help me… i would like know if it is possible… i was looking to have the equivalent of the built-in terrain script, the one you can paint your textures on the vertex with a brush but for my 3dsmax mesh… i would like to cool down my texture library and use this tool to break my tiling… i guess it is a big request i bring on the table but since scripting is really not my strongest point, it would be highly appreciated to get some help of someone around here! i think it is something related to channels… like my base texture is channel 1 if i paint using channel 2 it become the priority of channel 1 but not channel 3 as an exemple…
thanks guys to let me know if it is doable or not at least!!
This is indeed doable. However, you need the pro version of unity. I think the reason was that you can only use render to texture in pro version or something.
No doubt someone will explain better within the next day, but this is your short and quick to the point way of looking at it.
You don’t need Pro for this. You can still write to textures in the Indie/Free version, the render to rendertexture feature in Pro is a whole different kettle of fish and is more for effects.
To change the pixels in a texture, see if it’s a Texture2D in a non-compressed format, then use GetPixels() to read the pixel data and SetPixels() to write it back. After it’s done, you need to write it out to a file using EncodeToPNG() since Unity doesn’t let you edit source assets in-engine though you can create new ones.
It’s very possible with Free, but it does take a lot of work to get from Possible to Working.
cool cool!! well firt step is a success for me its doable! thanks guys for you feedback! now i just have to work hard to make it! it would be also highly appreciated if you guys can continue posting your thoughs and maybe, if you have any good ideas on how to make it, let me know!
You should probably look at this as two separate tasks:
The easier task: Learning to use a custom shader in Unity which allows you to blend tiled textures together using a mix map. This is what happens with the terrain surface, and is sometimes called “splat mapping”.
You could make your mix map in some external painting program like photoshop.
The harder task: Learning to script Unity’s UI so that you can actually paint your mix map within the editor itself (like the terrain texture painting tools).
It depends whether you need to write an in-editor painting tool or not. If you just want to achieve the splat-mapping effect on your own 3d objects, I’d recommend just learning about using the custom shaders which allow you to do this, and generate your mix maps elsewhere.
If you really want or need to paint your mix maps inside the Unity IDE, you’ll have to learn about Unity’s editor scripting.
Start here:
And you may be interested to know, Unity’s own terrain engine, including its custom editing tools, are all written using Unity’s own scripting API - the same scripting that you have access to!
thank you for the info! i will go with the second eption even if its the ardest i see good potential in this tool and i also know that working with vertex colors in max to mix my textures is a bit of a pain… too much back and forth. i will try to see what i can do by my self but as said already i am a 3d artist/3d animator so dont be surprised if i post my script for help! but before it goes there, i have to learn how :shock: !!
having said that, if anyone need 3d assets/animations, im doing it for about 7years now in the gaming industry so i will be pleased to help you in exchange of this super script!! thanks