Bubble effect

hi all

exist a way to create a bubble of soap in jme3?

Oh my… Still consulting, eh? :stuck_out_tongue:

never end nice framework

Hello!



The easiest way I can think of would be to have some emitter with a bubble as it’s graphic. The original 1.2 NiftyGUI had some convincing bubble textures you could use as a start. But honestly, if you need realistic soap bubbles that someone is going to pay a lot of attention to for accuracy, this is pretty far reaching out of the realm of gaming graphics. The IOR, reflection and refraction of the bubble is better suiting for snapshot raytracing. Your mileage will be far greater faking it :stuck_out_tongue:



EDIT: Though, a transparent texture and some funky shader to handle the weird color hue shifts that soap bubbles do would probably look pretty awesome on a sphere if you could pull it off. No idea how you’d go about it though, but it sounds feasible.



~FlaH

Wait… let me use my divine abilities to find out dilembos answer in advance…



touches his forehead



“Thanks tehflah! Could you post some code that shows how to do what you said?”



shivers, releases hands from forehead

3 Likes

Thanks tehflah! Could you post some code that shows how to do what you said?





ehehehe

hahaha

normen how did you do that?



lol

tehflah said:EDIT: Though, a transparent texture and some funky shader to handle the weird color hue shifts that soap bubbles do would probably look pretty awesome on a sphere if you could pull it off. No idea how you'd go about it though, but it sounds feasible.


How about changin the specular from one color to a rainbow gradient depending on the normals? :P Coming to think of it, the same is possible near the edges, perhaps one could change the alpha map depending on the normals ;)
baalgarnaal said:
How about changin the specular from one color to a rainbow gradient depending on the normals? :P Coming to think of it, the same is possible near the edges, perhaps one could change the alpha map depending on the normals ;)

No problem, just use the ColorRamp parameter in Lighting.j3md ;)

yeeeah no problem…ummm?

so how to create a bubble or a water drop in the middle of the screen

Are you trying to make a fool of yourself or of us? You have been presented about 4 good ideas here… What have you tried until now? Can you post some code please? :stuck_out_tongue:

like this?

http://www.google.it/imgres?imgurl=http://socialmediaphilippines.com/wp-content/blogimages/socialmedia_bubble-300x171.png&imgrefurl=http://socialmediaphilippines.com/the-bubble-effect-in-digital-marketing/&usg=__qpTjoju78FsAONDA0s5nP0vKt5A=&h=171&w=300&sz=81&hl=it&start=0&sig2=lw9aGTp7ulP6IOtVX4T1fg&zoom=1&tbnid=ErthfblbGOPTfM:&tbnh=89&tbnw=157&ei=ea2gTZ35MMmb8QPC3KGoAw&prev=/images%3Fq%3Dbubble%2Beffect%26um%3D1%26hl%3Dit%26sa%3DN%26biw%3D1280%26bih%3D663%26tbm%3Disch0%2C300&um=1&itbs=1&iact=rc&dur=272&oei=ea2gTZ35MMmb8QPC3KGoAw&page=1&ndsp=28&ved=1t:429,r:26,s:0&tx=141&ty=41&biw=1280&bih=663

Ok, you want to fool us… No, I mean code that you wrote while trying to solve your problem. Sitting on this thread and waiting for someone to post the code is not what I would do when I wanted to create a 3d bubble.

:troll:

[java]package it.game;

import com.jme3.app.SimpleApplication;

import com.jme3.asset.TextureKey;

import com.jme3.input.ChaseCamera;

import com.jme3.material.Material;

import com.jme3.math.ColorRGBA;

import com.jme3.math.Vector3f;

import com.jme3.post.FilterPostProcessor;

import com.jme3.post.filters.BloomFilter;

import com.jme3.scene.Geometry;

import com.jme3.scene.Node;

import com.jme3.scene.Spatial;

import com.jme3.scene.shape.Sphere;

import com.jme3.texture.Texture;

import com.jme3.util.SkyFactory;

import com.jme3.water.SimpleWaterProcessor;

/**

  • test
  • @author nehon

    */

    public class TestEnvironmentMapping extends SimpleApplication {

    SimpleWaterProcessor waterProcessor;

    public static void main(String[] args) {

    TestEnvironmentMapping app = new TestEnvironmentMapping();

    app.start();

    }

    @Override

    public void simpleInitApp() {

    //create processor

    createWaterProcessor();

    Sphere mesh = new Sphere(26, 16, 2);

    Geometry sphere = new Geometry("sphere", mesh);

    TextureKey key = new TextureKey("Textures/Sky/Bright/BrightSky.dds", true);

    key.setGenerateMips(true);

    key.setAsCube(true);

    final Texture tex = assetManager.loadTexture(key);

    flyCam.setEnabled(false);

    sphere.setMaterial(waterProcessor.getMaterial());

    ChaseCamera chaseCam = new ChaseCamera(cam, inputManager);

    chaseCam.setLookAtOffset(new Vector3f(0,0.5f,-1.0f));

    sphere.addControl(chaseCam);

    rootNode.attachChild(sphere);

    rootNode.attachChild(SkyFactory.createSky(assetManager, tex, false));

    FilterPostProcessor fpp = new FilterPostProcessor(assetManager);

    BloomFilter bf = new BloomFilter(BloomFilter.GlowMode.Objects);

    bf.setBloomIntensity(2.3f);

    bf.setExposurePower(0.6f);

    fpp.addFilter(bf);

    viewPort.addProcessor(fpp);

    }

    private void createWaterProcessor() {

    waterProcessor = new SimpleWaterProcessor(assetManager);

    waterProcessor.setReflectionScene(rootNode);

    waterProcessor.setWaterTransparency(100f);

    viewPort.addProcessor(waterProcessor);

    }

    }

    [/java]

    but it is not nice enough

Ok, if thats all you managed to do in this time I can tell you that you will probably not be able to do what you want unless you find the “rotateable-soap-bubble-engine” somewhere on the web.

Actually it looks kinda cool

normen said:
Ok, if thats all you managed to do in this time I can tell you that you will probably not be able to do what you want unless you find the "rotateable-soap-bubble-engine" somewhere on the web.

So, if I tie the threads on the forums together I guess he still needs to rotate a sphere in a strange way that must be possible using soap? I see the logic in that, hell yeah.

dont’t worry about rotate the sphere you gave me the solution i want.

I just want a bubble effect a s i show u in the previous url but it looks does not exist a way.

Normen don’t blame me my post please u r a good boy i know… :wink: