Solutions for texture transparency

Is there any way of making a ship texture transparent in specific places (IE hooking up a different shader to an object) otherwise is there a method of attaching an infinite life billboard effect to a ship on a marker?

11,173 views 15 replies
Reply #1 Top

AFAIK the only things that use transparancy are the UI, and particles. Both use TGA files... now theres a thought. Try using a tga texture instead of a dds.

Reply #2 Top

I think I'm right in saying you can only hook up a different shader to a particle effect, in which case you could in theory construct the majority of the ship as a mesh for the particle system to achieve that. The main ship mesh would just be an untextured minute black cube.

Reply #3 Top

It's probably not the same as Sins but in Company of Heroes you'd always use alpha layers for areas you wanted to be transparent...

Reply #4 Top

The particles use a different shader to the ships.  It's why it allows transparency.  you would need to write a new ship shader that uses another texture.  Right now on all the textures, every chanel is being use (RGBA)  Alpha has different uses in our game.


So that being said. The first place to start is writing a new ship shader.

Reply #5 Top

how would I hook up the texture between the mesh and the shader though, it's not a big step to simply coopt a channel, but I don't want to break every other existing ship.

Reply #6 Top

If you are talking about effects such as transparent force fields and such (I assume that's what you mean by "permanent billboard effects") then yes, you can do that. It is also possible to use this for permanent 2D geometry simulation (something simmilar to what the old EvE ships used to employ with those complex girders).

You do it through the particle system - basically you create a flair point with a custom made texture which has its alpha adjusted to produce the transparency effect. Make the lifetime infinite, and the particle count set to 1 and you should be good to go. I used this method succesfully to create hangar forcefields.

Other than this, I don't think you can do partial mesh transparency, as that would require the model to use a completely different shader than what is currently available. Also, using TGA files would probably produce unwanted results (if it would work at all, which I doubt) because you'd lose MIP maps.

It *should* be possible to use the above particle method for 3D transparency effects, like bubble domes or canopies, by using an actual piece of geometry and simply adjusting its transparency with an instant color oscillator (it has alpha control as well) modifier - in case the normal transparency control in the color picker doesn't work on mesh particles, haven't tried it that way yet.

Reply #7 Top

For transparency, you'll need to rewrite the ship shader so that it'll see a channel as transparency.  It will though negate a channel currently in use and you'd have to redo every texture in the game.  Using billboard particles is an option though. However, realise it's render heavy.

Reply #8 Top

No it isn't. Billboard particles are a very efficient way of doing this. You are dealing with a single infinite life particle, and if you use low-res textures you should not have any problems. Sins engine is very good with particle rendering - one explosion contains enough particles to cover for a whole fleet worth of billboard instances.

For example, my ships frequently use such instances to render floodlight effects. Usually there are several of those per ship and I have yet to notice any slowdown due to using particles in such a way.

Reply #9 Top

How will it work for mid range to low end systems though? That is something you need to think about. Or else you are limiting your mod to only high end users. Which is fine if you are doing this for your own personal project, but if you plan to release it expect many "why does it lag" gripe post's. The particles do not use any mip mapping being that most of the vanilla particle textures are TGA files. Though .DDS "should" work for them. I use a couple dds's for my particles, and they work fine with the alpha channel being the transparancy. I am not knocking the method it is a valid alternative. I just think more research should be done before going this method.

Reply #10 Top

Like ManSh00ter said, each billboard particle is ONE particle.  Size doesn't matter here.  For each effect, only ONE particle needs to be processed and rendered.  A standard explosion has more particles than a fleet's worth of these, and the resources required for a fleet's particles will be almost non-existent compared to the resources required for the polygons/textures.

Reply #11 Top

The pirate ships in the game have billboard particles, something for you guys to look at

Reply #12 Top

I under tristans point about the render engine issues with particles, it is an alpha clipping problem which honestly is not very nice regardless of how fast your video card is (especially the more alpha sorts that are needed.

 

what I am specifically looking for is a way to create billboards that have organic tendrils on them, with at most a capitalship having 10-20 of these billboards arranged in a halo around it. The stated method worked acceptably in HW2 (except for alpha clip issues when particles overlapped one another) thanks for point out that I can use flairs. the only specific issue I may run into is that I need the position and rotation fixed to the mesh get the necessary effect (using parallel in the particle forge looks like it will do this)

Reply #13 Top

.dds format is only to be used with particles which use the NotAdditive function - for example smoke or anything which needs to be dark really. Targa is good for everything else. Performance is not an issue at all - that is, it depends on what kind of effect you need. Animated billboards can use a texture animation sequence and can still be limitied to only one particle. More dynamic flair effects however can be a problem if they emit a high number of particles.

You can do tendrils in several ways. I am currently in the process of making a semi-transparent "holographic" ship with glow attached, got to see if that is doable but so far is looking good. The idea is to make the whole ship as a collection of flare points instead of a normal mesh - I imagine you could do those tendrils as actual geometry pieces and simply have them attached to the mesh as flair effects. Or if you are looking for a 2D effect, yes, particle direction can be adjusted - just keep in mind that those effects have no thickness and dissapear if viewed from a certain angle.

And I am not sure what do you mean with "alpha clipping" problems. I had no such problems with my custom particles. As far as I know, particle imagery alphas can be pretty much fine-tuned. You just have to pay attention to the edges of your image because the engine picks up even the slightest color presence in the alpha channel (or RGB channels with targa files). These are usually invisible to the naked eye but can be revealed by inversing the image (negative) or by sampling the edges of the image with a color picker and reading RGB values to see if there are any trouble spots.

Reply #14 Top

the alpha clipping is when a texture/shader withalpha is displayed, at a certian point the graphics engine (any graphics engine will do this at some point) could care less what is behind something else and either defaults to a solid color or ignores any additional particles. The important part here is how efficient sins particle sorting engine is for performance, saying that there is no performance impact is just saying that there is no performance impact that you can readily notice (have you tried checking the frame rate hit in the debug .exe for large particle counts, it is really high)

Reply #15 Top

Quoting EvilleJedi, reply 12
I under tristans point about the render engine issues with particles, it is an alpha clipping problem which honestly is not very nice regardless of how fast your video card is (especially the more alpha sorts that are needed.

 

what I am specifically looking for is a way to create billboards that have organic tendrils on them, with at most a capitalship having 10-20 of these billboards arranged in a halo around it. The stated method worked acceptably in HW2 (except for alpha clip issues when particles overlapped one another) thanks for point out that I can use flairs. the only specific issue I may run into is that I need the position and rotation fixed to the mesh get the necessary effect (using parallel in the particle forge looks like it will do this)
End of EvilleJedi's quote

 

When you say organic tendrils, you wouldn't happen to mean the Yuuzhan Vong by any chance would you?