I've taken the proof of concept workflow I talked about last night and integrated it with both my rendering automation and the outfit display code in Lab Rats 2. I was able to generate a pattern for the normal tshirt, in this case to show off how it can be used to create text/graphics on an item. I also had the epiphany that as long as two pieces of clothing share the same topology, like shirts that all hug close to the skin, then patterns can be shared between them. I'll have to do a little more work to get that set up, but it should mean I can implement universal patterns like stripes or text and they ill only have to be rendered out once.
Internally the new pattern system is based on image masks. An image mask is used to transform another image by hiding, or "masking" part of the child image based on data in the mask image. For LR2 the alpha value (how transparent a pixel is) of the mask is used. In Daz Studio patterns are rendered in a similar way as full pieces of clothing, but the actual texture is masked so that only a section of it appears. In the examples above the text is the part of the mask that is left behind. This can be rendered at a much lower quality than the base image because all that is need is where it is opaque vs. transparent.
Inside of Ren'py there is some more interesting work done to take the mask and convert that into a piece of clothing with two different colour regions. First the base, greyscale clothing item is taken, then the mask is applied so that there is a cutout where the text would be. An inverse of the mask (opaque where the original is transparent, transparent where it is opaque) is then used and a copy of the item is added. When added together these two items are complements of each other and recreate the item, but can be coloured separately. The two items are composited together then handed to the rest of the outfit displaying code which handles it all as normal. Clothing can now have a pattern assigned to it along with a secondary colour that is used for the patterned area. A pattern can also be used to describe sections of different opacity, either higher or lower than the base clothing item.
Next I need to create a number of patterns and update the outfit design UI to allow the user to change them as they wish. This has also opened up a couple of other interesting possibilities, like using patterns to describe skirts of differing lengths, that I want to follow up with.
Chissy
2021-10-29 05:59:06 +0000 UTCNex201
2019-04-27 08:28:54 +0000 UTCJames Smith
2019-04-24 13:26:09 +0000 UTCTheMGA
2019-04-23 20:52:42 +0000 UTCJames Smith
2019-04-23 16:59:58 +0000 UTCJames Smith
2019-04-23 16:58:27 +0000 UTCTheMGA
2019-04-22 13:38:40 +0000 UTCwaffel
2019-04-22 02:15:09 +0000 UTCJames Smith
2019-04-22 02:06:51 +0000 UTCTextileMonster
2019-04-21 17:09:44 +0000 UTCThanny
2019-04-21 17:08:30 +0000 UTCDave
2019-04-21 12:29:47 +0000 UTCGhostly Hale
2019-04-21 11:26:03 +0000 UTCApollo
2019-04-21 10:43:47 +0000 UTC