Search Unity

CORE-Framework with 100+ mobile ready shaders [RELEASED]

Discussion in 'Assets and Asset Store' started by echologin, Dec 8, 2012.

?

What version of Unity are you using ?

  1. 3.5.x

    19.0%
  2. 4.0

    6.1%
  3. 4.1

    78.0%
Multiple votes are allowed.
  1. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078

    Ill add that shader to my to-do list, just have to get a small framework update submitted and my next asset out 1st ( shouldn't be long )
     
  2. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    ;)
     
  3. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Hi,

    i bought your packege
    Well done and Congrats echologin keep up the fantastic work!

    Dev
     
  4. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078

    Thank you !
     
  5. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Last edited: Aug 26, 2013
  6. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Wow, looks crazy in a good way :p where did you utilize CORE shaders? For all geometry? Or only meshes (some/most/all)? Terrain is Unity out-of-box shaders, or CORE, or some other shaders?
     
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Glad to see the framework getting the attention it deserves. It's essentially making default unity an entirely new engine in some cases (especially speed wise) - silly thing to say but it's how it feels.
     
  8. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Wow that looks good !. ill check out app on device now
     
  9. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Is there a way to tweak bumped-specular to at least approach Unity 4.2's mobile bump-spec-1light shader (from Standard Assets Mobile) in terms of quality? I mean the specular in the built-in shaders actually produce bumpy specular highlights, whereas the Core framework version just produces fairly random "lighter or darker diffuse" variations with no real specular highlight. I'm just testing with the standard cube mesh here which has only a handful triangles, so maybe your specular is per-vertex rather than per-pixel or something? Would appreciate some insights here on how these things do stuff differently than out-of-box, without having to decipher your crazy-optimized shaders codez :D
     
  10. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    OK I took two comparison shots, first one with specularity sliders at half-way and second one at max:

    $unity-core-specular-mid.png

    $unity-core-specular-max.png

    Now, first things first, the specularity indeed just seems to be per-vertex. OK fair enough. Do you have plans for a "per-pixel but still using CORE's bag of mad optimizationz" version? Or could I hereby register my interest for such a thing to be put in the future-development pipeline of core framework? :D

    A second thing is the much flatter-looking "darker/unit areas" you'll notice compared to oob. Now maybe the preview for oob uses ambientLight of #000000 while the preview for core uses my scene's render-settings ambientLight=#808080. But I notice similar "washed out flatter less-bumpy low-contrast" shading for core in-scene, in-game compared with oob. Can show a few more screenshots if you're interested. A number of bump-spec materials look very low-fidelity compared to Unity's oob mobile shaders. The "prototype materials" free package from Asset Store is pretty great for testing such things, so if you don't have them might wanna grab them.

    Look forward to your input on this :)
     
  11. TriplePAF

    TriplePAF

    Joined:
    Aug 19, 2009
    Posts:
    246
    Would it be possible to assimilate unity's mobile shaders into the framework? :confused:


    Kind regards,


    Peter.
     
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I think they're already in the framework - just improved, faster and with different names. If you list which ones you're interested in it will help.
     
  13. helioxfilm

    helioxfilm

    Joined:
    Apr 23, 2008
    Posts:
    259
  14. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Yea its possible to make the specular more realistic with a little speed cost. ill keep that in mind for future update
     
  15. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Eventually i will make framework unity4 only and rewrite shaders, to use the per material properties, at that point i may just make them per pixel, or have option for that ( since devices are getting fast enough now to handle that )

    The flatter looking effect from ambient light is same problem as specular and how i add up all the light in scene for speed.
    ( ill keep all this in mind for future updates, right now im trying to get a bug fix update out and one new asset to sell )

    ( tho i will probably add the more detailed specular before that )
     
  16. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Do you mean to use effects and other options in framework ? ( that will be coming soon )
     
  17. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    I will be selling a postFX asset soon that can do similar effects.
     
  18. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    For PostFX would be particularly great if it could put together multiple post-effects in a single shader pass.

    Right now, from how I understand Unity's post-processing, each ImageEffect added to the camera represents an individual backend render-texture and its own associated frag-shader call, ie. program switch. Program switching always has some cost and RenderTextures consume not just vram but also bandwidth, and this pipelining system of Unity always bugged me a bit. It's ultra-flexible and all, but produces needless overhead. Say I want to do desaturation down to 0.8, then vignette, then tone-map. In a custom-written GL program (in C or whatever), a custom-written single GLSL quad frag shader can do all this in a single main() pass with a single input render-texture. In Unity, this would be 3 render-textures and 3 program-switches. (Unless I misunderstand how their post pipeline works.)

    I guess you could do this similarly to the current CORE package where you have a "compile shaders" button.

    Next up, post-fx I'd be primarily interested in would be (A) cheap and simple vignette+chromatic (no need to be quite as fanciful as the current 4.2 version), (B) de/saturation, and (C) whatever tonemapping operators are still fast and useful in LDR (no HDR/Linear in Unity for GL ES 2.x). Yes, even in LDR a TM op (such as the oob Hable, Photographic or OptimizedHejiDawson ones) adds some very agreeable final touches.

    If you can replicate or improve on (or just easily "embed") the 4.2 oob "bloom (optimized)" effect, that'd be freakin' amazin'.

    Any distortions (vortex or underwater ripples etc. etc.) are always neat-to-have of course. But then we have the question of how to switch them on and off dynamically at runtime. Nvm I'm sure this will be sorted somehow.

    Motion blur would be cool in theory but depends on how costly (in perf terms) it would be.. still on the fence whether it's actually ever noticed on smaller screens during fast-paced gameplay..

    Anyway that's just my very personal "fast mobile-friendly post-FX wishlist" for whatever that's worth :D
     
    Last edited: Sep 1, 2013
  19. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    "For PostFX would be particularly great if it could put together multiple post-effects in a single shader pass."

    Exactly what i am doing! How it works you pick options to make a postFX , then if multiple effects are going
    the shader adapts and only calculates each option once on any amount of effects in one pass.

    So its always as fast as it can be in any situation.

    Of course u can choose to have some effects applied after main blit which would be another pass.
    ( like might not want scan line effect warped by heat distortion and so on )

    most if not all effects will be able to fade in/ fade out

    heat distortion can be whole screen parts of screen or follow an object

    lots of cool things ill make a video soon or demo

    ( i should make a new thread for that asset, so this one stays framework only )
     
    Last edited: Sep 2, 2013
  20. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Removed my camera from the scene: now Unity's Scene View reverts to some kind of "unlit diffuse-only" shading. Not a big issue yet, though strange since _EchoRootThingie and main directional light are both still present.

    Added a new camera to the scene: all materials using echoLogin shaders turn pitch black (affecting about 98% of the scene).

    Recompiling shaders: nothing, everything remains black.

    Restarting Unity and recompiling again: all black.

    Restarting Unity, switch to new empty scene, reimporting echoLogin, switch back to original scene, recompiling again: all black.

    Umm, what now? Give up on this project and start from scratch? Give up on CORE framework and manually revert all 10s of materials to other shaders (or in a real-world project, 100s)? Or any ideas what could be going on? Kinda totally kicks me out of a good work flow, stuff like this... really does :mad:

    To illustrate the issue:

    $unity-core-black.png

    At full-res, you'll notice "lit polygon edges" of sorts even though the Scene View is textured, not wireframe -- so the shaders still do something..

    Of course, switching the materials back to out-of-box shaders or even echoLogin unlit shaders works and colors are showing. So how could removing a cam from scene temporarily totally break my echoLogin LIT shaders even to the point of restarting Unity, reimporting echoLogin, recompiling shaders again and again? That's pretty baffling.
     
    Last edited: Sep 2, 2013
  21. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Make sure the camera is tagged as main camera

    I just made framework so if camera is not set it will only turn off the extra 4 lights
    ( only reason camera is needed )

    I will send you link to latest framework in a bit.
     
    Last edited: Sep 2, 2013
  22. helioxfilm

    helioxfilm

    Joined:
    Apr 23, 2008
    Posts:
    259
    Great! We are about 2-3 weeks from launch. Do you think your asset will be ready in that time period?
     
  23. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    I hope so, id like to have it close to being done by end of the week.
     
  24. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Thanks, that resolved everything! Had no idea about this :D much appreciated ^_^

    Regarding my earlier post with specularity: on second thought, playing with a live scene on mobile devices, I don't think per-pixel specular is all that crucially important in my personal case. The faded colors (specular isn't #fff bright though set at #fff, bumpmap-"shadows" not as dark as perhaps desirable) are another thing, but per-vertex specular per se is pretty much just fine for my use-cases. Right now I'm of the mind, I wouldn't even pay 1ms more for per-pixel ;)

    There's another thing I'm wondering. When I do "compile shaders", are the compiled shaders stored per-scene or per-project? Reason I'm asking: there might be an outdoor scene with no point lights -- so we want the better performance of no-point-lights. Then in the same project there might be another scene/level that's completely indoor with point lights. Does the current CORE allow for such varied different shader compilations inside the same project?
     
    Last edited: Sep 2, 2013
  25. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That's a very good point actually.
     
  26. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Cool. Let me know if you need beta testing help. I tried the Fast Bloom provided in U4.3, it drops by fps from 40 to 15 fps on ipad2.
     
  27. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Per scene light options will be in update after next ( want to release a bug fix update 1st )
     
  28. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Do i have u on Skype ? i should have a beta in a few days
     
  29. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Yes of course, my skype id is my nick
     
  30. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Ohh doh, Already have you on Skype sorry lol, so many names / handles
     
  31. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Framework is on sale for 45 dollars until i get next update submitted!!!
     
  32. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    Just bought this morning, really nice package so much different shaders that i am a bit lost. anyway few questions:

    in the doc its said: do not use other shaders, i am using 2D ToolKit shader for 2d game sprites, should i replace them all by your shader? what could happen if i do not replace them?

    If i want to make (on mobile) a kind of Scifi Neon sign, is there a glow shader i can use in the package?
     
  33. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Update on bumped specular:

    did some extensive tests on 2 devices (both HTC with Adreno GPU, one ca. late 2011 / early 2012, the other brand-new), with 2 resolutions each, a scene of under 3k tris and some 30-ish draw calls where all materials are bumped-specular.

    The CORE shader for this performs no better or worse than Unity 4.2's built-in "Mobile/Bumped Specular (1 directional light)" shader. In all cases I'm under the device's 60hz hard cap so it's not that the scene is too simple: with both shaders in all 4 setups I stay under 60fps but performance in all cases is exactly the same.

    Of course, ultimately I won't be using bumped-specular for all surfaces, only for a select few later on. So this doesn't matter too much. BUT Unity's bumped-specular looks so much better! On the other hand I'd like to stay "all CORE" for all surfaces. (So the whole geometry rendering uses the same lighting and shadowing pipeline.) Think you could add a "clone" of 4.2's bumped-specular to the shader collection? That'd be primarily per-pixel specular rather than per-vertex (just my wild guess though) and a somewhat better contrast for the "in-shadow bumps". Would be great to see this in CORE and I imagine if you have 4.2 already, should be "fairly unproblematic" to implement, what do you think?
     
  34. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Feel free to mix and match - it's fine. No bad things will happen if you do not.

    This will probably mean your bottleneck isn't actually shader instruction bound but fillrate bound. In all my tests, the echoLogin shader is faster. Do you have a repro?
     
  35. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Nope because I get the full 60hz if I switch the scene from bumped-specular to diffuse. Also, with such few triangles and draw-calls, that'd really surprise me. On a 2009-2011 smartphone, might be, but on those newer devices I'd be doubtful about this being a fillrate thing.

    Yes generally speaking, overall that tends to be the case for most or almost all CORE vs. Unity shaders. But did you specifically compare CORE's bumped-specular with Unity 4.2's "mobile/bumped specular (1 directional light)" in a scene of all-bumped-specular-material-only surfaces? :D

    If so, then maybe it's an HTC/Adreno thing. I'd still like to kindly ask echoLogin to add per-pixel specular into the CORE lighting-and-shadowing shading framework. Just for the possibility of a 2-triangle ocean plane that still has bumped "waves" and a plausible specular (per-vertex wouldn't be plausible for such a low-tri surface).

    Can make this available if echoLogin and/or you are really interested in testing this out on your devices, no prob! Just confirm and will put it up.
     
  36. Ocid

    Ocid

    Joined:
    Feb 9, 2011
    Posts:
    476
    Any ideas when that will be?

    Been wanting to pick this up for a while now to dig into your shader code but always end up having to use for it real life stuff. Sale makes me want to hold off on getting the car fixed and grab this now :)
     
  37. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    You can mix non core shaders ( where does it say you cant ? )

    using all my shaders most of the time will give you a speed boost ( especially if using lit shaders )

    As for glow you can use the outline/overlay system. ( there is a sample project in asset )
    there is a glow shader in there now but I do plan to make a smoother glow shader for this eventually.

    -Scott
     
  38. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Speed on bumped depends also on what options you have checked in Core Manager.

    can you PM me a screenshot of your settings on core manager ?

    and as hippo pointed out the bottleneck could be something else.
     
  39. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Hard to say i have a release candidate now, but something always come up. minimum a week ( more likely longer )
     
  40. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Yeah if you have a project that be better then a screenshot

    i don't have the same exact hardware, but i do have quite a few android devices and ios.

    Thing to from my tests on android i got more consistent frame-rates.
    like htc evo 4g 5fps unity shaders 55 using mine
    but then Samsung s2 was about the same speed
     
    Last edited: Sep 7, 2013
  41. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Will send you the project in a PM in 1 minute (contains 2 other licensed products so can't just publish online).
     
  42. Mementos

    Mementos

    Joined:
    Sep 25, 2012
    Posts:
    79
    Hey,
    could you may show how the outline shader looks like?ä

    And something not related to CoreFramework, but "echoLogin's postFX's", will it feature something like edge detection?
     
  43. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Last update on my previous "issue". Did some more experiments. Specular is fine, bump is the culprit. Without bump, specular-only in an all-specular scene is fast. Without specular, bump-only in an all-bump scene is below 60hz which is ok and to be expected, but performance is equivalent between Unity 4.2 mobile bump and core-framework bump. However, I have only 2 devices and I'm sure core bump will be faster than Unity's on a large number of devices, especially as the scene scales up. So not complaining or doubting, just updating the thread on my investigations ;D
     
  44. Ocid

    Ocid

    Joined:
    Feb 9, 2011
    Posts:
    476
    Sound. I'll end up buying it either way in the long run :)
     
  45. JayG81

    JayG81

    Joined:
    Sep 4, 2012
    Posts:
    72
    Here's a video of my game utilizing Core Framework v1.2. The video quality isn't great, but it's the best I can do at the moment....

     
  46. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    There is an outline demo on 1st post of this thread.

    Edge detection is not in the current postfx but its something i could add.
     
  47. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078

    Wow thats looks like a cool game!
     
  48. JayG81

    JayG81

    Joined:
    Sep 4, 2012
    Posts:
    72
    I kept the gameplay simple; it's my first Unity game. Unforunately, the video quality is so bad, you can't really see the effect of your shaders and lighting. I'm using the directional light as a spotlight for the siren light. It looks great with the bumpmapped shaders. Also, the reflective shaders really add an extra flare to the graphics. It never really dips below 60 FPS on mobile. I've tested it on the Galaxy S(1) and Galaxy Tab 2.

    (You're asteroid belt script really came in handy too!) ;)
     
  49. echologin

    echologin

    Joined:
    Apr 11, 2010
    Posts:
    1,078
    Sweet !!

    ( I wouldn't even have guessed that it was your 1st game its really good )
     
    Last edited: Sep 8, 2013
  50. JayG81

    JayG81

    Joined:
    Sep 4, 2012
    Posts:
    72
    It's my first Unity game--not my first game. :p