Author Topic: Gradients using Interpolate  (Read 5302 times)

February 25, 2017, 01:24:04 PM
Read 5302 times

k-drive

  • Jr. Member

  • Offline
  • ***

  • 30
I have a question about gradients using the Interpolate. I was recently creating a donut. I used the Interpolate method to create the highlights and shadows. I used the last part of the Inkscape.org tutorial to learn how to do this. I also played around a little bit, which is a good way to find out things.

I was wondering how many steps to use when making a gradient like this. It depends on the thickness of the lines and also the distance between the two lines. But, is there some guideline you use, or do you just start with a low number of steps and keep increasing the number until the fill looks right?

You can comment on the gradients on the donut image. I created one in a 3D program that has lighting to get an idea about the highlights and shadows.
I also looked at images of donuts online, and even took a photo while grocery shopping. (Research, right?)

I then created a single color donut in Inkscape filled with a brown color. I imported the image from the 3D program to use as a guide for the shapes that would be occupied by the gradients.
After creating the shapes, I broke apart and used the paths of the shapes to create the ends of the gradients.
(Is there a different way to do this?)
I used the brown color fill for the ends of my two gradients.
I used a lighter version of it for the one end of the highlight gradient, and a darker version of the brown for the shadow areas.
I only created the gradients for 1/2 a donut, and then copied/flipped it to make the other half.
I haven't worked on a shadow for the surface of what the donut is sitting on. So, right now it is just floating in space.

« Last Edit: February 25, 2017, 01:56:16 PM by k-drive »

February 25, 2017, 01:48:04 PM
Reply #1

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
It's a way to trick the renderer and the human eye.
If the distance is below 1 screen pixels, the fading will look smooth.
If you zoom in, you will see the solid filled area boundaries.
Same goes if you print it. Like, printing it in an A1 size you will see those details from a 25 cm/1 ft distance, but not from 2 m/6 ft.
Here is a silly example which can render as a conic gradient at certain zoom levels (at least that was the intention).

February 25, 2017, 04:15:11 PM
Reply #2

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Which tutorial are you talking about?  I don't think there are any guidelines.  It's just a matter of altering the widths of the path or the number of steps, until you find the kind of effect you want.

But seeing the tutorial will help me to know more about what you're doing.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 25, 2017, 05:08:47 PM
Reply #3

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Oh I see you edited your post.

Since the manual came out gradient meshes got implemented, which can be a good alternative in some cases.

Also, by filtering you can use diffuse lighting which has a few problems though. Low colour depth results in a vague 3D shape for the bump map (?) -the rendered result is composed of "lines" instead of a smooth transition. Same goes if you add a colormap filter atop.
Aand would need a gradient representing the height by shades -using a three step black-white-black gradient would generate two cones, not a circular torus. Also a road blocker, since linear transition is hard-wired between gradient steps (would need a gradient with alot of steps for the simulation.) Theoretically filtering should get you there easily.

February 25, 2017, 08:15:50 PM
Reply #4

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Here, made this with filtering and a good base gradient:




Well regardless the displacement filter primitive the blurring is still rendered with banding.

February 26, 2017, 12:12:53 PM
Reply #5

k-drive

  • Jr. Member

  • Offline
  • ***

  • 30
Brynn:

The tutorial is here. See the "Official Tutorials" list?

https://inkscape.org/en/learn/tutorials/

The one using paths is all the way on the bottom.


February 27, 2017, 02:30:08 AM
Reply #6

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Do you mean the Tips and Tricks tutorial?  I don't see anything about interpolation there.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 27, 2017, 06:36:31 AM
Reply #7

k-drive

  • Jr. Member

  • Offline
  • ***

  • 30
Here and here...

February 27, 2017, 08:39:49 AM
Reply #8

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Ooh geez, now I see it!

So you used a series of semi-circular paths?  And altering the color of each stroke going inwards, and then back outwards?

I used that technique several years ago, to make the shadow and lighting on a cone.  And then just recently, I used the new gradient mesh to do it.

I don't know if I'll be able to get these side by side.  But the first one (either on the left or the top) is the one I made with interpolate.  And the other (right or bottom) made with the new gradient mesh.

Well, I guess the coloring isn't exactly identical.  Maybe I'll try to make them more similar, so it's a better comparison.  And of course, the one made by interpolate had to be clipped, or else you'd see the jagged ends of the paths.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

February 27, 2017, 12:10:01 PM
Reply #9

k-drive

  • Jr. Member

  • Offline
  • ***

  • 30
Thanks for posting the cones.
Yes - I found that the interpolate is very good. But, the edges need adjustments/clipping.
I have played with the mesh tool a little bit. I have yet to figure it out. It looks very powerful.



February 27, 2017, 12:21:28 PM
Reply #10

k-drive

  • Jr. Member

  • Offline
  • ***

  • 30
Lazur:

Thanks for your posts.

I am not sure if you meant to include an image in your first one.

Your finished donut is very nice. I did locate that diffusion filter you mentioned.

February 27, 2017, 12:36:56 PM
Reply #11

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Thank's!

If you clicked the image above it brings you to its svg source. Usually I forget to mention clicking the images for their sources since got used to posting images in the filter topic with a notification at the start.

Also had made a pack of donut filters here which was improved a bit (original filter was scaled down, newer one is in its original scale).
Making another pack for a general diffuse lighting which would generate the bumpmap by blurring and not by the source's luminosity.

Some of the built in filters (combined lighting?) should do something similar as well but they are not keen on details.
« Last Edit: February 27, 2017, 04:31:35 PM by Lazur »

February 27, 2017, 03:45:19 PM
Reply #12

k-drive

  • Jr. Member

  • Offline
  • ***

  • 30
Ah! I see the link on the word "Here". Sorry 'bout that.
Thanks for all the links and information.

Wow...So much information...Thanks!
It is going to take some time to read all of this.


K

February 27, 2017, 04:35:20 PM
Reply #13

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
So here is the "donut pack", and the diffuse pack -they both use a similar chain but different values are set.
(The latter uses blurring to generate the bump map, while the original uses the object's luminosity values.)



https://openclipart.org/detail/274101/donut-pack




https://openclipart.org/detail/274135/diffuse-filter-pack


March 09, 2017, 01:44:29 PM
Reply #14

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
If you are still interested, made a few more here.