Jump to content
How to Install Plugins ×

Texture Object Rounder


MJW

Recommended Posts

cryptic.... Haha! A brand new plugin. Looks terrific!

 

Thank you MJW!

Link to comment
Share on other sites

The example should make it clearer.

 

As additional explanation, I added: "For the most common case of an object that's symmetric about the vertical axis, it produces a height map for the object of rotation. For example, it will convert a filled circle to a spherical height map, and a filled rectangle to a cylindrical height map."

Link to comment
Share on other sites

Great plugin @MJW!    :star:     Of course, I had to try it on a shape that wasn't recommended.  I see what you mean. Even though the butterfly is symmetrical, it doesn't handle it well around the body.

 

textureobjectrounder_01.png

 

I tried next on a recommended shape and the result is fantastic!  I smoothed the height map and applied an image with Texture Shader.

 

textureobjectrounder_02.png

 

 

There is so much potential here, I am speechless.....

 

Thank you!    <3

  • Like 2
Link to comment
Share on other sites

3 hours ago, Ishi said:

This is amazing. I think you can do a 3D-ish chess piece on this and many more! If you could combine shapes that it supports.

 

Thank you! The Texture Merger should help in combining shapes. The usual method is to use the Maximum merge mode. Make sure to set the Merged Height Alpha Source to Composite Alpha, so both height maps are visible.

Link to comment
Share on other sites

  • 11 months later...
  • 11 months later...
1 hour ago, welshblue said:

Just curious if there's a reason in the T O R end or in S3D as it's no big deal running AA Assistant

 

That's weird. It doesn't do that for me. My best guess is that the background is almost but not entirely transparent after the shape is drawn (like the alpha is 1), and that AA's Assistant clears it. if you have Red ochre's Alpha Threshold, try using that instead of AA's Assistant, and see if that fixes the problem. If it does, the question is still, why isn't the background fully transparent? If it doesn't fix it, I'll have to look into it some more.

 

EDIT: More likely, the shape isn't entirely opaque. Perhaps for some reason the original image on which Shape3D is run is nearly, but not completely, opaque.

 

EDIT 2: Perhaps Shape3D's Transparency control is checked. I tried to tell in the video, but couldn't.

  • Like 1
Link to comment
Share on other sites

One thing that might be worth trying is to get one of the times Object Rounder doesn't work, then use the Color Picker to check the opacity of the background, and the center of the object, to see if the background pixels are entirely transparent, and the object contains completely opaque pixels.

Link to comment
Share on other sites

I finally got it to fail, and now I think I know why. When it didn't work, the alpha of the most opaque object pixels produced by Shape3D was 254. It happened after I increased Shape3D's AA to the maximum of 5. I don't know, though, that that was the cause or just a coincidence.

 

EDIT: I seems to be related to Shape3D's antialiasing. If I turn it off, or set the level to 1, the alphas are 255. If I set it to 2 or greater, the alphas are 254.

 

I should add that the Object Rounder always looks for completely opaque pixels to help determine the  starting edge of the object on each row of pixels. This has to do with its (not especially successful) attempt to determine the start and end of the edge to better-than-pixel precision.

Link to comment
Share on other sites

@Ego Eram Reputo was able to restore the xml feature. Perhaps he could fix the AA bug. I think I can take a pretty good guess about the basic cause. Shape3D uses the usual supersampling AA method, which requires summing the alphas, then dividing by the number of per-pixel samples. I expect that the division (which may be integer division) truncates or rounds down incorrectly.

 

One integer-division method that works properly is to double the alpha sum (by left shifting), add the number of per-pixel samples, then divide by twice the number of per-pixel samples. That amounts to adding 0.5, to round in the usual fashion.

                // Compute the (rounded) averages.
                int twiceA = a << 1;
                b = ((b << 1) + a) / twiceA;
                g = ((g << 1) + a) / twiceA;
                r = ((r << 1) + a) / twiceA;
                a = (twiceA + ssSamples) / ssTwiceSamples;
                return ColorBgra.FromBgra((byte)b, (byte)g, (byte)r, (byte)a); 

If Shape3D uses floating-point, the fix is probably just to add 0.5 before converting back to integers.

 

(I added the technical details for Ego Eram Reputo, though he most likely already knows them as well as I do.)

  • Like 1
Link to comment
Share on other sites

15 hours ago, MJW said:

I added the technical details for Ego Eram Reputo, though he most likely already knows them as well as I do)

 

I'm more of an elderly script-kiddie, so I like it when you do half my job for me :)

 

15 hours ago, welshblue said:

Lines and lines of text and numbers to make something you can physically use ?  Witchcraft

 

Some of my code requires actual living sacrifice - so witchcraft is not far off the mark ;)

 

(In an RPG I'm developing, I'm allowing the cost of magic (Mana) to be deducted from Hit Points or added as a number of months to the characters age. Coding seems similar in many respects)

Link to comment
Share on other sites

  • 8 months later...

I just got this plugin and I'm trying to make this shape have a metal gleam to it, even gold. And for some reason the top and bottom of the object is cut off from the rounding effect.

 

Is there anyone who knows why it does this? Whether it can be avoided? Or fixed?

textureRounder.png

ketenksEsignatureSmall2.png.f74cf40145e3a072030b070615ef1b93.png

Link to comment
Share on other sites

After messing with it, it appears to be a result of how it is coded up. The top part is being recognized as the top of a sphere and the bottom the bottom of a cone. And it wants to draw that in, but then the image changes from that and it starts drawing reflections for the rest of it as it should be.

 

I'm not sure if this can be fixed except by the one who wrote the plugin.

 

Edit: yeah even having it recognize half it still wants to see that part as a circle and cone for some reason.

textureRounder2.png

Edited by Ketenks

ketenksEsignatureSmall2.png.f74cf40145e3a072030b070615ef1b93.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...