Jump to content

Additive textures + draw distance


Recommended Posts

Context: I've made a runway for Kerbinside, which is perfectly visible from most of the way to orbit.

Issue: I want a considerable number of lights on it ( runways are a nightmare of lighting ) so my idea was to use emissive quads ala KSC runway ( what shader is *that* using anyway ) - however there's no emissive transparent shader so I'm looking at the Particles/Additive one ( thanks for the tip Porkjet ).

Problem: I can't seem to get any shape or form of lighting using that technique visible far enough; I've made the quads giant & handmade mipmaps ( doesn't work, for starters it switches mips very closely ), I've pulled them up & down off the surface in case they're clipping, put them in the TransparentFX layer, and now made the quads absurdly large.

I don't have Unity Pro so I can't make custom LODs with bigger quads, so is there anything else I can do? The KSC runway lights are visible further than just about any other part which is a bit more than I need, but I'd like a decent draw distance at least.

Link to comment
Share on other sites

1. Make sure your light textures have a normal amount of space used for opaque elements. A texture with a tiny white star in the middle and huge black area on 90% of the pixels will very, very quickly fade to black on lower mips. You can see my light FX texture on one of the screenshots from my Gamasutra.com article of the KSC update, I think.

2. I use 3 intersecting quads (or six intersecting quads if shader is one-sided), not one horizontal quad per light, which probably makes addition on lower mips remain visible for longer.

3. Not sure about the shader, I think I used two quads per plane, which meant the shader was one sided - so it probaby wasn't Particles-Add but was some of the transparent KSP shaders.

4. Not directly related to your question, but to prevent lights from looking really, really ugly on quad intersections and from grazing angles, ideally you should use a custom shader with a fresnel based fade. Ask Porkjet for the one I made some time ago.

5. Again, not directly related to your question, but avoid huge quads at all costs, because every single pixel touched by a transparent quad has to be redrawn again by the Unity renderer. If you have three quads visible in a frame and covering most of it, that means that Unity has to do three more expensive redraws of the whole frame, which is not good for performance (ever noticed how particles in KSP never grow beyond certain size no matter how close you zoom in? that's why). If you have a low number of lights and low polycount, it's even advisable not to use quads and to use more complex topology, closely hugging the edges of opaque areas on the texture (star-shaped and circle shaped N-gons for lights, for example). Same goes for models like trees, it's best to use a few more vertices than to leave a completely transparent area unused by the texture anyway.

image011.jpg?version=1&modificationDate=1254232511000&api=v2

_______________________________

You know what, just write a simple plugin that will scale KerbinSide objects depending on the distance to the player. KSP is not using HDR rendering, so it's absolutely impossible to get realistic non-linear light appearance over various distances. Get the matter into your hands and scale objects directly.

Edited by bac9
Link to comment
Share on other sites

TBH I don't really want to use additive quads at all, but there didn't really appear to be any other solution for a hundred+ light sources. The most successful version was using custom mips to fill the quad at distance, but that wasn't all that great either. I think I'll have to look at the shader route ( which is going to involve learning a lot more about shaders... so much for quick & easy models! ). That is not going to stop the source being culled though, hm.

Your runway lights have the usual cross shape plus a circular pool, no idea what shader but it's not one of the usual ones I think. Some trickery was used there.

Edited by Van Disaster
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...