Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / 3D Glass Bottle Of Potion

Author
Message
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 2nd Apr 2014 20:51
How would you create a 3D shader for a glass bottle of liquid? I need to see the liquid inside the bottle, and I need to animate bubbles in the liquid, and I need to have a glass shader on top of it.

http://moviewriternyu.wordpress.com/2013/02/13/very-rare-vial-of-love-potion-8-turns-up-on-ebay-bids-approach-1m/
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 2nd Apr 2014 22:30
I don't think you'd really need a shader for that, just ghost the bottle and turn up the specular. Sphere mapping might look nice too.

Not sure about the bubbles. You could create a video file for that, paste it to a plain and set that to the camera orientation, but that really depends on what you're going to use it for.
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 2nd Apr 2014 22:49
OK Thanks!
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 4th Apr 2014 20:05
It's coming along. I would like to hear ideas about liquids moving through Chemistry tubes. Glowing liquids. If a liquid has to turn a bend, how would you do that?

http://coolinsights.blogspot.co.uk/2013/08/why-good-entrepreneurs-are-like.html
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 4th Apr 2014 21:02
I guess you'd have to use physics for that.
tiffer
20
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Scotland
Posted: 4th Apr 2014 21:33
Quote: "I guess you'd have to use physics for that. "

Probably more to it than that.
I imagine realistic liquids would be pretty tricky. I think the best option would be using lots of small decals flowing through the tube.
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 4th Apr 2014 21:35
It doesn't have to have too many liquid dynamics. Just a colour that can turn corners inside 3D tubes would be a good start.
StevetS
22
Years of Service
User Offline
Joined: 19th May 2004
Location:
Posted: 5th Apr 2014 02:24
If the bottle is small and part of a wider scene, or there are lots of them I'd consider using a transparent glass bottle model with a smaller transparent cylinder inside it. Apply a transparent texture with small bubbles on it to the cylinder and slowly scroll the texture vertically to imitate them rising.

If the glass bottle is a main feature and you've not got too many of them on your screen you could simply generate randomly sized spheres (within a certain range) and have them rising in the bottle at a speed relative to their size.

I'm guessing here you're looking at something like Pipemania?

[img]http://forum.thegamecreators.com/?m=forum_view&t=181020&b=5
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 5th Apr 2014 03:20 Edited at: 5th Apr 2014 03:23
I've never seen Pipemania. Yes I was thinking of moving bubble models. I don't know how many layers of transparency I can have. I have an idea how I might move the liquid in the tubes. I might try drawing the liquid on a bitmap with transparent pipes over the bitmap, and keep the camera still. If I draw lines, and join them by the locations of limbs in the tubes it might look good, and have a sprite pasted for an animated flow effect. But I don't know if I can draw on a bitmap in 3D? I have just finished my first bottle model. I have to also have a gold effect on the potion bottle frills. I also need some sort of glow effect in the liquids.

EDIT: Yes similar to Pipemania, but 3D models with a stationary camera. The potion bottles also spin around.
StevetS
22
Years of Service
User Offline
Joined: 19th May 2004
Location:
Posted: 5th Apr 2014 11:05
I'd use a smaller tube object inside the transparent pipe and stretch it to simulate the moving liquid. You can texture the tube to give the liquid colour you want and could even use different colours for different liquids if you're after puzzles that use or mix liquids.

Moving the liquid around bends - not sure how you'd do that. I'd probably take the easy way out and have them solid so you cant see it moving round corners.

I've just yesterday downloaded ImageKit which allows you to draw directly onto bitmaps at a pixel level. Search for it in the Wips. Its very good.

[img]http://forum.thegamecreators.com/?m=forum_view&t=181020&b=5
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 5th Apr 2014 11:49 Edited at: 5th Apr 2014 11:52
Yes I could draw on a texture, and to bend it just draw around bends on the bitmap. If I draw it manually with the mouse, and store the mouse movements it should work. Maybe I will make a mini Photoshop with sprites, and store the sprites pasted as well.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 5th Apr 2014 14:44
I think that ideally, you'd want the liquid to be a pixel wide texture, and say 256 high. Then, you'd UV map a copy of your pipe so that the liquid texture fills it up, from top to bottom. With that, you could have 2 models as people are suggesting, then draw the liquid texture with a memblock, imagekit, or whatever, and it'll let you fill the pipe with liquid, have liquid moving through it etc. So really, the liquid would be an object that is the same shape as the pipe, but with a special texture that you update each frame. If the pipe only has to fill up, then you might get away with just scrolling the liquid texture, like a texture that is half liquid and half transparent.

I am the one who knocks...
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 5th Apr 2014 14:52 Edited at: 5th Apr 2014 15:01
I thought make the texture as big as the screen 1024*768, and draw it to scale on the texture map 1024*1024. Then I can have realistic flowing sprites around the bends flowing around curves, and bending to the right shape with lighting on the liquid. If I make a special brush that rotates with the pipes it makes drawing it easier. I could have bubbles too. That's a lot of work though.

A single colour is probably a good way to have an early version of the game.
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 5th Apr 2014 15:07 Edited at: 5th Apr 2014 15:08
Here's my potion bottle in a 3D modelling Package. I'm adding a Normal Map, metal effect, and bubbles in DBPro.

Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 5th Apr 2014 19:29 Edited at: 5th Apr 2014 19:54
In DBPro I have this so far...



The shading is a bit flat coloured. I tried a few shaders, and they come out way too dark.
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 5th Apr 2014 20:17 Edited at: 5th Apr 2014 20:17
I can light the lid up too...

StevetS
22
Years of Service
User Offline
Joined: 19th May 2004
Location:
Posted: 5th Apr 2014 23:44
That looks really good. Nice model and textures. I was thinking more of a science class style vial rather than an arabian style, but good going.

[img]http://forum.thegamecreators.com/?m=forum_view&t=181020&b=5
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 6th Apr 2014 03:47 Edited at: 6th Apr 2014 03:55
Thanks! The lid ripples when the bottle turns, that looks quite realistic. The bottles are for magic potions, that's why it looks a bit Arabic. I've found a shader that isn't so flat shaded. So the gold has more colours in it.
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 14th Apr 2014 01:43
This is a video of my flowing liquid effect. Not perfect, but not too bad either. The video is attached.
tiffer
20
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Scotland
Posted: 14th Apr 2014 17:47
Very interesting effect. How did you do it in the end? It lookslike 3d objects.
Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 14th Apr 2014 18:13
I cheated, I used the z depth to delete the tubes out of the way, and some shaders.
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 16th Apr 2014 15:24 Edited at: 16th Apr 2014 15:25
It looks great. It is interesting how everyone has their own way of achieving things.

I think this is similar to what you did, besides disabling Z Depth, I would have modeled the scene and use a shader to clip all the liquid limb pixels above an animated Y coordinate; throw in a little linear interpolation here and some particle effects there, and Bob's your uncle. Many ways to skin a cat.

You can post you tube videos using: [ youtube]VideoID[/ youtube]

Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 16th Apr 2014 16:14
It all fits to this thing...


Barry Pythagoras
12
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 20th Apr 2014 17:15
It's coming along now...

Login to post a reply

Server time is: 2026-07-07 08:42:26
Your offset time is: 2026-07-07 08:42:26