I created a jewel shaped object out of polygon shapes which is slightly transparent.

I'm trying to achieve some sort of glass effect that will distort images which are positioned behind the jewel.

Does anyone know how to achieve this in Illustrator?

I already tried the default glass and distortion effects but that didn't feed my needs..

Example: example

  • hello! welcome to GDSE :) it would be so easy and clear for us to give a solution if you can provide a sort of demo or image :D – Mr.Online Jun 28 '19 at 12:09
  • @DesignPhoenix Thanks :) Off course! I will edit the original question. – user10198470 Jun 28 '19 at 12:18
  • 3
    Nothing in illustrator is going to "distort the images which are positioned behind....". Nothing. You can certainly distort images, but the interaction of placing something on top and having the underlying object distorted is another matter. – Scott Jun 28 '19 at 13:17
  • I think you can only scale the image. You may use it making a clipping path using parts of the diamond. Scale and move each image inside each clipping path. – LeoNas Jun 28 '19 at 16:39
  • 1
    Illustrator is not the right application if you want to edit the pixels in in a photograph. You'll need a raster image editor like Photoshop or GIMP. To make distortions, you could look into using a displacement map. – Billy Kerr Jun 28 '19 at 20:41

You left out a tiny bit of detail in your question that would invalidate almost every conceivable answer you could get.

use that png on a webpage while keeping the refractive transparency effect?

No, its not possible to do a image that has such an effect on a webpage. At least not with a image alone. But you could do it with 1-x images, and some WebGL code. *

So now to your main question

Creating a transparent polygon window effect in Illustrator

You can do it, with a very restrictive set of can do it. Dont expect to be able to drop that image into a webpage and have it distort the background of your webpage. It only works on static images (see above), and the effect is not even going to be terribly live even in illustrator. Now for reasons apparent you would be better of doing this in Photoshop instead but even then Photoshop is not the right tool for the job either.

Given your later description however i feel that this is not within scope

* Some references can be found, Advanced Realtime Glass Refraction Simulation With WebGL, and some live examples of similar solutions can be found here

| improve this answer | |

How diamond affects:

Diamond is highly refractive material, it's effect is much more than partial transparency. The light bounces in a complex way inside the diamond until it happens to meet a surface near enough perpendicularly and gets out. Simulating it in 2D with distortions need an own version of the backdrop image and the environment on every face and the images on the faces are subdivided in a complex way.

Diamond - like many glass materials - is also dispersive i.e. R, G and B channels need different distortions. That's why a diamond can seem to sparkle in rainbow colors even in the white light.

To get a coarse impression of the needed richness I made the next 3D model:

enter image description here

A diamond levitates in front of a plate which has four bright colors.

The image above is not rendered photorealistically, but in the next image the diamond shape has got material =glass and I got something that at least resembles proper photorealistic rendering. I used an introductory version of Keyshot rendering program which uses ray tracing to generate the 2D scene.

enter image description here

The black and white come from the environment which is fixed in my elementary 3D program. There's snippets from all directions as you can see from a rotated image:

enter image description here

This is quite poor when compared to pro quality rendering software and it hasn't the rainbow color effect, but hopefully you got the idea that you need plenty of pieces of the background and the environment as a minimum. Milkiness is unnecessary as well as strokes

I say the job is hopeless in Illustrator as realistic effect, but for a plausible fake you can manually place colored pieces and carefully pick the colors from the backdrop image manually or with a programmed script. A stroke and the milky layer are useless, but an inner glow at the edges - one for the whole diamond or even one for each face can be good. See the added example at the end of this answer.

Your problem in the comment "How to make a diamond foreground which works right with every backdrop image for ex. in a web page"

That's theoretically possible only with complex software. There's no standard blending mode for it. You need code which takes pieces of the backdrop image, scales rotates and distorts them and places the pieces to the top layer just like a 3D model of a diamond would do in 3D when processed with ray tracing. PNG cannot contain the needed information, programmed code is a must.

That code can be a full 3D rendering engine. You input the 3D model. It contains the diamond and the needed background and the environment. The background can be a flat image, but it must be as 3D i e. it has size, placement and light. I guess proper building blocks are available for web programmers (I'm not one) as an insertable object. It would recalculate the scene if something changes.

Photoshop can distort changing images in a complex way and create the illusion of a diamond foreground. It's possible with smart filters. Distortions can be built to affect as smart filters. The result is recalculated if you change the backdrop image file. Do not expect you can insert Photoshop to your webpage.

Photoshop hasn't it, but a reverse displacement map would be useful - a transformation where one tells in pixel data from where from another image or layer the shown content of the pixel will be taken. It can exist as plugin or in other software, but that's not sure.

Not asked: Here's your image with a new very simple diamond. It has random snippets of your image as copied and pasted + stretched +rotated to populate the faces of your original diamond. The pieces are merged to one layer and inner glow layer effect was inserted to make the diamond edges better visible:

enter image description here

The closed top layer contained your diamond. I used it as reference to crop off the extras from the clipped snippets with the polygonal lasso. If you keep the snippets as separate layers, you can try inner glow separately for each face.

Unfortunately the center of your image couldn't be used.

| improve this answer | |
  • Thanks for your answer. So would it be possible to render the diamond using a 3d program, export it as a png and use that png on a webpage while keeping the refractive transparency effect? – user10198470 Jun 30 '19 at 7:09
  • 1
    A rendered PNG nor web browsers don't know how to take pieces from the backdrop and put them to the foreground to create an illusion of a diamond. You need a special program for it. There's no elementary way to do the job except to place a big diamond shaped piece of refractive glass hanging in front of the screen. See the augmented answer. – user287001 Jun 30 '19 at 9:08
  • @user287001 time for openGL shader work – joojaa Jun 30 '19 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.