Alright. I’ve done quite a lot of work to get a decal baking system working. I’m currently almost there using Texture2Ds and get/setpixels. However, this is only a usable solution for decal textures no bigger than 64x64. Otherwise the .Apply just destroys performance.
I’ve been doing some reading about RenderTextures and direct GL calls. I’m kind of confused as to how to pull it off.
Here’s my current test class that uses Texture2Ds: [link broken??]
Would anyone be able to point me in the right direction and possibly provide some example code for obtaining the same result but with all legwork done on the video card?
EDIT:
Ok, so I’m almost there. Except the calculation for the pixel cords that was used in the old way, can’t be used in the new way. The decals appear in the wrong places.
Here’s the updated code: [link broken??]
The code at the bottom of the update is the new way, the commented block above it is the old. As you can see I’ve copied the pixel coordinate calculations…which are incorrect. What is the proper way to be calculating this?