Fake volumetric lights

Started by robert, October 11, 2012, 01:20:46 AM

Previous topic - Next topic

robert


EgonOlsen

Depends on what exactly you mean???

Thomas.

You can do it by transpatent plane  ;)

EgonOlsen


robert

#4
Something more like http://udn.epicgames.com/Three/rsrc/Three/VolumetricLightbeamTutorial/lightbeams.jpg

The lights on the car look more flat, I would like to use a conse instead of a plane, as explained here: http://udn.epicgames.com/Three/VolumetricLightbeamTutorial.html

But to be honest, I don't even know if that is what I'm really looking for.... I want to achieve something like this:




EgonOlsen

Something like a...missing image...?

K24A3

You could cheat and change the texture of the inside of that pumpkin, make the inside colors pure white so it appears lit up.

Additionally, you could separate the inside and outside of the 3D pumpkin object and setAdditionalLighting(200,200,200) to the inner Object3D. Or perhaps pop a small hardware Light in the center.

robert

Quote from: EgonOlsen on October 11, 2012, 11:16:49 AM
Something like a...missing image...?

I don't know what happened, the image was shown the first time I put it. Anyway, what I want to achieve is the lighting of the inside of a halloween pumpkin.

robert

#8
Quote from: K24A3 on October 11, 2012, 11:52:44 AM
You could cheat and change the texture of the inside of that pumpkin, make the inside colors pure white so it appears lit up.

Additionally, you could separate the inside and outside of the 3D pumpkin object and setAdditionalLighting(200,200,200) to the inner Object3D. Or perhaps pop a small hardware Light in the center.

I will try your first method, but I'm afraid I'll need two pumpkins because as far as I know, a texture can't be mapped to both sides of a mesh. The downside of this method is that I won't get a "glow" effect.

About the second method... what do you mean a hardware Light ? a light done with fragment shaders ?

K24A3

#9
You wont need two pumpkins, 3D modelling programs like blender allow you to select all the vertices and extend them inwards, effectively creating a complete 3D object with both inner and outer walls. Once that is done, apply a white part of the texture to the inner faces.

OpenGL hardware typically have 8 hardware lights you can use. Refer to the "Light" class in jPCT, set it's position to the center of the pumpkin to light it up. You could use shaders but it can be a steep learning curve if you are just starting to use OpenGL.

...Edit: Well actually yes you could use two pumpkins and invert the faces of the inner one and apply a bright texture to it, but you may run into visible artifacts or 'jaggies' at the edges of the objects if they are too close in 3D space.

robert

Quote from: K24A3 on October 11, 2012, 02:07:25 PM
You wont need two pumpkins, 3D modelling programs like blender allow you to select all the vertices and extend them inwards, effectively creating a complete 3D object with both inner and outer walls. Once that is done, apply a white part of the texture to the inner faces.

OpenGL hardware typically have 8 hardware lights you can use. Refer to the "Light" class in jPCT, set it's position to the center of the pumpkin to light it up.

I have been using Blender for years occassionally, but I'm far from being an expert :) How do you apply a texture to both sides of a mesh using the UV editor ? When you unwrap a mesh it is unwrapped on one side only  ???

K24A3

I must agree it was a battle learning even the basics of Blender.

jPCT doesn't support dual sided polygon textures (which is good in a way, keeps things simple) so you will need to solidify the object as mentioned. Rather than copy the outer texture co-ordinates to the inner faces, you would want to simply apply white to the inside to mimic the light volume. You do this by selecting all the inner faces and either apply a white material from the materials menu on the right, or hop into texture mode, load up your texture, select a portion of the texture that contains white, then wrap that portion to the polygons you have selected. It's not easy to do so I wont go into it in detail, but there are plenty of video guides on youtube that will get you started.

robert

Quote from: K24A3 on October 11, 2012, 02:24:53 PM
I must agree it was a battle learning even the basics of Blender.

jPCT doesn't support dual sided polygon textures (which is good in a way, keeps things simple) so you will need to solidify the object as mentioned. Rather than copy the outer texture co-ordinates to the inner faces, you would want to simply apply white to the inside to mimic the light volume. You do this by selecting all the inner faces and either apply a white material from the materials menu on the right, or hop into texture mode, load up your texture, select a portion of the texture that contains white, then wrap that portion to the polygons you have selected. It's not easy to do so I wont go into it in detail, but there are plenty of video guides on youtube that will get you started.

Thank you.

K24A3

No probs. If you want a glow effect as well you could experiment with a simple transparent plane centered near the front-center of the pumpkin with a 32bit (RGBA) texture that fades out from the middle. Beyond that you would need to use shaders, i.e. if you wanted a fancy glow extruding out of the pumpkin.

robert

Quote from: K24A3 on October 11, 2012, 03:20:20 PM
No probs. If you want a glow effect as well you could experiment with a simple transparent plane centered near the front-center of the pumpkin with a 32bit (RGBA) texture that fades out from the middle. Beyond that you would need to use shaders, i.e. if you wanted a fancy glow extruding out of the pumpkin.

Hey K24A3, better than using a plane, I think I'm going to use 2 textures, the base one and one for the glow. Then I'll turn up and down the opacity of the glow texture. I got the idea from here: http://www.purebasic.fr/english/viewtopic.php?f=16&t=46130

What do you think ?