Author Topic: models for surfaces in tilesets  (Read 1921 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
models for surfaces in tilesets
« on: 16 September 2010, 09:58:04 »
What about the idea to allow models for surfaces in tilesets? This would be great for grassy terrains for example.
This would be something optional for faster graphic cards :)

In the xmls I thought about something like this:

thats the current surface definition:
Code: [Select]
       <surface>
            <texture path="textures/surface2a.bmp" prob="0.2"/>
            <texture path="textures/surface2b.bmp" prob="0.1"/>
            <texture path="textures/surface2c.bmp" prob="0.1"/>
            <texture path="textures/surface2d.bmp" prob="0.2"/>
            <texture path="textures/surface2e.bmp" prob="0.2"/>
            <texture path="textures/surface2f.bmp" prob="0.2"/>
        </surface>

that would be a new surface definition:
Code: [Select]
<surface>
            <texture path="textures/surface2a.bmp" prob="0.2"/>
            <texture path="textures/surface2b.bmp" prob="0.1"/>
            <texture path="textures/surface2c.bmp" prob="0.1"/>
            <texture path="textures/surface2d.bmp" prob="0.2"/>
            <texture path="textures/surface2e.bmp" prob="0.2"/>
            <texture path="textures/surface2f.bmp"  prob="0.2"/>

            <model path="models/grass_1.g3d"          prob="0.2"/>
            <model path="models/grass_2.g3d"          prob="0.1"/>
</surface>
« Last Edit: 16 September 2010, 10:01:57 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Gabbe

  • Guest
Re: models for surfaces in tilesets
« Reply #1 on: 16 September 2010, 13:20:42 »
Yes, woudl then these models have maybe an effect on gameplay? Like your models move slower in grass and faster in flatlands?

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: models for surfaces in tilesets
« Reply #2 on: 16 September 2010, 16:14:24 »
This would be great, I always wanted to add grass.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: models for surfaces in tilesets
« Reply #3 on: 17 September 2010, 03:03:03 »
Dont use models for grass, use billboarding...
Glest Advanced Engine - Code Monkey

Timeline | Downloads

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: models for surfaces in tilesets
« Reply #4 on: 20 September 2010, 09:26:06 »
Is billboarding really the right way to do it? I think some quads with transparent textures showing some grass is still the right way. I saw things like these in several other games. Of course you must be careful to not use tons of  vertices for this kind of gimmick.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: models for surfaces in tilesets
« Reply #5 on: 20 September 2010, 14:54:26 »
Titi, take a look at Savage 2(free), if looks to me like it uses bill-boarding on grass, bushs, and trees, and they look good from a first-person view!
Egypt Remastered!

Proof: Owner of glest@mail.com

Gabbe

  • Guest
Re: models for surfaces in tilesets
« Reply #6 on: 20 September 2010, 16:59:13 »
mayeb rather

Titi, take a look at Savage 2(free(and 2 GBs!) ), if looks to me like it uses bill-boarding on grass, bushs, and trees, and they look good from a first-person view!

but that game pwns a** hardcore even, and the gfx is surely something for its onw..(?)

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: models for surfaces in tilesets
« Reply #7 on: 21 September 2010, 02:00:46 »
Is billboarding really the right way to do it? I think some quads with transparent textures showing some grass is still the right way.

Do some more homework before replying next time...

billboard == textured quad that always points toward the camera

In this case you want an axis aligned one (aligned on the Y axis).
http://nehe.gamedev.net/data/articles/article.asp?article=19#5
Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: models for surfaces in tilesets
« Reply #8 on: 21 September 2010, 02:06:30 »
So that means the quad wouldn't always face straight-on at the camera?  I guess that solves my concern of "what if we look at it from different angles".

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: models for surfaces in tilesets
« Reply #9 on: 21 September 2010, 02:49:50 »
So that means the quad wouldn't always face straight-on at the camera?  I guess that solves my concern of "what if we look at it from different angles".

Yeah, the quad would always be 'straight up' (aligned with the Y-axis), but would otherwise be turned to face the camera.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: models for surfaces in tilesets
« Reply #10 on: 21 September 2010, 08:55:40 »
Silnarm, please describe a bit more. I think I still didn't get the point ? Why is a billboarding better in this case then just  some quads with grass on it?

I know a lot of scenarios/games where billboarding is ok and used but I don't get(yet) how it can be used in glests case?
« Last Edit: 21 September 2010, 09:14:48 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: models for surfaces in tilesets
« Reply #11 on: 21 September 2010, 12:22:27 »
Ok, I perhaps wasn't very clear...

I misunderstood you initially, because you said 'model' which I took to mean, well, a model.

A billboard is just a quad, but it is rotated to face the camera (except, in this case, for the Y-axis which always points straight up). This way the grass blades on your texture point up, and you can do things like shear transforms on the texture coords, to 'animate' the grass and make blow in the wind, for example.

Whether this will be of any use in Glest is dubious, given the typical camera angle.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: models for surfaces in tilesets
« Reply #12 on: 21 September 2010, 13:22:06 »
ah ok, thats basically the same what I thought when you said it. I think a "model" will be good enough for our purpose and will allow other effects too. Something like additional flowers bushes or whatever. But you always have to keep in mind that you should not use too many vertices for these kind of models!
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios