Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Red sphere spotted around landed ship #970

Closed
Brianetta opened this issue Feb 14, 2012 · 6 comments
Closed

Red sphere spotted around landed ship #970

Brianetta opened this issue Feb 14, 2012 · 6 comments

Comments

@Brianetta
Copy link
Contributor

Version: 50f2521 Saved game: WikiSend

Not entirely sure what's up here. I haven't seen it before. The pictures show an Imperial Trader parked on an adjacent pad upon game start. It's red and translucent, and sometimes you can't see buildings through it, depending on angle.

Imgur
Imgur

@Luomu
Copy link
Member

Luomu commented Feb 14, 2012

It is the shield generator effect. Buy yourself one or spawn a few enemy ships with ctrl+f12:

This is what happens when blended geometry is drawn without depth sorting. If you first draw terrain behind the shield bubble, then shield effect with blending and then a building behind the shield bubble, the effect will be correct regards to the terrain but not the building. It's not so noticeable in space.

To fix: either sort things, or implement a new effect that is not an always-on red bubble - if it's just a thing that flashes when hit the problem is less noticeable.

@robn
Copy link
Member

robn commented Feb 14, 2012

Well we do sort things, but the city gets sorted as a single entity, which is why it works sometimes but not others - the ship and the city are compared based on their centre points and distance to camera.

There's a few possible approaches to fixing this. Sort city buildings individually (which would allow transparent building windows), or decouple special effects from their physical objects and add them as a separate drawable thing that gets sorted properly.

For this particular case, a new shield effect would be great. I've talked about a shimmery "second skin" kinda thing in the past, which could be done by drawing the ship's collision mesh with some nice blending or whatever over the top of the ship, possibly scaled up a little so it doesn't appear right on the actual ship body but a little way from it. That's one of many possibilities of course.

@Brianetta
Copy link
Contributor Author

That last would really bring out the foibles in the Hammerhead's collision mesh.

@Luomu
Copy link
Member

Luomu commented Feb 15, 2012

I added a shield effect prototype to this webgl demo, click the "Hit" button: (I hope the animation speed is ok - it's supposed to flash by quite fast): http://luomu.github.com/pioneer/shippainter/

This type of effect wouldn't require a special mesh for every ship, it would be "only" necessary to figure out the hit direction and transform so the effect adequately covers the ship.

@robn
Copy link
Member

robn commented Feb 15, 2012

That's lovely :)

@Luomu
Copy link
Member

Luomu commented Feb 16, 2014

Doesn't happen with the current shield effect, it doesn't write depth so the see-through scenario cannot happen.

@Luomu Luomu closed this as completed Feb 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants