Re: Shipyard

Here, various developers can tell you all about what they're up to, so you can yell at them for being idiots. "... and there was a great rejoicing."
Message
Author
User avatar
MikkoM
Space Dragon
Posts: 318
Joined: Fri Mar 10, 2006 12:32 pm
Location: Finland

Re: Shipyard

#31 Post by MikkoM » Tue Apr 13, 2010 9:45 pm

pd wrote:WEAPONS

Weapon effects are on my list of "mock-ups to-do"... Since we don't show actual ship parts externally, I don't think we need to have weapon effects come out of certain parts. Instead they can originate from the center of the ship, but only be shown starting at the boundary volume.


What about this?

pd wrote:What will be possible is to have relativly small 'gun emission points', which could be placed pretty much freely on the surface of the meshes. So that if the player decides to put a laser weapon somewhere on the left side of the ship, it will actually fire from there. Those should be relativly small and simple, so that they're not much of an effort to create and fit to the racial designs. Maybe we could even use colors to indicate whether there is a laser or ballistic weapon underneath.

This way the weapons don't interfere with the designs itself, and still there is an indication of the weapons used.


Personally I am not too concerned whether or not a beam originates exactly from the point to which the player has placed his/her weapon (although it would of course be nice if it would) as battles will probably usually have numerous different ships shooting numerous different beam weapons. So the exact place where a single beam originates from might not usually be the first thing on the player`s mind. However having the beams originate from the model itself would be nice, at least compared to this first mock-up where the beams seem to originate from the ships shields, which seems a bit weird.

Also, since there have been much discussion in this topic about changing ship models at least as far as colours are concerned, should a possible model change like battle damage also be considered? (This might of course be a quite low priority issue and as such not very important currently.)
Last edited by MikkoM on Wed Apr 14, 2010 12:48 am, edited 1 time in total.

User avatar
pd
Graphics Lead Emeritus
Posts: 1924
Joined: Mon Mar 08, 2004 6:17 pm
Location: 52°16'N 10°31'E

Re: Shipyard

#32 Post by pd » Tue Apr 13, 2010 9:57 pm

It's very easy to go overboard with things we could potentially do. For the sake of simplicity I do no longer support this comment of mine, made more than 2 years ago. A lot of things have changed since then. The design screen alone would need to be changed a lot.

If, however tzlaine decides, that hardpoints should be added, I'm will obey, of course :)

Regarding damage: If, we want to do this, we can do it with textures(which is always simpler than doing it with models). Personally I don't think we need it. Healthbars provide a better feedback.

User avatar
tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

Re: Shipyard

#33 Post by tzlaine » Tue Apr 13, 2010 10:02 pm

pd wrote:I've committed a decal map for the Mark 1. There are currently just 2 channels. The first is a neutral base texture, onto which the empire color is overlayed using the second channel, which is the decal mask.(see this and this).

Or you could just use the second channel to replicate this.

Ok, so is this texture here so I can try both options to see what works best, or do we really need two decal channels?

tzlaine wrote:Without separate channels, with the glow baked into the specular channels, bright specular reflections automatically cause the glow to increase too, which is bad.
While this is right, it can be solved by using black in the specular channel for everything that's glowing, which is what I'm doing anyway.

I think you might be misunderstanding me. What I'm talking about is the parts of the model that have some self-illumination from some glowing part. In those places on the model, you have a final color that is (ignoring specular and other contributions for now) Gr (glow, reflected) + D (diffuse / color map). In a no-light situation, the color is Gr -- the diffuse contribution is zero. In a lit situation in which the glow is turned off, you have D -- Gr contributes nothing when the glow is turned off. Then there is the case where glow is on, and lighting is in play. In those cases, you would like to have D vary with the angle to the light source, and have that reflected in (Gr +D), without changing Gr. This is what I mean when I suggest we need to have the glow colors and the diffuse colors represented as full RGB channels for every location.

Also, I asked a few days ago for your breakdown of the color channels as you envision it. Here's what Geoff and I have tentatively settled on so far:

1. rgba -> diffuse red, diffuse green, diffuse blue, diffuse alpha
2. rgb -> normal x, normal y, normal depth; a-> specular/gloss
3. rgb -> glow 1, glow 2, glow 3; a -> decal

Are there any changes you'd like to make to this?

Weapon effects are on my list of "mock-ups to-do"... Since we don't show actual ship parts externally, I don't think we need to have weapon effects come out of certain parts. Instead they can originate from the center of the ship, but only be shown starting at the boundary volume. Here's is something quick and dirty to illustrate this. The bottom two ships are shooting at the seed sphere.

That looks really good to me. KISS.
Last edited by Geoff the Medio on Tue Apr 13, 2010 10:09 pm, edited 1 time in total.
Reason: fixed quote

User avatar
tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

Re: Shipyard

#34 Post by tzlaine » Tue Apr 13, 2010 10:04 pm

pd wrote:It's very easy to go overboard with things we could potentially do. For the sake of simplicity I do no longer support this comment of mine, made more than 2 years ago. A lot of things have changed since then. The design screen alone would need to be changed a lot.

If, however tzlaine decides, that hardpoints should be added, I'm will obey, of course :)

I'm very against hard points and turrets. I'm more interested in supporting a large number of ships, rather than a large amount of detail on each ship.

Regarding damage: If, we want to do this, we can do it with textures(which is always simpler than doing it with models). Personally I don't think we need it. Healthbars provide a better feedback.

I agree completely.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12247
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Shipyard

#35 Post by Geoff the Medio » Tue Apr 13, 2010 10:29 pm

MikkoM wrote:...the beams seem to originate from the ship`s shields...

This raises the issue of shield effects. Has any thought been put into how to render shields? Assuming not:

For geometry purposes:
* The simplest solution would seem to be a bounding sphere for every ship with non-depleted shields.
* More complicated would be to automatically generate in code an ellipsoid that fits a bit better around each ship model, depending on its shape. This is probably not necessary.
* Alternatively, a set of shield meshes could be created for each ship mesh, with customized form-fitting shield geometry. This is probably not necessary.
* Planets will only need spherical shields in any case, since they are themselves spherical.

For texturing purposes:
* Probably shields should be more prominent when they are being fired upon, but should still be visible whenever they are active (ie. not depleted).
* Player-coloured shields (aside: and beam weapons?) might make sense, to help make ships more distinguishable.
* When not being fired on, shields could have a low-alpha diffuse colour (edit: or greyscale texture with applied colour) and perhaps a low to moderate amount of gloss.
* When being fired on, a low amount of glow (in the same diffuse colour) could be added.
* Glow just on the side where the fire is coming from would be nice, but is probably not necessary.

User avatar
pd
Graphics Lead Emeritus
Posts: 1924
Joined: Mon Mar 08, 2004 6:17 pm
Location: 52°16'N 10°31'E

Re: Shipyard

#36 Post by pd » Tue Apr 13, 2010 10:32 pm

tzlaine wrote:Ok, so is this [decal] texture here so I can try both options to see what works best, or do we really need two decal channels?

It's there for you to try out what works. Ideally we need as few as possible of these channels.

tzlaine wrote:I think you might be misunderstanding me. What I'm talking about is the parts of the model that have some self-illumination from some glowing part. In those places on the model, you have a final color that is (ignoring specular and other contributions for now) Gr (glow, reflected) + D (diffuse / color map). In a no-light situation, the color is Gr -- the diffuse contribution is zero. In a lit situation in which the glow is turned off, you have D -- Gr contributes nothing when the glow is turned off. Then there is the case where glow is on, and lighting is in play. In those cases, you would like to have D vary with the angle to the light source, and have that reflected in (Gr +D), without changing Gr. This is what I mean when I suggest we need to have the glow colors and the diffuse colors represented as full RGB channels for every location.

That makes sense. The reason I was proposing the change with the glow texture, is that when doing my renderings, I'm only using a glow channel, as I've suggested and take the color information from the color map. This of course works only because the light information has been baked into the color map before and and will only work as long as the glow is turned on. In a situation where the glow is off, I need to switch the color map and disable the glow channel. Anyway, as I've said, let's keep the glow part as it is, it works beautifully.


Also, I asked a few days ago for your breakdown of the color channels as you envision it. Here's what Geoff and I have tentatively settled on so far:

1. rgba -> diffuse red, diffuse green, diffuse blue, diffuse alpha
2. rgb -> normal x, normal y, normal depth; a-> specular/gloss
3. rgb -> glow 1, glow 2, glow 3; a -> decal

Are there any changes you'd like to make to this?

I've delayed this because the glow discussion was still ongoing. I'm fine with the proposal.

User avatar
tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

Re: Shipyard

#37 Post by tzlaine » Tue Apr 13, 2010 10:59 pm

pd wrote:
tzlaine wrote:Ok, so is this [decal] texture here so I can try both options to see what works best, or do we really need two decal channels?

It's there for you to try out what works. Ideally we need as few as possible of these channels.

Cool. Can you give me some more detail on what the operation should look like in either case (that is, using either of the two channels you've provided)?

tzlaine wrote:I think you might be misunderstanding me. What I'm talking about is the parts of the model that have some self-illumination from some glowing part. In those places on the model, you have a final color that is (ignoring specular and other contributions for now) Gr (glow, reflected) + D (diffuse / color map). In a no-light situation, the color is Gr -- the diffuse contribution is zero. In a lit situation in which the glow is turned off, you have D -- Gr contributes nothing when the glow is turned off. Then there is the case where glow is on, and lighting is in play. In those cases, you would like to have D vary with the angle to the light source, and have that reflected in (Gr +D), without changing Gr. This is what I mean when I suggest we need to have the glow colors and the diffuse colors represented as full RGB channels for every location.

That makes sense. The reason I was proposing the change with the glow texture, is that when doing my renderings, I'm only using a glow channel, as I've suggested and take the color information from the color map. This of course works only because the light information has been baked into the color map before and and will only work as long as the glow is turned on. In a situation where the glow is off, I need to switch the color map and disable the glow channel. Anyway, as I've said, let's keep the glow part as it is, it works beautifully.

Agreed.

Also, I asked a few days ago for your breakdown of the color channels as you envision it. Here's what Geoff and I have tentatively settled on so far:

1. rgba -> diffuse red, diffuse green, diffuse blue, diffuse alpha
2. rgb -> normal x, normal y, normal depth; a-> specular/gloss
3. rgb -> glow 1, glow 2, glow 3; a -> decal

Are there any changes you'd like to make to this?

I've delayed this because the glow discussion was still ongoing. I'm fine with the proposal.

Ok. Then after I play a bit with the decal stuff, I'll write a new set of material/shaders/code that will use the new channel scheme. In the meantime, could you give me a set of textures that looks like the above?

User avatar
MikkoM
Space Dragon
Posts: 318
Joined: Fri Mar 10, 2006 12:32 pm
Location: Finland

Re: Shipyard

#38 Post by MikkoM » Tue Apr 13, 2010 11:01 pm

pd wrote:It's very easy to go overboard with things we could potentially do. For the sake of simplicity I do no longer support this comment of mine, made more than 2 years ago. A lot of things have changed since then. The design screen alone would need to be changed a lot.

If, however tzlaine decides, that hardpoints should be added, I'm will obey, of course :)


Well, my main concern is anyway that the beam weapons should look good to the player, and this is of course quite hard to determine from a single mock-up picture.

User avatar
pd
Graphics Lead Emeritus
Posts: 1924
Joined: Mon Mar 08, 2004 6:17 pm
Location: 52°16'N 10°31'E

Re: Shipyard

#39 Post by pd » Wed Apr 14, 2010 12:22 am

tzlaine wrote:Cool. Can you give me some more detail on what the operation should look like in either case (that is, using either of the two channels you've provided)?

I can try. Both methods rely on the overlay blending mode in photoshop. Check out this site, where somebody has translated the necessary math to GLSL. The blending is done using a base and a blend. Blend is always the empire color.
I guess this is the relevant part, but I'm not sure:

Code: Select all

#define BlendOverlayf(base, blend)    (base < 0.5 ? (2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)))


1. Method
I'm starting with the third decal channel, because it's the most promising. If it works it's just one channel and the empire colors are replicated perfectly.

Image
This is the base. So what needs to be done is BlendOverlay(third channel, empire color)

Assuming empire color is a bright green, this would be the result:
Image
Note, that black parts remain black due to the nature of overlay blending.

This result needs to be combined with the color map. Everything that's 0.0 is replaced with the color map. Everything that is not 0.0 is taken exactly as in this image and substitutes the color map. If this can't be done with the third channel alone, there's a second channel, which is an alpha version/mask of this.

2. Method
Compared to the previous method, this one is less than ideal, because it depends too much on the color map. If I would use a heavily saturated color as a main diffuse color for the hull the overlay method fails, because the empire color is no longer being replicated properly

Anyway, base in this case is the color map. So what needs to be done is you check the second channel of the decal map(mask) and at any pixel that is 1.0 you do BlendOverlay(color map, empire color). Again the result is combined with the color map.

I hope this makes sense.

In the meantime, could you give me a set of textures that looks like the above?

I can provide the first two, since I don't know what decal channel we're going to use yet.

User avatar
tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

Re: Shipyard

#40 Post by tzlaine » Wed Apr 14, 2010 1:40 am

pd wrote:I hope this makes sense.

I understood all that. Thanks for all the detail.

In the meantime, could you give me a set of textures that looks like the above?

I can provide the first two, since I don't know what decal channel we're going to use yet.

Could you provide the third one in both forms?

User avatar
pd
Graphics Lead Emeritus
Posts: 1924
Joined: Mon Mar 08, 2004 6:17 pm
Location: 52°16'N 10°31'E

Re: Shipyard

#41 Post by pd » Wed Apr 14, 2010 1:59 am

It just occured to me, that to combine the result of the overlay in method 1 with the color channels, we might use another blending mode. There's one, that comes really close to what we want: Lighten

Code: Select all

#define BlendLightenf(base, blend)       max(blend, base)


Image

However, it only works as long as the base(color map) is darker than the blend, which will not always be the case. Also the resulting decal color is not true to the empire color(it's brighter).

User avatar
pd
Graphics Lead Emeritus
Posts: 1924
Joined: Mon Mar 08, 2004 6:17 pm
Location: 52°16'N 10°31'E

Re: Shipyard

#42 Post by pd » Wed Apr 14, 2010 2:12 am

tzlaine wrote:Could you provide the third one in both forms?

Done.
new_mark1_Glow1.png has the decal map for method 1.

User avatar
MikkoM
Space Dragon
Posts: 318
Joined: Fri Mar 10, 2006 12:32 pm
Location: Finland

Re: Shipyard

#43 Post by MikkoM » Fri Apr 16, 2010 12:40 am

Geoff the Medio wrote:* Player-coloured shields (aside: and beam weapons?) might make sense, to help make ships more distinguishable.


If ships, shields and beam weapons would all be player-coloured, wouldn’t this make the space battles look a bit homogenous, at least as far as visual effects and colours are concerned? And on the other hand, if beam weapons are coloured and have certain visual effects based on what weapons (weapon techs) the ship actually uses, couldn’t this give, at least for the more experienced players, clear visual hints about the weapons that the enemy ships have? Not to mention, add more colour to space battles. (However, I don`t of course really know how the space combat engine handles beam weapons.)

And as far as player-coloured effects are concerned, perhaps ship explosions could also be considered. This is of course a bit of a brainstorming kind of an idea (might be bad), but perhaps player-coloured explosions could add more colour to space battles and indicate clearly whose ship was destroyed.

User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Re: Shipyard

#44 Post by Bigjoe5 » Fri Apr 16, 2010 1:53 pm

MikkoM wrote:And on the other hand, if beam weapons are coloured and have certain visual effects based on what weapons (weapon techs) the ship actually uses, couldn’t this give, at least for the more experienced players, clear visual hints about the weapons that the enemy ships have?
I suppose that even if weapon effects were based on the weapon, the colour could still be based on the empire colour. I'm not sure how easy it would be, though, to distinguish between various weapon types not based on colour. And then of course, there's the issue of what to do when a ship of unknown or independent ownership is firing its weapons at you.

MikkoM wrote:And as far as player-coloured effects are concerned, perhaps ship explosions could also be considered. This is of course a bit of a brainstorming kind of an idea (might be bad), but perhaps player-coloured explosions could add more colour to space battles and indicate clearly whose ship was destroyed.
In this case, there would still have to be a generic explosion for pirates and ships of unknown ownership, which could probably easily be confused with the explosion of some particular empire's ship. Also, the destruction of certain types of ships won't necessarily be an "explosion" per se. I get the impression that it would be a bit awkward to depict the destruction of a trained space monster in the colour of its owner empire, unless the space monster itself was that colour.

Player coloured shields, on the other hand, probably make a lot of sense, as it's probably easy to make the shield effect colourless for pirates et al without making it look silly (like a grey laser would).
Warning: Antarans in dimensional portal are closer than they appear.

Post Reply