User Tag List

Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 34

Thread: New 3d Perspective Shader

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,553
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    New 3d Perspective Shader

    It's not finished, optimized or ported to DX11 yet, but just thought I'd show off my progress so far, since I know a few people have been waiting for a shader like this, and there are some others who like tinkering with shaders...

    Download: https://1drv.ms/u/s!Atq7cUIJ7uextFeh...5y2G4?e=2EPfES



    Not sure why there are visual artifacts at the edges...

  2. #2
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,575
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Amazing shader!
    What's left to do?
    About DX11, Android, iOS/Mac port, let me know if you need help with that!

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,553
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Cheers!
    The code needs commenting, and variable names need changing to something more descriptive, so those people interested in how it works can understand what's going on (it's actually pretty simple, believe it or not).
    There's room for optimization - doing the 3D rotations by matrix multiplication, for example.
    I'll probably add a "zoom(-out)" parameter, so you don't need to add an empty border around the image.
    I'd like to fix those visual artifacts at the edges somehow...
    I'm not promising anything, but there's also the potential for lighting effects (Phong shading, specular maps...).

    I definitely won't be porting to Android/iOS, as I don't have any means of testing on those runtimes. I should be able to do a DX11 port, but I might not get around to it for a while... So yeah, go ahead if you want to - or maybe wait until there's a more "final" version.
    As always, anyone is free to modify, share and use the shader in any way they like.


    EDIT: If you set the border to transparent instead of white, those visual artifacts go away

  4. #4
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,575
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Lighting effects would be fantastic!
    And what you mean by set the border to transparent instead of white? I thought sampler_state were already doing that...

    Well, zooming out would definitely help a lot, I think I can add it

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,553
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    I've changed it now, but the original picture of the dog had a white border. That was necessary because otherwise as the image rotates, it no longer fits the object and bits get cut off (hence the idea of a zoom-out parameter). I thought that since the background of the frame was white, you wouldn't be able to see the border, but for some reason there are those ugly visual artifacts at the edges. But if you use a border of transparent pixels instead of white, those disappear.

    I can't quite tell if this example:
    https://www.youtube.com/watch?v=UGTSnUnkltM
    ...is using per-pixel lighting or not?
    You might be able to get that effect by just having a "highlight" layer overlaying the card, and varying its opacity according to the angle of the card. That would be more efficient that doing it in the shader anyway, since it's then one calculation per object, not one per pixel.

  6. #6
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,575
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Well, on the video it has a fingerprint overlay that has some blending mode to it...
    I'm not sure if that's per-pixel or just a overlay...

    Btw, here's my ports, proper alpha channel support included, also added a zoom parameter (this has all files, not just the port)
    Should work on DX11, Android, iOS/Mac!
    Attached files Attached files

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,553
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    That was quick! Nice work

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Wodjanoi's Avatar
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    675
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Very cool idea, MuddyMole. Thanks!
    So, a Phong Shading effect would be realizable as well?
    You are blazingly fast with code conversion process, NaitorStudios!
    btw @NaitorStudios - did you actually receive the test archive with gimp files etc. from my latest shader topic?


    Besides Windows EXE Runtime - are most other Exporters already capable to interprete these specific shader controlled transitions correctly?

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleFirefly 3D ModuleInstall Creator Pro
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,690
    Mentioned
    34 Post(s)
    Tagged
    0 Thread(s)
    Wow, I remember an example with a rotating ace of spade card, yet it's perspective was all off. This is perfect, thank you so much

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,553
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    I've noticed (and should have anticipated) that the shader only works perfectly with square textures, so if your object is not square, you should add transparent margins to make it square. I have a feeling this would be tough to fix.

    Flat shading is not too complicated, but I'm still not sure if it's a good idea to put it in the shader. As mentioned earlier, it's probably better to do the calculations once using CF2.5 events, rather than repeating them for each of the texture's thousands of pixels in the shader. Per pixel shading probably isn't worth it anyway, since we're only talking about simple flat surfaces without shadows, multiple light sources, etc.

Page 1 of 4 1 2 3 ... LastLast

Similar Threads

  1. Is there a shader likes the Perspective obj ?
    By callofAS in forum Fusion 2.5
    Replies: 2
    Last Post: 8th June 2020, 10:28 PM
  2. Replies: 0
    Last Post: 18th October 2018, 07:07 AM
  3. Replies: 0
    Last Post: 7th October 2016, 05:07 AM
  4. Perspective shader issue - incorrect distortion
    By Ramses in forum Shader Development
    Replies: 5
    Last Post: 11th August 2016, 08:23 PM
  5. looking for offset shader, underwater shader, etc
    By neorocker7 in forum Fusion 2.5
    Replies: 9
    Last Post: 18th May 2015, 03:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •