Phasers on Shields effect?

Started by
14 comments, last by Torn Space 20 years, 5 months ago
quote:
A spherical mesh with a funky texture on it. Make it dynamic, and when hit, modify the alpha values on the vertices to be opaque-ish near where it's hit, and then fade off. Stronger hits would wrap more than tiny ones. Of course this might be overkill, but it'd look cool.


I have this solution implemented, but it is not quite working the way I would have expected. So far I have a target being enveloped by a sphere; and the D3DXVec3Dot product is being calculated for the vertices using the normalized laser vector and the each of the vertex normal. Using the output of the D3DXVec3Dot product I am able to calculate and set an opaque-ish color and alpha values where the laser hits the target, and then fade off. That said; I have two remaining problems to solve:

1) When the sphere that is enveloping the target is rotated, you can that there are actually two impact points being generated. The first point is at 0 degrees and the second is at 180 degrees. I have tried using the absolute values of the vectors to eliminate the second impact point with little no success thus far.

2) The target in the center of the sphere is not visible unless I render the target before the sphere or turn off the z-buffer? Maybe this is normal; or I could have something wrong with the alpha blending and alpha testing?

(Edit: It would seem that as long as the target is render prior to the sphere; and the sphere is rendered with D3DRS_ZENABLE state set to false then you are able to see the target properly through the sphere. Does it have to be this way?)

Any advice would be much appreciated.


// Phaser vector.D3DXVec3Normalize(&vecDotSource, &vecDotSource);// Vertice Normal.vecNormal = D3DXVECTOR3(vertices[count].fNormalX, vertices[count].fNormalY, vertices[count].fNormalZ);D3DXVec3Normalize(&vecNormal, &vecNormal);// Output used to set the color and the alpha of the vertex.fDotOutput = (float) D3DXVec3Dot(&vecDotSource, &vecNormal);



Understanding is a three edged sword...


[edited by - Sean Doherty on October 18, 2003 6:40:26 PM]
_______________________________________Understanding is a three edged sword...Freelance Games - Home of XBLIG Starchonwww.FreelanceGames.com
Advertisement
quote:
When the sphere that is enveloping the target is rotated, you can that there are actually two impact points being generated. The first point is at 0 degrees and the second is at 180 degrees. I have tried using the absolute values of the vectors to eliminate the second impact point with little no success thus far.


1) The problem was caused by using the power of a negative Dot Product to calculate the color of the vertex.

2) Still experiencing some issues with the proper rendering order of 3D objects; especially objects where the state of D3DRS_ALPHABLENDENABLE is set to true? Would someone explain the proper rendering order?



Understanding is a three edged sword...
_______________________________________Understanding is a three edged sword...Freelance Games - Home of XBLIG Starchonwww.FreelanceGames.com
I wouldn''t say that I am entirely happy with my Phaser implementation. That said; I would appreciate any advice on how I can improve the effect; or on an algorithm to automate the rendering order?



_______________________________________
Understanding is a three edged sword...
_______________________________________Understanding is a three edged sword...Freelance Games - Home of XBLIG Starchonwww.FreelanceGames.com
Wow, game looks cool even from one screenshot The smaller sphear idea might look better for white star. This some alternate universe thing star trek vs b5? I''d like beta

Heh see why you have your sig as u do...

Who are you...What do you want...Who do you trust...
Thanks for your comments,

I started this project as a top view shooter that I was planning to release as soon as possible. Since then, the project has started to evolve into a fully featured third person real time strategy game. At the present time, there is no schedule release date and many of the ideas and features are still being formed and tweaked. In fact lately it seems as though I have been removing more code than I have been writing in order to concentrate on certain effects; such as the phaser on shield effect and rendering. That said, perhaps I will post an updated screen shot when I am able to solve my some of these problems and reintegrate explosions, tweaked lighting, and the skybox.

Again, thank for your comments, and if anyone has any advice technical advice; especially in the area of lighting, the rendering order of objects, or ways to improve the special; it would be very much apprenticed.


_______________________________________
Understanding is a three edged sword...
_______________________________________Understanding is a three edged sword...Freelance Games - Home of XBLIG Starchonwww.FreelanceGames.com
hmm, were did you get that whitestaar?

Bobboau, bringing you products that work... in theory
Bobboau, bringing you products that work... in theory

This topic is closed to new replies.

Advertisement