I’ve been playing with projectors and gotten quite confidant making my blob shadow, but is theere a way to use the same technique to, instead of painting black onto stuff, paint transparency?
I’ve tried plugging different shaders into the projector and just end up with garbage results like whole objects glowing when the projector is aimed at them, so i guess maybe im barking up the wrong tree.
SIMPLIFIED, is there a way to point a projector at a plane, and punch a transparent hole in that plane? i want to to move, so that an ixnay on the alpha map
holy crap dude, thats awesome! even looking at the example, i have no idea how you did it
im in a sticky spot though and not sure if i’ll have time to use it (im setting up a demo for a friday meeting), but if i do can i have your permission to use what you’ve made in my scene?
it’s only temporary, and i’d gladly send you what I’ve done next week
Read the EULA I included in the project… it clearly states that you can’t use this for anything other than poking round holes in checker textured spheres…
But seriously, please share whatever crazy game ideas you come up with using this… I’d love to see them.
The problem with the approach taken in that unitypackage is that unless you stack multiple cameras, your holes cut all the way to whatever your camera clears to. Here’s a solution to that.
I used the simplest possible shader for the plane that’s getting a hole cut in it. The shaders system is just a couple lines, so feel free to cut and paste into a more robust shader, and ask me if you need any help.
Also, for some reason, what Ethan posted doesn’t work in Unity iPhone, even with emulation off. What I’m posting does work on the iPhone. Ethan, should I try to figure out what’s going on, and log a bug, or is this a known issue?
I have been looking at the unity package you provided above and find it very intruiging … I would like to use it for a Fog of War mechanism, that I am making for an RTS game. The idea is to place a projector with you transperency projector shader above any units in the scene, such as to cut holes in a Fog of war mesh situated between the camera/projectors and the units/objects in the scene. It works like a charm as long as only one projector is utilised to cut a whole in the mesh, but when more than one projector is utilised, the wholes in the fog of war mesh dissappear …
So do you have any ideas, as to how one could utilize multiple projectors to cut multiple wholes in a mesh?
I do have an idea, and this seems to work fine in Unity, but it doesn’t in Unity iPhone. I’m not confident that Unity is utilizing rendering queues properly: it seems that unless I separate them by large values, things break. If anyone can educate me about that, please do. It seems to me that “Geometry+1” should be as good as “Geometry+500”, but I don’t actually know what this stuff does, inside a GPU.
Anyway, for the time being, until anyone can supply something more reliable, check this out. It’s the same as the last project, but I rewrote the hole projecting shader, hopefully yielding a performance gain. And then, there’s a shader/material called “Transparency Projectors”, to go along with Transparency Projector". You need the “Transparency Projector” before you can use the “Transparency Projectors”, but after you have one “Transparency Projector”, you should be able to add as many “Transparency Projectors” as you like.
Thanks for the great solution to projecting a hole true a poly surface!!!
… I am making a game, were I would like to project holes true one layer at a time… If I use your shader, than ALL of the surfaces whit the “transparent via projector” shader becomes transparent…!!
… Its is a game about an archaeological dig!!
Is it not possible to only have the transparency happen on ONE layer at the time(seen from above)!!!
Thanks for the great solution to projecting a hole true a poly surface!!!
… I am making a game, were I would like to project holes true one layer at a time… If I use your shader, than ALL of the surfaces whit the “transparent via projector” shader becomes transparent…!!
… Its is a game about an archaeological dig!!
I it not possible to only have the transparency happen on ONE layer at the time(seen from above)!!!
Sorry to come to this conversation so late; but this is just what I’m looking for. Jessy, your solution seems to work great, except that the surface that’s getting the hole has that super-simple shader (which you explained).
I’ve been trying to buff it up to allow for the shader to take a texture map, but it’s proven to be such a dark art (shaders still escape me). My latest attempt (based off of the straight diffuse - which doesn’t work) looks like this:
Thanks andeeee. I think the biggest problem is that I don’t know what I’m doing
Anyway. I think I got a shader to work. I just simplified way back. This is what works:
Shader "Hole Shader" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGBA)", 2D) = "white" {}
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="False" "RenderType"="Transparent"}
LOD 200
Pass {
// The alpha is supplied by the projector.
Blend OneMinusDstAlpha DstAlpha
//This just defines the texture
SetTexture [_MainTex]
}
}
Fallback "Transparent/VertexLit"
}
This works alright. Although if there is not a projector providing the alpha then the entire object goes clear or Unity crashes. Not sure if there are ways to do conditionals in shaders. It might be that I need to swap out shaders via javascript when I instantiate a hole-creating projector.