Author Topic: (Solved!!) Does any one know how to make transparent team colour?  (Read 7449 times)

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
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.
 


« Last Edit: 2 July 2009, 11:13:41 by titi »
Get the Vbros': Packs 1, 2, 3, 4, and 5!

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: GLADE Team Project: Dark Magic
« Reply #1 on: 26 June 2009, 16:50:06 »
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

  • Guest
Re: Dose any one know how to make transparent team colour?
« Reply #2 on: 26 June 2009, 21:37:23 »
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

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: Dose any one know how to make transparent team colour?
« Reply #3 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.   
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

Hectate

  • Guest
Re: Dose any one know how to make transparent team colour?
« Reply #4 on: 27 June 2009, 23:01:17 »
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

  • Draco Rider
  • *****
  • Posts: 277
    • View Profile
Re: Dose any one know how to make transparent team colour?
« Reply #5 on: 1 July 2009, 19:45:50 »
Quote
Obviously 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

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Dose any one know how to make transparent team colour?
« Reply #6 on: 1 July 2009, 20:24:36 »
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

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Dose any one know how to make transparent team colour?
« Reply #7 on: 1 July 2009, 23:23:11 »
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.
 


« Last Edit: 1 July 2009, 23:26:26 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Awesome!  Have you tried it out in the game yet?

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
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

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
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

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
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

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
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

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
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?
Code: [Select]
[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]
« Last Edit: 7 October 2016, 21:59:37 by filux »
Get the Vbros': Packs 1, 2, 3, 4, and 5!

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
And dose any one know how to make transparent stuff, like glass so that it can move?
What do you mean?

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
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

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
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

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
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

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
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

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
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

  • Guest
Re: (Solved!!) Does any one know how to make transparent team colour?
« Reply #20 on: 5 September 2009, 10:59:34 »


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

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: (Solved!!) Does any one know how to make transparent team colour?
« Reply #21 on: 5 September 2009, 20:28:23 »
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!
« Last Edit: 18 June 2016, 17:58:14 by filux »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: (Solved!!) Does any one know how to make transparent team colour?
« Reply #22 on: 3 January 2010, 20:38:38 »
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.
Code: [Select]
[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:
Code: [Select]
[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.
Code: [Select]
[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:
Code: [Select]
[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!
« Last Edit: 7 October 2016, 21:59:21 by filux »

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: (Solved!!) Does any one know how to make transparent team colour?
« Reply #23 on: 4 January 2010, 01:58:12 »
 :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

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: (Solved!!) Does any one know how to make transparent team colour?
« Reply #24 on: 4 January 2010, 02:52:59 »
Sure, I'll add it to the wiki right now.