Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8265195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:42:54+00:00 2026-06-08T04:42:54+00:00

I have some images that I want to put inside a bubble. The bubbles

  • 0

I have some images that I want to “put inside a bubble”. The bubbles kind of float around the screen with these images trapped inside them.

The best is a way to combine the inside image with the bubble image and somehow warp the inside image to look like it is reflected on the inside of the bubble.

Does anyone know how to achieve this effect without using textures and meshes? Perhaps someone remembers an old project or something that did something similar?

Here is an example of what I mean:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:42:55+00:00Added an answer on June 8, 2026 at 4:42 am

    You can do this using the GPUImageSphereRefractionFilter from my open source GPUImage framework:

    Spherical refraction example

    I describe in detail how this works in this answer to a question about a similar affect on Android. Basically, I use a fragment shader to refract the light that passes through an imaginary sphere, then I use that to do a lookup into a texture containing the source image. The background is blurred using a simple Gaussian blur.

    If you want to achieve the exact look of the image you show, you might need to tweak this fragment shader to add some grazing-angle color to the sphere, but this should get you fairly close.

    For the fun of it, I decided to try to more closely replicate the glass sphere above. I added grazing angle lighting and a specular lighting reflection on the sphere, as well as not inverting the refracted texture coordinates, leading to this result:

    Grazing angle lighting sphere

    I used the following fragment shader for this newer version:

     varying highp vec2 textureCoordinate;
    
     uniform sampler2D inputImageTexture;
    
     uniform highp vec2 center;
     uniform highp float radius;
     uniform highp float aspectRatio;
     uniform highp float refractiveIndex;
    // uniform vec3 lightPosition;
     const highp vec3 lightPosition = vec3(-0.5, 0.5, 1.0);
     const highp vec3 ambientLightPosition = vec3(0.0, 0.0, 1.0);
    
     void main()
     {
         highp vec2 textureCoordinateToUse = vec2(textureCoordinate.x, (textureCoordinate.y * aspectRatio + 0.5 - 0.5 * aspectRatio));
         highp float distanceFromCenter = distance(center, textureCoordinateToUse);
         lowp float checkForPresenceWithinSphere = step(distanceFromCenter, radius);
    
         distanceFromCenter = distanceFromCenter / radius;
    
         highp float normalizedDepth = radius * sqrt(1.0 - distanceFromCenter * distanceFromCenter);
         highp vec3 sphereNormal = normalize(vec3(textureCoordinateToUse - center, normalizedDepth));
    
         highp vec3 refractedVector = 2.0 * refract(vec3(0.0, 0.0, -1.0), sphereNormal, refractiveIndex);
         refractedVector.xy = -refractedVector.xy;
    
         highp vec3 finalSphereColor = texture2D(inputImageTexture, (refractedVector.xy + 1.0) * 0.5).rgb;
    
         // Grazing angle lighting
         highp float lightingIntensity = 2.5 * (1.0 - pow(clamp(dot(ambientLightPosition, sphereNormal), 0.0, 1.0), 0.25));
         finalSphereColor += lightingIntensity;
    
         // Specular lighting
         lightingIntensity  = clamp(dot(normalize(lightPosition), sphereNormal), 0.0, 1.0);
         lightingIntensity  = pow(lightingIntensity, 15.0);
         finalSphereColor += vec3(0.8, 0.8, 0.8) * lightingIntensity;
    
         gl_FragColor = vec4(finalSphereColor, 1.0) * checkForPresenceWithinSphere;
     }
    

    and this filter can be run using a GPUImageGlassSphereFilter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some images that I want to put on top of each other
I have some text/images that I only want to display in the normal state
I have an app that will show some images using UIImageView, now I want
I have a table with some images that I want to start out with
I have some images created with php and i want to put each of
I have some images that are wrapped within containers like this: <div id=swatchcontainer> <div
I have some images that need to change, based not only on hover, but
I have been working on a website that has some images that I need
I have a div with id=images. The div contains some images that are each
I have some static resources (images and HTML files) that will be localized. One

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.