News:

MegaGlests' game mods menu let's you install many new mods. Even more are available on the MegaGlest Wiki and the Mods forum.

Main Menu

(Solved!!) Does any one know how to make transparent team colour?

Started by ElimiNator, 26 June 2009, 15:58:46

ElimiNator

Does any one know how to make transparent team colour? like in magic the energy fountain?



Update(solution) by titi:
Here is how to switch on transparent teamcolor!
You cannot use the alphachannel in the texture to create this effect! This effect is done by transparency material in blender!
The whole object with this material will be transparent! If you want transparency and non transparency parts you have to work with 2 objects. One with transparency material one with non transparent material. I think this is the way the magic energy fontain was made.



Get the Vbros': Packs 1, 2, 3, 4, and 5!

titi

very good question  ???
I make a new thread for this!

I don't know it, I think its not possible with the current blender exporter. As far as I know its also not possible with the currrent version of glexemel and the glest xml format! Anyone else knows it?



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Hectate

At one point I was considering doing an alien race that "teleported" their units in instead of actually "building" them (merely a visual difference). Unfortunately I wanted to be able to have a glow emanating from teleporter when it a unit was being "built", and I wanted it to be in the team color.
Since a mesh cannot be marked as both single and double-sided at the same time using the current xml exportation, I was out of luck.

However, I did figure out that, if I *were* to do it, there is a way I might be able to get it to work - somewhat.

My solution would be to have the glow itself be alpha as desired, and only in white. However, I figured that I could have small shafts of light sparkle and flash from inside the teleporter in the teamcolor instead. The sparkle/flash lights would be in team color using a separate mesh. Dunno how it would look because I didn't try it...

wciow

Obviously Glest can do team coloured alpha. I think the problem is that the export script only supports one or the other. Someone should take a look at the export script and fix it.   
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

Hectate

Quote from: wciow on 27 June 2009, 14:36:52
Obviously Glest can do team coloured alpha. I think the problem is that the export script only supports one or the other. Someone should take a look at the export script and fix it.   
Lol, I just assumed that the export script didn't do it because Glest didn't support it. I hadn't noticed it in any of the units, although I could have missed it.

I've had to hand modify the .xml, mostly for texture names (like the Eaglestone clouds, same mesh, different texture = different .g3d to be made), but there's nothing in there that seems to let us do both... maybe it's both an export and xml2g.exe issue?

weedkiller

QuoteObviously Glest can do team coloured alpha
where?

i tried something like that with the indian princess modell, you can make a seperate mesh with teamcolor. then you change its alpha in its material so the whole mesh looks transparent. i didnt use it finally because it didnt work good for my modell; i think doublesiding was lost this way...

titi

As he said, glest can do it and you can see it in the magic energy fountain



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

titi

Here is how to switch on transparent teamcolor!
You cannot use the alphachannel in the texture to create this effect! This effect is done by transparency material in blender!
The whole object with this material will be transparent! If you want transparency and non transparency parts you have to work with 2 objects. One with transparency material one with non transparent material. I think this is the way the magic energy fontain was made.






Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

John.d.h


Omega

I'm pretty sure Titi would test it in at least the g3d viewer before posting it here. Seems to make sense.

Well done Titi. All along I was think blender had no way to do it...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

Just for reference, this is what it looks like in Glest with .75 alpha.  Unfortunately, not only can you see through the transparent part, but also through the mesh behind it!  This is a glitch I noticed a while ago with one-side alpha.  I wonder why the Energy Source doesn't have this problem.

http://i44.tinypic.com/veyxed.png

Omega

Hmm, forgot about that... Maybe it has something to do with different software? Blender is used by almost everyone in glest, but the developers used 3ds max...

Oh well... I guess this is still good if you don't plan on having anything behind it (ie: ghost).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

It seems that other units are visible behind it, but not tileset objects (including resources).



On the left, you can see the Initiate standing behind the crystal (you might have to look closely, but his shoulder is there), but on the right you can't see the stone resources behind it.

ElimiNator

Ya it dose not work very well in blender, but at least it works.

And dose any one know how to make transparent stuff, like glass so that it can move?
[img]http://photos-g.ak.fbcdn.net/hphotos-ak-snc1/hs122.snc1/5253_1143313993314_1541414237_349854_392725_n.jpg[/img]
[img]http://photos-h.ak.fbcdn.net/hphotos-ak-snc1/hs122.snc1/5253_1143314033315_1541414237_349855_3908637_n.jpg[/img]
Get the Vbros': Packs 1, 2, 3, 4, and 5!

John.d.h

Quote from: ElimNator on  2 July 2009, 00:51:09And dose any one know how to make transparent stuff, like glass so that it can move?
What do you mean?

ElimiNator

Ok so I wanted mu UFO to spin and bob. The glass is transparent (I used alpha in the texture) and you can see a alien in it moving it tentacles around.
But when I make it the glass disappears.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

John.d.h

The crystal on the picture in my previous page is animated and it doesn't disappear, so I'm not sure what the problem is.  Maybe you set the alpha too low on the material?

Omega

This is seen in the same way as alpha (the transparency, not the team color) overlaps in Glest. While Tilesets are perfect, the alpha in unit models will overlap, so that you'll see nothing but the alpha, and everything underneath for some reason is not rendered.

I believe this is also seen in the dwarfs, in a building with flames (not sure which building). The alpha in the flames overlap, meaning that if you wanted to have flames, the model would need to be shaped to the flame, not the alpha (although this wouldn't help your model).

It doesn't seem to have anything to do with animation. Animated or not, it still has the same effect. I would classify this as a bug, and in my opinion, GAE should attempt to patch it. Something about the how the tilesets are rendered fixes it, though there is also the fact that tilesets cannot be animated, so I wonder if this has anything to do with that?!?

The question of the post is solved, as we now know a way to have alpha in the team color, but now there is a new problem. Why does glest not render alpha correctly and what can we do about it? Perhaps someone with experience could take a quick look at the source to see if they could figure it out? Of course, all the programmers for GAE are pretty busy, and we're a little short on programmers[1]. I don't have enough experience with c++, and won't have time to learn with my current schedule, and it needs more time than I have to spare. Of course, by all means, keep seeing if anyone can find a solution to this problem (or an alternative will do)...

@john.d.h - I think this is because you only showed how objects can appear BEHIND the object. His problem is that they won't show in the actual model.



1 - I have an idea. Suppose we go to coding forums and ask if any one wants to give a hand. If you guys think its a good idea, I'll gladly go and try to announce the GAE project (most of these forums have a 'help wanted' as well as 'project announcement' boards). It could be a great way of getting both more players and new coders to give a hand. What say you?
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

John.d.h

Quote from: omega on  2 July 2009, 05:14:45
I have an idea. Suppose we go to coding forums and ask if any one wants to give a hand. If you guys think its a good idea, I'll gladly go and try to announce the GAE project (most of these forums have a 'help wanted' as well as 'project announcement' boards). It could be a great way of getting both more players and new coders to give a hand. What say you?
ModDB has a feature for that.

titi

Yes, transparency in units is a bit buggy ( but it always was! )
And for new coders, lets wait a while, hailstone and silnarm are very active and I think we will see first results soon!
They are currently merging in the code from 3.2.2 and they will hopefully have success. Hailstone is very focused now to bring us a first stable version of GAE. If this is there ( and I hope this will be the case in the next 2 or 3 month, we have a stable codebase where new programmers can start.



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Loronal



wait ??? ??? is it possible to keep an ordinary alpha instead of teamcolor because ive been working on a moon elves mod and i think for the night farms (which grows vines and grapes) so id like to have an alpha texture for the vines instead a few thousand indices

titi

yes, its possible! See the wiki ( teamcolor )
https://docs.megaglest.org/Glest_Blender_Hints

But transparency usage in units sometimes causes problems in the display ( object parts behind the transparency sometimes dissapear )
Magics dragon is made with transparency/alpha channel!



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

John.d.h

Okay, I think I've figured out part of the problem with transparency!  It has to do with which object is active when you export.  Eliminator was kind of on the right track with this a while ago, but I don't think he quite got it, so here goes.

In this example, we have everything selected, but the CRYSTAL is the ACTIVE object, indicated by its lighter outline and having its name in the corner.
[URL=http://img64.imageshack.us/i/blenderfail.jpg/][IMG]http://img64.imageshack.us/img64/8350/blenderfail.jpg[/img][/URL]
When we export like this, the active object (the crystal) takes precedence and we get this result:
[URL=http://img64.imageshack.us/i/g3dfail.jpg/][IMG]http://img64.imageshack.us/img64/903/g3dfail.jpg[/img][/URL]
As you can see, the transparency shows all the way through, so we see straight through the base to the grid floor.

In this example, we have everything selected, but the BASE is the ACTIVE object, indicated by its lighter outline and having its name in the corner.
[URL=http://img710.imageshack.us/i/blendersuccess.jpg/][IMG]http://img710.imageshack.us/img710/1076/blendersuccess.jpg[/img][/URL]
When we export like this, the active object (the base) takes precedence and we get this result:
[URL=http://img109.imageshack.us/i/g3dsuccess.jpg/][IMG]http://img109.imageshack.us/img109/3960/g3dsuccess.jpg[/img][/URL]
As you can see, the base is not obscured by the transparent crystal because it was the active object when we exported.

So, when you have an object with transparency and an object that is completely opaque, make sure that the opaque object is the active one if you don't want it to be obscured!

titi

 :o Thanks a lot for this explanation! I always thought I did soemthing wrong when using this and exported again ( with another selection) and suddenly it worked and I didn't knowed why .... will you add it to the wicki too ?



Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

John.d.h