Search Unity

Counter shader

Discussion in 'Assets and Asset Store' started by ZoltanErdokovy, May 16, 2014.

  1. ZoltanErdokovy

    ZoltanErdokovy

    Joined:
    Aug 23, 2012
    Posts:
    102
  2. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
    Nice 1
     
  3. PabloAM

    PabloAM

    Joined:
    Dec 25, 2012
    Posts:
    35
    Hello Zoltan. First of all thanks for this awesome shader.

    I have a question.

    I would like to do a a kind of counter like the game "Make it rain": (Minute over 1:45)


    I have create a function in "CounterExpample" Script where I change the target, but the behaviour of the shader moves so slow if I pass a number more than 10.000.

    Could you help me in order to raise that question?

    BTW, Is it compatible with Mobile devices?? I cant see it on Android version :S

    Best Regards!
     
    Last edited: Jul 10, 2014
  4. ZoltanErdokovy

    ZoltanErdokovy

    Joined:
    Aug 23, 2012
    Posts:
    102
    Hello PabloAM, thank you for buying the asset!

    That "flip clock" counter is possible to do but it would need a somewhat complex shader. A much simpler solution is actually rotating a quad polygon in front of another and swapping textures: lighting and shadows would be working out of the box and the shaders involved could be very simple too. Another way would be rendering the frames into a texture and using it on sprites. It would need more memory but the shader would be cheap.

    Regarding the slow counter: the current game logic (starting at line 47) is implementing a really crude ease-in/ease-out functionality, just as an example. You could adjust the "minSpeed" and "maxSpeed" variables but I recommend writing your own solution, tailored for your needs. I'd probably use an AnimationCurve to have precise, visual control over how the material parameters change over time.

    Unfortunately I can't test the shader on mobile. Do you have any kind of log or error message which could help narrowing down what goes wrong?
     
  5. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Interested in mobile too. Make apk for us to test
     
  6. ZoltanErdokovy

    ZoltanErdokovy

    Joined:
    Aug 23, 2012
    Posts:
    102
    I'm going to install the android SDK and see if I can export the example project.
     
  7. ZoltanErdokovy

    ZoltanErdokovy

    Joined:
    Aug 23, 2012
    Posts:
    102
    I can't make an apk for the example scene:

    Error building Player: Win32Exception: ApplicationName='C:/Android/adt-bundle-windows-x86_64-20140702/sdk\tools\zipalign.exe', CommandLine='4 "D:\Projects\ZSpline-Counter\Temp/StagingArea/Package_unaligned.apk" "D:\Projects\ZSpline-Counter\Temp/StagingArea/Package.apk"', CurrentDirectory='Temp/StagingArea'

    Any ideas?
     
  8. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Really cool asset! Just bought a copy :)
     
  9. ZoltanErdokovy

    ZoltanErdokovy

    Joined:
    Aug 23, 2012
    Posts:
    102
    Thank you! :)
     
  10. PabloAM

    PabloAM

    Joined:
    Dec 25, 2012
    Posts:
    35
    Thanks for reply Zoltan.
    I wanted to Android and iOS but is not compatible.

    A buy to trash :(

    Thanks anyway.
     
  11. ZoltanErdokovy

    ZoltanErdokovy

    Joined:
    Aug 23, 2012
    Posts:
    102
    I'm sorry to hear that PabloAM. What is actually happening in the scene? Do you have an error message or a crash log which might help me narrow down the problem?
     
  12. BFips

    BFips

    Joined:
    Jul 29, 2014
    Posts:
    7
    ZoltanErdokovy I'm having the exact same error making an apk for my application. Could it be the adt-bundle version?
     
  13. ZoltanErdokovy

    ZoltanErdokovy

    Joined:
    Aug 23, 2012
    Posts:
    102
    BFips: Unfortunately I have zero experience with mobile development so I'm afraid I can't help you.