Yet another Primstar baker rewrite!

Domino Marama's picture

I've been hard at work today on rewriting the baker. As tends to happen when I add new features it promotes discussion and questions that lead to more feature ideas. This time a seed planted by Razz Welles when talking about joined meshes combined with fixing this bug has led to another redesign of the code underlying the Primstar sculptie baker.

This time I'm going for a pure edge baker. This is already partially implented in the git scripts, but there are a lot of benefits in redesigning it with edge rendering in mind. All the previous bakers have been based on triangle fills and the current git version just draws the edges of those triangles.

The code I've written so far builds a draw list of edges, it's seam aware and also knows how many faces on the UV map use each edge. This allows selective refinement of the bake process on oversized meshes. I'm going to write a line draw based on Bresenham's line algorithm that uses this information to fill the bake buffer. It'll be single use / seam aware and will use the values from those lines in preference to nearby face edges that happen to land on the same sculpt map pixel.

I've also allowed for calculating the bounding box for the bake just from the faces on a particular sculpt map. So with this new baker, it'll remove the 256 grid limitation on joined meshes.

I'm also changing the line draw for the bake buffer to work in 3D. It won't actually be converted to RGB for the .tga until the last moment. This should improve the accuracy of the baker on oversized meshes where multiple faces are on a single pixel on the map, though I suspect it won't be noticable.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <p> <pre>
  • Lines and paragraphs break automatically.
  • Project issue numbers (ex. [#12345]) turn into links automatically.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options