Can I 'hack' this screen effect in Unity Free?

So! I’ve been planning and prototyping for a 3D space flight sim, and I have a notion about how to improve the visibility of distant vessels in keeping with the style I’m going for. I’m not certain this is the right place to be asking, but I’m not sure exactly where that would be.

Rather than explain in detail, I’ve made an image depicting the effect(s) I’d like to achieve. I imagine I cannot do any of this in Unity Free because I can’t use RenderTextures - but is there perhaps an alternate method to RenderTextures which could be an aesthetically-pleasing and computationally-efficient hack?

For instance, for a false overlay effect, could I add a material to vessels - like a shadeless animated noise texture? It wouldn’t be a camera-relative overlay as pictured here, but it might be close enough… I could really use more ideas like this!

Thank you very much for any input or suggestions!

I doubt anyone would use rendertextures for this, not sure what you want with them for this anyway ^^. But the GL stuff could be handy, but not avail in free either!

So the noise can be archived using replacement shader, multipass shader or simply changing the material of the cube…

The wireframe can be done with a lot of things… Maybe Linerenderer, or write your own by simply creating very thin, camera facing planes with the line material…

Just some quick thoughts, in Pro I would do this differently…

The easiest way to do an Outline all effect without PostFX, is to duplicate the mesh, invert the normals, change to a flat colour shader, and scale it out slightly.

It’s not gonna be easy on your poly count, but it is definitly an easy way to get a sorta pen and ink outline effect.

Thanks for the replies! :slight_smile:

I’m not sure how I could swing this by rendering lines or billboarded planes as lines, because it wouldn’t be outlining the silhouette seen by the camera.

With rendertextures, I imagine I could render a mask culling everything but the vessels in question, then use that to render an outline around them or whatever else overlaying them. Or am I misremembering what RenderTextures are for? Darn it all, in XNA render targets and masking stuff is free! :slight_smile:

Thought about the scaled-up mesh idea, but almost threw it out outright because of the massive amount of additional polys. Is this really a feasible thing or likely to be kind of nasty-looking even in the best case scenario?

It’s possible that simply changing the material to be a shadeless (not sure of my jargon, I mean no shadows, self-lit) animated noise effect will be my best bet, even though outlines sure would be cool. Maybe some day I can get that pro license…!

Thanks again folks. Further replies welcome.

You can make the noise in Screen space if you know your shader code. I don’t know Unity shader language that well, but essentially take the Pixel shaders input (which is normalized projection space coordinates(0 to 1, or -1 to 1 if I recall) and a depth value). Then just sample a noise texture and add it to the existing pixel colour. You can add manual shifts to animate it or use a perlin noise function directly, but overall if you use the Pixel shaders input coordinates you should be able to keep the effect in screen space rather than world space but avoid using a whole new Post effect.

Thanks for the additional info.
Wouldn’t working in screen-space imply a need to mask off the silhouettes (as seen by the camera) of the meshes I want to draw noise over? Or otherwise know which pixels the mesh is drawing to? And doesn’t that involve a Pro feature?

Perhaps I’m misunderstanding. I understood your explanation of actually adding noise, but to what, exactly? Don’t feel obligated to be technical, it’ll be a long time before I’m ready to work on this - I just want to know whether the feature would be feasible so I can adjust my expectations.

In the Pixel Shader you do all the original calculations but also add a Noise colour value to that pixel for that objects. That way any objects with that material will have a screen space noise effect on it. Because it is on each pixel rendered for visible faces, but works in world space, it’ll only work on pixels visible on the objects specified to use that material. In HLSL you would do a Tex2D call with the x,y of the input parameters of the PixelShader and add it to the other calculations. In Unity’s shader syntax I have no idea.

Essentially you add the noise when rendering each face, rather than afterwards so you don’t need to handle any sillouettes.

Got it! Not that I have the slightest clue how to go about implementing it, but I understand your idea conceptually now. Sounds like a perfectly viable option to me.

When the time comes to work on that feature, I’ll have a good place to start. Thanks a lot for your time and patience.
:slight_smile: