Search Unity

IndieEffects: Bringing (almost) AAA quality Post-Process FX to Unity Indie

Discussion in 'Assets and Asset Store' started by FuzzyQuills, Sep 2, 2013.

  1. ploca14

    ploca14

    Joined:
    Apr 7, 2014
    Posts:
    10
    I have a syntax error but i have no idea how to fix it :( SnytaxError.jpg
     
  2. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Huh?! I thought I got that fixed! :mad:

    Hang on... :D

    EDIT: Right, THIS SHOULD WORK! :)
    Code (csharp):
    1. #pragma strict
    2. var vignette : Texture2D;
    3. var mat : Material;
    4.  
    5. function Start () {
    6.     mat = new Material ("Shader \"Custom/VignetteBlend\" {" +
    7.     "Properties {" +
    8.     "_MainTex (\"Texture\", 2D) = \"black\" {}" +
    9.     "}" +
    10.  
    11.     "SubShader {" +
    12.     "Pass{" +
    13.     "blend SrcColor OneMinusSrcColor" +
    14.     "SetTexture[_MainTex] {combine texture}" +
    15.     "}" +
    16.     "}" +
    17.     "}");
    18. }
    19.  
    20. function OnGUI () {
    21. if (Event.current.type == EventType.Repaint) {
    22.     Graphics.DrawTexture(Rect(0,0,Screen.width,Screen.height), vignette, mat);
    23. }
    24. }
     
    Last edited: Oct 2, 2014
  3. ploca14

    ploca14

    Joined:
    Apr 7, 2014
    Posts:
    10
    It still doesnt work :( same error :( and sreen is still pink :(
     
  4. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Ok... I actually tested the code above, and it should work... :confused:

    EDIT: re-paste the code above, if it still doesn't work... :mad: :D :) o_O
     
  5. ploca14

    ploca14

    Joined:
    Apr 7, 2014
    Posts:
    10
    Maybe i am doing something wrong :(
    EDIT : I tried to re-paste it but i have still the syntac error and my screen is still pink :(
    ScreenShot001.png
     
    Last edited: Oct 2, 2014
  6. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
    quickfix would be, add 1 space in this line: (after word OneMinusSrcColor <--
    Code (CSharp):
    1. "blend SrcColor OneMinusSrcColor " +
     
    ploca14 likes this.
  7. ploca14

    ploca14

    Joined:
    Apr 7, 2014
    Posts:
    10
    Thanks now it is working :)
     
  8. Alkanine9

    Alkanine9

    Joined:
    Mar 5, 2014
    Posts:
    11
    idk how, sure, I could google but there must be a reason why DX11 is installed so I don't want to mess around with it :p
    Also, taking in account that more modern devices today would rather have DX11+ than DX9-, maybe you should generally look into the problem - as an excuse to my customers for why the game won't work cannot be "your computer is too good" XD
     
  9. fusecore

    fusecore

    Joined:
    Oct 3, 2013
    Posts:
    16
    Hi, is there any chance for a Pixelated shader?
     
  10. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @aleichert:
    No, no, I mean't in the unity project! :confused: turn DX11 off if you're using it! :) There is often weird syntax problems that can make a shader pink, I get it all the time! :D

    And yes, there is such a thing as "too good..." that's why DOSBox exists! :p

    @fusecore: if you mean mosaic fx, I am pretty sure 0tacun posted one here somewhere. time to dig around for shaders! :D (Or i can go find the post for you, if you like! :))
     
    fusecore likes this.
  11. fusecore

    fusecore

    Joined:
    Oct 3, 2013
    Posts:
    16
    I found it, thank you! :)
    Also, because I went though the posts of the first 11 pages I've come to appreciate the sheer amount of work that went into this, THANKS YOU VERY MUCH to everyone who contributed!

    I'm still messing around with getting it working, but I just wanted to ask if that was the best way to achieve what Notch did with Shambles. http://shambles.notch.net/
    The Dithering is very nice, but not reallyyyy needed, just a low rez look.

    EDIT:
    I can't seem to get the shader working, I probably did the files wrong.
    I took his javascript and put it in "JS Classes" as Tile_Effect.js
    And the shader in "ShaderDir/Normal/TilesEffect.shader"

    After dragging the Tiles_Effect.js to my camera, I need to add the shader to the component (otherwise nothing happens)
    Then I run and I get a white-ish screen.

    I did have to change a variable name because it was giving an error.
    blurMat.SetTexture("_MainTex", IndieEffects.RT); was IndieEffects.renderTexture
     
    Last edited: Oct 3, 2014
  12. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @fusecore: if you have latest indieEffects, give me the script, and I will modify it to work with latest version. (the effect was made with an earlier version, of which is no longer supported)
     
  13. fusecore

    fusecore

    Joined:
    Oct 3, 2013
    Posts:
    16
  14. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @fusecore: ok, try this:
    Code (csharp):
    1.  
    2. #pragma strict
    3.  
    4. @script RequireComponent (IndieEffects)
    5. @script AddComponentMenu ("Indie Effects/Tiles Effect")
    6.  
    7. @HideInInspector
    8. var fxRes : IndieEffects;
    9.  
    10. var edgeColor : Color;
    11. var numTiles : float = 8.0;
    12. var threshhold : float = 1.0;
    13.  
    14. @HideInInspector
    15. var blurMat : Material;
    16. var tilesShader : Shader;
    17.  
    18. function Start () {
    19.  
    20.     IndieEffects = GetComponent("IndieEffects");
    21.     blurMat = new Material(tilesShader);
    22. }
    23.  
    24. function OnPostRender () {
    25.     blurMat.SetTexture("_MainTex", fxRes.RT);
    26.     blurMat.SetColor("_EdgeColor", edgeColor);
    27.     blurMat.SetFloat("_NumTiles", numTiles);
    28.     blurMat.SetFloat("_Threshhold", threshhold);
    29.     FullScreenQuad(blurMat);
    30. }
    This should work. as for the white screen... if it appears again, give me a screenshot of the command console for further diagnosis! :)

    Also, give a guess at what OS I am typing this from! :p
     
  15. fusecore

    fusecore

    Joined:
    Oct 3, 2013
    Posts:
    16
    I hate to keep bothering you, but do I not have the newest version?
    http://screenshu.com/static/uploads/temporary/1x/bu/5s/99ecqc.jpg

    To remove errors I:
    Replaced
    IndieEffects = GetComponent("IndieEffects");
    With
    fxRes = GetComponent("IndieEffects");

    And removed the comments above the shader file.

    I still get 'Trying to read pixels out of bounds' on
    "RT.ReadPixels(Rect(camera.pixelRect.x,camera.pixelRect.y,textureSize,textureSize), 0, 0);"
    But for example the invert shader works.

    If I apply the tiles effect, my screen just goes blank. The only error is still:
    Trying to read pixels out of bounds
    UnityEngine.Texture2D:ReadPixels(Rect, Int32, Int32)
    IndieEffects:OnPreRender() (at Assets/IndieEffects/Classes/IndieEffects.js:106)

    Every frame.

    (infact, most filters result in a white-ish screen, would it be because I use 4.6 beta?)
     
    Last edited: Oct 3, 2014
  16. ploca14

    ploca14

    Joined:
    Apr 7, 2014
    Posts:
    10
    How do i use the bloom ? when i apply it my screen is very pixelated :(
     
  17. Seth-McCumber

    Seth-McCumber

    Joined:
    May 26, 2013
    Posts:
    141
    +1 would love :D
     
  18. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @Seth: fusecore found 0tacun's pixel shader in this thread somewhere. try a forum dig, and I am sure it was on page 11 or something.

    @fusecore: it looks like your texture size is set too high. (or somehow, you set it to 0 instead... :D) re-adjust so both width & height are lower than screen res.

    And 4.6 beta shouldn't be an issue. it is most likely because you stuffed up the texture size.
     
  19. Seth-McCumber

    Seth-McCumber

    Joined:
    May 26, 2013
    Posts:
    141
    @FuzzyQuills I cant seem to get it to work, just keeps on breaking with the PSOD(Pink Screen of Death :rolleyes:)
     
  20. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @Seth: I definitely saw where you got that from, PSOD... :D

    Anyway, what's in the console? o_O And is it the package overall, or just the pixelation shader?

    On second thought, a pink screen means either the shader has errors, or it isn't assigned. this can be the case if you got the GitHub version, as it is only recommended for people who know what they are doing.

    It's also probably time I pulled down the GitHub files and made a new unitypackage file with them. the unitypackage hasn't been given an update in months! :D
     
  21. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Hi, does anyone have the God of Rays FX from FrostBite please? I couldn't find it in the thread, and I also read it that he may also not have released it! :(
     
  22. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Also, I'm using Unity 4.5.1f3 and all I get is a pink screen. Could anyone please explain me how to fix that? Thank you.
     
  23. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @NeatWolf: Anything in the console? Also, if it's the DoF shader, there is a weird issue on some computers where the shader won't compile: I am attempting to figure out why this is. And no, mr. frosty hasn't released it yet. in fact, I wonder where the heck he's gone to... o_O
     
  24. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
  25. Seth-McCumber

    Seth-McCumber

    Joined:
    May 26, 2013
    Posts:
    141
  26. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Me too, but that one uses raycasts, and requires everything has a collider.
     
  27. AAA_Dev

    AAA_Dev

    Joined:
    May 20, 2014
    Posts:
    11
    Hi guys,

    just a quick question: This system can only run 1 post effect per scene right? I'm unable to load both Anti-Aliasing and Bloom in the same scene. When I include both effects on the camera, only one of them loads up. Did I miss a step?
     
  28. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Well, the reason for this is because I stopped using blend modes in the shaders. (And that was because of weird artifacts when some shader combos wen't wrong... :D)

    For AA and bloom, that's an easy fix: just make the final bloom pass use "blend One One" (Additive blending) and both should work. (Also warning you, unless you downloaded the GitHub version, of which has old texture system support, the AA will probably fail on you... :D)

    EDIT: And it's probably about time this project picked up the pace again... Once it's past 30th November, I may pull down the current GitHub contents and make an updated Unitypackage so new users don't have to assign all the vars themselves. Will also see how I will go about adding motion blur to the scene again, as I have been doing a reasonable amount of research on per-object solutions, and now have an idea of how to implement it.
     
  29. Tepei

    Tepei

    Joined:
    Mar 29, 2014
    Posts:
    32
    I love so much the antialiasing that fix a lot of my shader problem thanks !!)

    Is it possible to assign the renderTexture to an another object material ?

    So much thanks !
     
  30. Tepei

    Tepei

    Joined:
    Mar 29, 2014
    Posts:
    32
    I finaly find it ! Very easy but i was assigning the texture on function start before it was created..
     
  31. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Yep, I did have an example bundled with it long ago that did that, but I ended up deleting it... :D Should probably include one in next release, no? o_O :)
     
  32. Alkanine9

    Alkanine9

    Joined:
    Mar 5, 2014
    Posts:
    11
    Please! I don't even know if I am using all of the shaders right lol
     
  33. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Heh... Yes, apparently, if I include the meta-data, everything is auto-assigned when imported. makes sense, as the meta-data is the way Unity stores per-asset settings.
     
  34. mightybob

    mightybob

    Joined:
    Mar 23, 2014
    Posts:
    75
    Hi, I decided to re download your unity package and see if I could use the simple bloom effect. (not the starbloom) After deleting the motion blur classes, there was no errors, but when putting the shader onto a mesh it simply turns pure black. No shading whatsoever. If it helps to find out whats wrong, the mesh has lightmaps on it.
     
  35. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    The bloom effect is also for the camera like the starbloom. As far as I know there is no glow shader to make individual objects glow in Indie Effects
     
  36. mightybob

    mightybob

    Joined:
    Mar 23, 2014
    Posts:
    75
    (edited) Got bloom to work, but everything appears super pixelated. Even looks worse than 360p. Am I doing something wrong, or is that just how it is with bloom?
     
    Last edited: Oct 25, 2014
  37. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
  38. mightybob

    mightybob

    Joined:
    Mar 23, 2014
    Posts:
    75
    (rushes to unity download page) (hopes this isn't just some cruel joke)

    EDIT: No, but really, are you serious?
     
    Last edited: Oct 26, 2014
  39. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
    Those screenshots are from unity free (and oculus now works with unity indie, it uses rendertextures)

    but did some more tests, there are limitations:
    - Seems to work on .exe build
    - Doesn't work on webplayer builds

    will do more tests tomorrow..
     
  40. mightybob

    mightybob

    Joined:
    Mar 23, 2014
    Posts:
    75
    I just did a test, apparently none of them are supported on Android.
     
  41. mightybob

    mightybob

    Joined:
    Mar 23, 2014
    Posts:
    75
    Just did another test, are you sure you are using Unity free? None of them work, because for them to work you need deferred lighting but deferred lighting needs unity pro, and thus none of the image effects render. Could you please explain as to how you got your image effects working?
     
  42. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @mightybob, @mgear: It should work in webplayer build, how come it works on my web link?!

    Anyway, I use ReadPixels for this, and that's why I suggest not trying to go full HD for this pack, as it will be REALLY SLOW on a low-end computer.

    And yes, I give this away for free! :) and that was because I got sick of people charging for their stuff... so I made one instead! :D
     
    Eric2241 likes this.
  43. mightybob

    mightybob

    Joined:
    Mar 23, 2014
    Posts:
    75
    @FuzzyQuills If you read the posts carefully, we aren't talking about your pack anymore. Although I'm still wondering why it looks like even worse than 360p with your bloom effect. I know it'd be slow, but isn't it just a little useless when its that low quality?
     
  44. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
    Ok, it seems to work still :)

    Have to import oculus package and run it once, then you have rendertextures available (for that session?)

    (blog updated for the instructions)
     
  45. mightybob

    mightybob

    Joined:
    Mar 23, 2014
    Posts:
    75
    Thanks for the tutorial, a bit annoying how I have to open that scene up for each session but totally worth it!

    Also, many other pro assets suddenly work now such as pro water. Still need to try out some other ones, but that advanced 3D water just looks awesome :O
     
  46. Devastator TF2

    Devastator TF2

    Joined:
    Oct 26, 2014
    Posts:
    2
    Thanks for posting something like this! For some reason when i add the effects on it says trying to read pixel out of bounds. How can i fix this. This is what my screen looks like: rekt.png
     
  47. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Your texture resolution is bigger than either the width or height of the screen. lower it a little until it's lower than your screen res.

    @mgear: I definitely need to look into this patch... Any ideas of how to get proper access to it?
     
  48. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
    It might work with the current 4.5.5 release also (not tested),
    if not, then these: http://unity3d.com/unity/qa/patch-releases
    And can get the oculus package from their site, its free to signup that developer account.
     
  49. Devastator TF2

    Devastator TF2

    Joined:
    Oct 26, 2014
    Posts:
    2
    Thanks. That fixed it!
     
  50. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Here's what I get when I press play in the editor with the default provided scene (IndieEffectsFinal), on Unity 4.5.1f3:

    Errors.jpg

    The referenced missing behaviour is in the main camera between Depth of Field and Chromatic Aberration.
    The last three errors all refer to the same line.

    Of course, I get a pink screen. Any idea on how to fix this? Thanks

    EDIT: by deactivating the SSAO_C5100 script everything works except if I use a 1024 resolution as a sampling texture. It hangs Unity.
     
    Last edited: Oct 28, 2014