A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by slice3d, Jul 10, 2012.
Before updating, could you confirm if it is a bug?
Just disable any hardware anti-aliasing in your project settings and use AntialiasingAsPostEffect.js instead from the Unity's standard Image Effects (Pro only) package. Using hardware anti-aliasing with any post-processing effects is useless, because this will not work with renderTextures in Unity - highlighted outline edges will remain aliased. This problem is not particularly noticeable in other post-processing effects because they don't combine anti-aliased framebuffer with aliased rendertexture as my Highlighting System does.
Everything will be fine if you'll use AntialiasingAsPostEffect.js on top of HighlightingEffect.
void OnRenderImage(RenderTexture source, RenderTexture destination)
gives me 1-pixel vertical offset. Looks like a Unity bug.
If anybody knows why this happens - please, point me out to the solution on how to avoid that.
It's only here if you use hardware anti-aliasing.
As documentation says - it is not recommended. Use AntialiasingAsPostEffect instead.
Thank you for you answer. I would be happy to change AA settings as you suggest unfortunately AA is disabled already. E.g. I use your "Color" demo (so no special camera post effect scripts). I´ve made sure that AA is disabled in "Quality" settings. I checked "Forward" and "Deferred" rendering. In all cases I can see that issue clearly...
Hi, reporting, it deploy on S3, the highlight will grow very huge to fill the whole screen, instead of small highlight. This happens with sample project.
Which Unity version do you use?
Looks like they've fixed this 1-px offset bug in Unity 4.1, that I mentioned in my previous post.
May be this will help in your case also, but it looks like imprecision of a RenderTexture on your graphics card.
Sorry, but what is S3 stands for? Samsung Galaxy S3?
I´m using Unity 4.1. As you can see in the screenshot the issue is not a pixel offset bug since it is not only visible on one side but at the edges all around the objects. I would be happy to support you in tracking that down. So if you can recommend how to further debug that issue e.g. analyzing intermediate results, I would give it a try.
Yes, Samsung Galaxy S3
Thank you for your willingness to help!
Check your PM here.
Demo scene, from the Highlighting System imported to fresh empty project gives you this results on S3, but in the Unity Editor everything works fine?
If so - then this is Android + Unity problems. You just can't imagine what a terrible problem with the compatibility of all Android devices / drivers / etc.
We are having trouble getting this to work with lightmapped objects. I can set up an object so that it works, then lightmap it, and the effect no longer shows (no error messages or other indication it isn't working). Has anyone used this successfully with lightmaps?
Baking the included "colors" demo kills the highlights - so this is definitely a bug, or an unimplemented feature, lol. Is there something that we can modify in the source to make this work? Any ideas?
Thanks for your report!
Researching this problem now...
Thanks for the quick follow up slice3d, much appreciated.
The latest update of the highlight effect doesn't work well with SSAO effect. if we use highlight effect the SSAO will not showed up. Is there any workaround for this?
I think it happened also with the first version.
Now that's funny, it works in me with the first version
Thanks for the bug report!
If you have problems using Highlighting System with SSAO, then open HighlightingEffect.cs, find this line:
and right after it, add:
shaderCamera.depthTextureMode = DepthTextureMode.None;
Now it should work with SSAO.
Update: No longer required since version 3.0!
No information about lightmapping problem yet. Working...
Thanks working on it: SSAO is a usefull effect.
Hi, any update on the lightmapping problem yet? I just ran into this.
Here is a quick and dirty workaround until the package is fixed. Add a second, non-baked copy of the object you want to highlight to your scene. Set the position of your new object so that it matches the baked object. Add the highlight component to the non-baked object. Create a new, empty material and set it to transparent/diffuse. Apply this new material to the object you just added to the scene. Now, set the alpha value of the new material to black (Click on the main color of the material and move the bottom slider marked "A" to the left so it's value is black). Now you have a highlight working with your baked objects..
This is a terribly dirty workaround. We've considered taking that leap as a last resort, but I really hope this gets handled soon. I'd rather not duplicate 100+ scene objects and manage them in software. Yuck.
Sorry for the delay!
But there's no in-depth information available about how lightmapping works in Unity.
Finally, I've found where the problem is - lightmapping does something with vertexlit rendering path used for replaced rendering.
Here's the hotfix:
In HighlightingEffect.cs, find:
shaderCamera.renderingPath = RenderingPath.VertexLit;
and change this to:
shaderCamera.renderingPath = RenderingPath.Forward;
Update: No longer required since version 3.0!
Thanks!!!! This worked for me.
Hey slice3d, just upgraded from an older build of the highlighting system and I'm seeing two issues:
1. I'm using a script attached to the player to block highlighting from showing through him as per our last discussion (while back) : ) - however since the update i'm seeing a definite outline to him now ... cool effect but i'd like to avoid it if possible.
public class PlayerHightlight : MonoBehaviour
void Start( )
HighlightableObject ho = transform.GetComponent<HighlightableObject>( );
ho.ConstantOn( Color.black );
2. Objects that I've assigned to be highlightable appear black now
Used when item is picked up:
// now that the player has picked up this weapon, turn off highlighting
PlayerHightlight playerHighlight = weapon.transform.GetComponentInChildren<PlayerHightlight>( );
if( !playerHighlight )
Used when item is dropped:
// we no longer care about blocking out highlights through this item, so check for and remove ph script
PlayerHightlight playerHighlight = weapon.transform.GetComponentInChildren<PlayerHightlight>( );
if( playerHighlight )
GameObject.DestroyImmediate( playerHighlight );
Any thoughts on what has changed to make this code ineffective?
one important thing - it is not available to use multiple HighlightableObject components in one hierarchy branch (Highlighting occluders are also HighlightableObject's).
HighlightableObject searches for Renderer components in all child objects, caches them and then does rendering with replacement shaders. Consequently, if there are multiple Renderer components catched by multiple HighlightableObject's - rendering goes wrong!
It is easy to make work-around in HighlightableObject's InitMaterials() method where it uses GetComponentsInChildren functions, but then Highlighlighting System will lose it's universality.
I recommend you to just apply components in a different nonintersecting hierarchy branches. For example:
In this case, SkinnedCharacterMesh object will act as occluder for Weapon1 and Weapon2 objects.
Update: No longer valid! Nested highlighted objects supported since version 3.0.
Thanks, that fixed worked for me. Works on iOS as well.
Ok that fixes the weapons showing up black, awesome thanks for the quick reply!
I'm still seeing that black fuzzy outline (depending on view angle) on the player, is there any way to get around that? Can we set the highlight colour to 'transparent' or something? Ultimately i'd prefer just being able to "block" highlights from passing through an object without the sillouette if possible - the older release supported this so i must be missing something !
With worn items etc, I can just remove the HighlightableObject script when its picked up but not so much with the player itself - it seems to come down to "always on" option in the Player Hightlight script i posted earlier.
Ideally a script you could drop on a given object to make it "block" highlights from camera would be great.
Hey Slice, any thoughts on how to make my player a highlightable object (constanton) to avoid other highlights clipping through him but at the same time have a transparent/no visual highlight? I'd like to get rid of this effect (black border around him): http://screencast.com/t/g1cl47uw7u
Have you tried to use hccluderOn() on your character instead of ConstantOn?
And don't forget to set the 'Use z-buffer' checkbox on the HighlightingEffect component.
It almost works - when I'm not highlighting something all is well: http://screencast.com/t/gy0h6LXyt
But when I highlight another object in the scene (separate hierarchy), I get this: http://screencast.com/t/woK8ttpeoh
My HighlightingEffect is set like so: http://screencast.com/t/wnjA3jhty7O
I'm sorry, but currently there is no way to avoid this inner glow going to the occluder from other highlighted objects.
But as you can see in this post, rea wanted to achieve just such effect for their projects. Why you want to avoid that?
I want to avoid the character being highlighted and having highlights show through him. The highlight effect is being used in my game to indicate an interact-able object. So for instance, if you are looking at a door to interact with, I want the player to see the door frame highlighted, but NOT through the player (player should obscure the object beneath).
I had this working pre-update ... maybe I can dig up an old version of the highlighting system from a previous backup, it worked fine before - seems like a regression to me. To be honest, I can see a lot of uses for some kind of "OccludeWithoutHighlighting" behaviour in this kit - for instance if you have a diablo approach to seeing lootables in your range, you might want to allow for some things (walls, floors, ceilings, players, etc), to block the highlighting without themselves having to be highlighted.
Adding an example of what I mean, off my old TPC build, see here: http://screencast.com/t/8i7h2UH9xZXI
Ok, but I think this is not a big problem for your game.
As you can see on the screenshot below, highlighting occluders in Diablo 3 gives similar results to my Highlighting System:
Building here is the occluder for the door object. See this little glowing border on the part occluded by the building?
It's not too noticeable and as for me, it looks better than just roughly cutted glow.
Right, so what happens if that player is in front of the door and partially covers the highlighting effect? Does it show through the player or highlight around him or does it just get obscured by the player? I'm guessing the latter (haven't played since diablo 1 so its been a while lol). Anyhow, I'll rollback the version I guess and go from there - for me the player *must not* be included in the highlighting nor should they have highlights passing through them ... maybe we can take this to private chat and i can show you some code - this seems like a really obvious use case so maybe i'm not describing my intentions well enough.
Alright, so my approach here is just to rollback and use the older Hightlighting System which behaves as I'd expect, just to be clear - my thought is not so much what is right/wrong for an individual project just why this no longer works in the new release. Here is a SS describing exactly the difference between old vs new HS releases, the old one I've rolled back to is on the left side and the new on the right side - both use identical code and involve ONLY a package update:
Notice the wall IS highlighted, to indicate it is interactable, the only difference here is that the player is now being included in highlight rendering - I'd like to basically have the player ignore all highlighting and always appear over top of highlighting - this is what the old release supports so i guess that's where i'm staying .
Visual behaviour of the Highlighting occluders has changed because I've implemented completely different compositing shader in the 2.0 update, with which it became possible to display actual highlighting colors. Note how the wall highlighting color differs on the left and on the right sides of your screenshot.
I can't say that this new highlighting occluders behaviour is a drawback of 2.0 update, at least because this is how they work in many other famous games.
I'm sorry if it's not work as you've expected, but for now there's nothing to do with it.
May be some day I'll find the solution how to keep old occluders behaviour with the new compositing solution.
Thanks for your feedback!
No problem Slide, I understand - thanks for the incredibly awesome asset !
How can I remove the plugin completely? I have tried all sorts of things. I have tried to locate every occurrence of where we have used the plugin, and removed those, but every time I try to remove the plugin itself, and then try to run the program in the editor - the editor crashes - HARD! This makes it doubly difficult to remove the plugin since we have no information as to where the editor is crashing.
Yes, I have used the Editor's search capability as well as searching the scripts in my project. Can't find anything so far.
Is there something I'm missing? The system is wonderful - if you can afford the performance hit. We can't, and we'd really like to remove it completely. Please help me exorcise this from our project.
= Ed =
You must admit that the Highlighting System is not a virus or something...
There is not even any dll's with the hidden code.
Simply remove all files from the package in your project(s) - and you're done.
Complete file list depends on the versions of the Highlighting System you have used.
You can see whole list of package contents for the latest version here, for example: http://u3d.as/37m
In Short - remove:
If the problem persists after removing all these files and folders - then it is not caused by the Highlighting System.
P.S.: After all your messages about hard Unity Editor crashes - it is become clearly that there is something wrong with your PC / Mac / OS / Unity installation.
I recommend you to make complete OS and Unity reinstall.
Thanks! Glad you liked it!
The only hard crashes I have ever had have been with the Highlighting system, but perhaps you are correct. In any event, all of those are gone, but I will keep looking.
Thanks for the help.
= Ed =
I tested the highlight from Echo Core shader framework, and it works fine. Please try to fix, I bought it for mobile, if it doesn't work, I have to ask for refund.
At first, please check that you set the 'Use 32-bit display buffer' checkbox in your player settings.
Second - which version of the Highlighting System do you use?
Third - have you tried to build and install the Highlighting System demo (assembled on fresh empty Unity project) on your device? Does it works?
Fourth - how did you set the Clear Flags for your camera with applied HighlightingEffect? Please try different settings for this.
Highlighting in Echo Core shader framework works completely different from my Highlighting System.
As I see, instead of using post-processing for that type of thing, it just pushes out vertices of the highlighted objects, plus does some rimlighting in pixel shader (both of these techniques described here http://docs.unity3d.com/Documentation/Components/SL-SurfaceShaderExamples.html and you can implement this type of highlighting by yourself after doing some research).
This techniques may be cheaper for mobile platforms, but it also gives you worse results - only rough flat highlighting, thickness of the highlighting depends on the object's silhouette and even object orientation to the viewing camera, no lerping between framebuffer (probably, you'll not see highlighting on bright backgrounds), and I doesn't know if it even can handle compound objects correctly.
But if it cover all your needs - it's up to you to request a refund if we will not resolve all your issues.
32 bit display on - default settings.
Highlighting System 2.0
New empty project.
No change, all defaults. I just import on a new project and build. On PC it works fine.
I've been using Highlighting System with forward rendering, and I love it - it's an integral part of my game.
I just switched to deferred rendering and it's no longer working. It's not a big deal, I don't have to use deferred rendering, but is this a known issue?
Do you have the latest version of Android OS on your device?
May be you should try to run your project on different (older/newer) versions of Android OS?
Sorry but I can't do much with that. I just can't have every device available on the market for the testing.
Probably, if it works in Unity and doesn't work on your S3, and you use Unity for Android Pro (not just Unity for Android) to build your game for mobile device, then this happens only because some Unity for Android Pro features are not fully supported as stated in this feature list.
In this case only Unity Technologies can (and must) fix this. You should report this to Unity Technologies or ask for a refund if you can't wait for the fix.
Thanks! Glad you find it useful for your projects!
Hope to play your game in the near future
By the way, here's the new video from cool guys at gamesfoundry. They use Highlighting System in production of their own game Folk Tale.
Also, I've spotted that Richard Garriott (Creator of the Ultima series) also used Highlighting System for their upcoming game Shroud of the Avatar.
Nope, I use Highlighting System in deferred lighting mode for my own game and it works fine.
Please give me more info about your case (Unity version, Mac/PC, Project Settings, used post-processing effects, etc.).
LOL - if your definition of "the near future" includes mid-2014, then yes, I'll be posting a demo then. Still a huge effort ahead, but it's so much fun!
I'm using Unity Pro 4.1.2 on a Mac laptop (NVIDIA GeForce GT 650M 1024 MB). I'm not specifically using any post-processing effects yet (unless an asset I'm using is calling them). I'm using deferred lighting, linear color space, dual lightmaps with "use in forward rendering" checked, and soft shadows. If I deselect "Use Lightmaps", I still get the issue.
Reproducing the issue is easy: if I switch to Deferred Lighting, highlighting doesn't appear, but if I switch back to Forward Rendering, it immediately works perfectly.
Highlighting System is awesome and if we can't locate the cause, I'd prefer to forgo using Deferred Lighting rather than remove HS.
Android 4.1.2, I have android unity pro. S3 is a fairly new phone just release less than 6 months ago.
This issue is solved. I'm using HS with Ultimate FPS Camera, which uses a second weapon camera in addition to the main camera. If I disable that camera and switch to Deferred Lighting, Highlighting System works again (and looks fantastic!).
I've implemented a workaround using a shader posted by someone else who was having issues with image effects with Ultimate FPSC.
May be that's the reason why some Unity features required for the Highlighting System are not fully supported on this device yet, and we just have to wait for an update? (will it be the drivers update or Unity update)
Cool! May be you can post your workaround here for other Highlighting System + Ultimate FPS Camera users, or at least give us a link to this shader?
Thanks in advance!
Sure, it's described by makeshiftwings towards the bottom of this page: http://forum.unity3d.com/threads/126886-Ultimate-FPS-Camera-RELEASED/page77
If you disable the weapon camera and just change the shaders on each weapon prefab to point to the new shader, HS and UFPS work perfectly together in Deferred Lighting mode.