Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Author Topic: Creating Sphere Mesh as a Flashing Landing Light on a Model - Question  (Read 8590 times)

Bman

  • Newbie
  • *
  • Posts: 7
    • View Profile

Hello, I'll state my project and steps first, then follow up with my three questions.  I'm working on a simple round sphere mesh that I want to export in .3ds or .obj format to serve as the blinking landing lights for an existing model for a 3rd party game.   Steps I've done....

1) I've created a 256x256 image in GIMP.  Background layer is pure black [0,0,0]. The top transparent layer is black too but includes a simple round white [255,255,255] circle with a slight Gaussian blur to make the edges of the circle fade away.  So basically it looks like a realistic flashlight in the dark.  I merged the layers and designated the pure black color to alpha to make it transparent and saved as a "Lights.png" image file.

2) In Anim8or... I made my sphere mesh and from the front view, I selected all front and rear faces to apply the "Lights.png" texture... I think from in Diffuse bucket.
I'm not clear on the best way of using the Materials/texture editor for this example... reading tutorials, but I clicked the UV tool to map the image onto the mesh.

3) Saved, exported to .obj format and then converted into another format.

4) In the rendered game environment, the sphere mesh implodes into nothing and then expands back out to it's normal size in constant one second intervals (transformations of 0; 0; 0) which gives it a nice blinking effect.

Here's my question/problem:  The texture map fades to transparency in the middle/side sections of the sphere since the texture map is stretched across the front half and rear half of the sphere.  What is the best way/tips to give an illusion so that you would see the same light texture from any 360 degree angle?
The second problem is any light source from within the game environment, say a star, sun, planet, or nebulae from an above angle, will cause a shadow to form on the bottom half of the sphere mesh darkening part of the "light" texture.

The current solution I have right now is a pure white illuminated sphere (all faces) without the alpha channel but it defeats the purpose and looks cheesy.  Would it be better to texture the sphere pure black (transparent) on the outside face normals of the sphere, and then map the Lights.png file to inside face normals of the sphere?  And then again, how would I get this to look like a realistic flashing light from any 360 degree angle?  I thought about putting multiple square planes inside the sphere each with same texture map, but the face normals flip geometrically as you move around the sphere.   ::)

Thanks for reading and any advice is appreciated.
Edit: Posted screen shots below to help explain.........
« Last Edit: September 25, 2018, 08:49:11 pm by Bman »
Logged

selden

  • Full Member
  • ***
  • Posts: 221
    • View Profile
    • Modelling for Celestia
Re: Creating Sphere Mesh as a Flashing Landing Light on a Model - Question
« Reply #1 on: September 25, 2018, 09:23:45 am »

(Some of my comments below reiterate some of what you've written, although perhaps in a slightly different context.)

Some game engines provide an explicit "glow" or "emissive" specification in their object definition language which causes shadows not to be cast on an object and/or lets it act as a light source. You might look into that possibility. Some support it as an option in an object's mesh specification. Anim8or's Material editor includes this option, for example, which might or might not be supported by the format that you're using to export the mesh. You should try that if you haven't already.

WRT your first problem:

Anim8or's UV tool provides several surface texture image mapping projections, but they're sort of "hidden". You're seeing the results of the tool's default "Planar Projection"

To get a popup menu of the UV tool's projection options, use the Left Mouse Button to select (double-click-on) the object that you're working with. You'll then get a popup menu which allows you to select one of four different projections. I think you'll get better results with "Spherical projection".  See the screengrab below.

WRT your second problem:

How an object's surface reacts to an external light source (e.g. blackening one side of an object) depends on the 3D rendering engine used in the game software. You might have to provide multiple light sources or change the overall illumination level to get your object to be colored the way you want.

The translation of "black" to "transparent" that you mention might be an example of an engine-specific rendering option. Some rendering engines provide several different ways to apply an opacity image. Some examples are to use it as the opacity channel in a surface texture image, as a material's over-all opacity value, or as an explicit value in the game engine's object definition language.

I know of two different ways that Anim8or itself supports to make an object all or partially transparent. One is to provide an appropriate image in the Alpha (Opacity) channel of a PNG surface texture as mentioned above.  Another is to explicitly set the value of the "Trans" value of a Material using Anim8or's Material editor. This latter might or might not be supported in the exported mesh format or by the game's rendering engine.

FWIW, there also are 3rd party UV editors, although I have no experience with them.
Logged
Selden

Bman

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Creating Sphere Mesh as a Flashing Landing Light on a Model - Question
« Reply #2 on: September 25, 2018, 09:05:34 pm »

Thanks Selden for the instructions.  I'll give it a try.  I"ve posted some screenshots above so it will make more sense.  In the above pics, there's the whole sphere where texture map is mapped to just the front and the back of the sphere.  Lower pics, I cut the sphere in half and rotated the x,y,z coordinates to experiment.  Just a plain white light instead of the white and blue.  I like how it shows, it's just getting that same look all the way around, but I need to delete the texture on back side.

Here's another crude way of explaining it.  Suppose the light source is the "pupil" of the eyeball.  Idea is to be able to see the pupil straight on from any 360 degree angle of the sphere.  Kind of like how you look at the tiny pupil of the eyes of a praying mantis and the illusion is that it's pupils always seem like they follow you from any direction. Lol.  The game engine... pretty old, so it can't take advantage of ambience, emissions, diffuse, bump & envir. texture maps unfortunately, but it does handle basic lighting from .bmp/.png encapsulated in .dat files, not from meshes themselves.  It does handle transparency and illumination pretty well though.  Models (meshes) are in an old .opt file proprietary format.   Thanks.
« Last Edit: September 25, 2018, 09:11:09 pm by Bman »
Logged

ENSONIQ5

  • Hero Member
  • *****
  • Posts: 1012
    • View Profile
    • Mission Backup Earth
Re: Creating Sphere Mesh as a Flashing Landing Light on a Model - Question
« Reply #3 on: September 26, 2018, 03:02:14 am »

I don't know the capabilities of the game engine, but the only way I can think of doing this would be to set the sphere to 'point at' the camera.  So as the sphere moves relative to the camera, it rotates to always keep the 'pupil' pointed towards the camera.
Logged

selden

  • Full Member
  • ***
  • Posts: 221
    • View Profile
    • Modelling for Celestia
Re: Creating Sphere Mesh as a Flashing Landing Light on a Model - Question
« Reply #4 on: September 26, 2018, 07:21:31 am »

Does the game engine support Sprites?

Having the same side of an object visible at all times often is implemented using a "Sprite". Originally such objects were drawn in 2D on the screen, overlaid on the image of the game space. (That's how games like PacMan were implemented.) 3D sprite objects have been available for quite some time. They always stay face-on to the viewpoint but otherwise are much like other 3D objects.

Logged
Selden

Trevor

  • Full Member
  • ***
  • Posts: 220
  • Goldfinger64 Dev OS:10 CPU:5960x Gfx:RX480
    • View Profile
    • LS Tech Services
Re: Creating Sphere Mesh as a Flashing Landing Light on a Model - Question
« Reply #5 on: September 26, 2018, 01:57:28 pm »

Agreed, You don't want a sphere here, you want sprites.

You can also do it via "volumetric" sprites (see lightsaber)


Trev
« Last Edit: September 26, 2018, 01:59:16 pm by Trevor »
Logged

Bman

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Creating Sphere Mesh as a Flashing Landing Light on a Model - Question
« Reply #6 on: September 26, 2018, 11:36:01 pm »

Hi Trevor, good to see you here.  Are you talking about this thread topic?  http://www.anim8or.com/smf/index.php/topic,946.0.html
Not quite sure what you mean by "volumetric" 2D-sprites. Sorry I plead some ignorance.  What I'm trying to do is create flashing landing lights like you see on commercial airline planes.  But specifically for the top dorsal wing and bottom hull of the Lambda Class Shuttle.  The only way I've been able to get the game engine to not cast a shadow behind the sphere mesh when a light source is coming from any direction, is to just use a plain white texture (no alpha channel) and set the color white to full illumination either via Optech or Jeremy's new editor.  Thoughts?

Oh, so maybe multiple spheres each a slightly larger than the other with a fading "white" transparency and have black as the transparency ???    :-)
« Last Edit: September 26, 2018, 11:38:57 pm by Bman »
Logged

Trevor

  • Full Member
  • ***
  • Posts: 220
  • Goldfinger64 Dev OS:10 CPU:5960x Gfx:RX480
    • View Profile
    • LS Tech Services
Re: Creating Sphere Mesh as a Flashing Landing Light on a Model - Question
« Reply #7 on: September 27, 2018, 05:26:25 pm »

Wow, that thread is exactly the method I used for my lightsaber - though independently thought up despite that thread existing before I created my lightsaber (2010)

Layers of spheres would have heavy banding on top of heavy poly usage.

"volumetric Sprites" - that lightsaber - is the way to go (ok, volumetric sprites might actually mean something else, but this is what I meant by it)

Trev
Logged

Bman

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Creating Sphere Mesh as a Flashing Landing Light on a Model - Question
« Reply #8 on: September 28, 2018, 01:27:04 am »

Trevor, I searched for your post you are referring to, but I don't think it exists anymore.(?)  Direct link ?

Anyway, in the mesh image shown below (un-textured at the moment) is what I tested with one of the above Lights.png texture map on each intersecting plane. But I think I need to use the "two-sided" texture mapping feature in Anim8or for each plane, before I export to .3ds format.  I've also wondered if scaling the applied texture map has any significance. (?)

In the game environment, I rotated the model around and it appeared the back side of some planes were transparent because the game engine thinks that the face normals exist on the textured side.  Also, I had deleted the sphere enveloping the planes, but if I fill in the faces of the sphere and map a pure transparent black texture to the entire sphere, that might allow the shadow property applied from any random light source to fall on the opposite side of the enveloping sphere (which is invisible anyway) and not affect the interior planes.  The only other cosmetic effect left is maybe add a 90 degree plane at the bottom or center of the intersecting planes (inside the sphere) so you see the flashing light effect looking up from below the model.

I'm still not clear about volumetric 2d/3d sprite objects or how to do that.  Game engine is 3d flight simulation game using 3d meshes/objects.  I read some threads about lightsaber blades and making concentric cylinders, but you're right that it adds a higher poly face count if I did it with multiple spheres... and color banding effect.  Wanted to test what Selden wrote too about  UV tool's "Spherical projection".  Wasn't aware of that.

Logged

selden

  • Full Member
  • ***
  • Posts: 221
    • View Profile
    • Modelling for Celestia
Re: Creating Sphere Mesh as a Flashing Landing Light on a Model - Question
« Reply #9 on: September 28, 2018, 07:24:54 am »

Are you willing to specify the game engine that you're working with?

Is it available for download somewhere?

Sometimes fresh eyes looking at a program's specifications can discover something that's been overlooked.

Logged
Selden

Trevor

  • Full Member
  • ***
  • Posts: 220
  • Goldfinger64 Dev OS:10 CPU:5960x Gfx:RX480
    • View Profile
    • LS Tech Services
Re: Creating Sphere Mesh as a Flashing Landing Light on a Model - Question
« Reply #10 on: September 28, 2018, 03:06:20 pm »

All triangles have a "front" and "back" face. Most environments cull back faces to improve rendering time, you need to stop that from happening with the "volumetric Sprite" (and Im not sure how you are not clear about what I mean when you attach an image of exactly what Im talking about :S )

Also, there is no post, its an image which is already attached in my post above.

Trev
Logged

Bman

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Creating Sphere Mesh as a Flashing Landing Light on a Model - Question
« Reply #11 on: September 30, 2018, 12:35:48 pm »

Thanks Trevor.  I had to look up the term, but my understanding is a 1D,2D, or 3D "Sprite" is a concept/program code or object (however it is manifested in physical geometric shape) that displays a static bitmap image that is always visible from any direction facing the player's point of view or camera view(?).  That's not exactly correct but I digress.  Game doesn't support "sprites" in the traditional sense.  Anyway, I haven't had time to test yet, but I'll build a concentric-cylinder (lightsaber) blade shape as you mentioned. Thanks.
« Last Edit: September 30, 2018, 12:58:20 pm by Bman »
Logged