Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Definitive Guide to Using Textures with Transparency (N64)
When creating an N64 model, you may realize that sometimes transparent textures don't exactly look correct. For instance around the edges of the texture you may be able to see the skybox like this.
[Image: links-awakening-64-preview-4.jpg]
(Credit to Link's Awakening 64 and Ty Anderson)

Or you may also find that you have a black outline or white outline around the texture. For a long time these issues weren't really thought about, however luckily CDi-Fails and I have found solutions to all of them, that could even possibly increase performance on console.

First you must prepare your model to render triangles with transparency after it renders triangles with opacity. The goal is to solve any issues where the skybox bleeds through the texture, and this can also drastically improve console performance.

This can be achieved in both SketchUp or Blender, however it is suggested that Blender is used for this, because it will be slightly easier to see if you did it correctly.

~ Blender Method ~

First create your model, and use CTRL+J to join all meshes in to a single object. Then select all vertices (in vertex mode) and do ALT+M, and then select "By Distance" if you are using Blender 2.8. If you are using 2.7x then select all vertices and Remove Doubles. Make sure the distance is greater than 0.00 or else triangles may get deleted. This will merge any disconnected vertices.
Now select all triangles that are transparent and will be rendered in FRONT of any other transparent textures. For example:
[Image: Capture.png]
Since these trees will always render in front of the trees behind it, I would select this. Then simply hit P and split the mesh by group. Then hide the group.

Now select the triangles behind, and split them and then hide the group until only opaque triangles are left. After that split any triangles such as water that will receive transparency in SharpOcarina.

Then begin splitting opaque triangles however you like, and hide those groups.

At this point I am only left with these faces.
[Image: 2.png]
Once you are to your final group that you want to split, still select all of the faces and then hit P to split the group, and hide it. At this point you should have what seems to be a blank viewport, however still hit the A key and then delete the invisible group. After that hit ALT+H and every transparent face should render nicely, like so. Notice the difference between how it looks now as opposed to the previous screenshot.

[Image: better.png]

Another thing you may notice is that there seem to be semi-transparent lines coming from the texture, I will touch on why this is later.

Now export your model as an OBJ and make sure to enable "Keep Vertex Order" in the export settings, or else none of the steps you just did will be reflected in the final OBJ file.

~ SketchUp Method ~

This method is not recommended for two reasons. One of which is that SketchUp generally won't render the triangles any different like they do in Blender, and it can be somewhat difficult to tell if the steps actually work. Another reason is that if you have overlapping transparent faces like in the previous example it is seemingly impossible to fix them like you can in Blender.

This method requires the Cleanup^3 SketchUp plugin, as well as TT_Lib^2. 

Once you have installed both of these plugins, explode all of your groups in your model. The next step is to select all faces, and select Geometry to Layer0 in Cleaup^3's settings. Then select all transparent faces and hide them. After that box select all of the opaque faces and make them in to a group. At this point you can further subdivide this group, however you can not with the single transparent group. After that you can export the model as usual.

~ Fixing the Textures ~

While it may seem like we're done here, there is unfortunately even more steps involved. You will also need Photoshop. While Photoshop CC is recommended, CS2 can be downloaded for free legally, and should do the job well enough. GIMP may also work, however I am unaware of how to do this efficiently in GIMP. 

You will also need to download the FlamingPear free plugins pack from this page, instructions on installing it are here as well. Only the Solidify plugin is needed.

Once you have Solidify installed, open your texture in Photoshop and duplicate the layer, and then place it behind the original texture. After that run the Solidify A filter. If done correcrly you will get an effect like this.

[Image: weird-texture.png]
Now simply select the solidifed later and set the opacity to 25% or below, as long as it is greater than 0. The purpose of this is to create a layer that the edge pixels of the image can blend with. This later will NOT be visible in game, as long as it is below 25% opacity. If the texture is grayscale then this step is unnecessary, or if it is 64x64, then a single color needs to be used for the blending layer instead of a solidified image.

Do these steps for each transparent texture in your model.

~ SharpOcarina Steps ~

Alright, one more step. Now in SharpOcarina simply find any groups that use a transparent texture, in your model, and set the opacity to 254, this will allow the edges of the transparent texture to nicely blur, like so.

[Image: betterlikeso.png]

......Finally! That's it! Now you can inject your map in game and test it out.

Forum Jump:

Users browsing this thread:
1 Guest(s)