Search Unity

Detonator Explosion Framework isn't working in build

Discussion in 'Editor & General Support' started by hdaMonkey, May 16, 2014.

  1. hdaMonkey

    hdaMonkey

    Joined:
    Jul 4, 2013
    Posts:
    14
    Hey,

    lately I'm playing around with the Detonator Explosion Framework (free version from Asset Store). Everything works fine, when running the game in Play-Mode, but when I build the game, the explosions aren't initialised. Everything else works, though.

    Has somebody an idea why? (I'm using unity 4.3.4f1 free)

    Cheers,

    Monkey
     
  2. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    yeah amazing assets

    unfortunately it just broken with unity 4.5.0

    Code (csharp):
    1.  
    2. 'tex2Dproj': no matching 2 parameter intrinsic function; Possible intrinsic functions are: tex2Dproj(sampler2D, float4|half4|min10float4|min16float4)
    3.  
    while the error message says the problem is on line 37 the actual error appears to be on line 38

    Code (csharp):
    1.  
    2. half4 col = tex2Dproj( _GrabTexture, i.uvgrab.xyw );
    3.  
    it looks like tex2Dproj no longer supports type xyw

    the thing is its extremely hard to find anything on tex2Dproj and xyw and what could be done and even why it happened... did someone remove xyw support in shaders for tex2Dproj recently?

    or is it some other problem?

    hopefully someone with knowledge of shaders will figure it out and fix this great asset it for all of us...
     
    Last edited: Jun 4, 2014
  3. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Bump, having this issue too with 4.5.1 but with Tasharen Water.
     
  4. regy42

    regy42

    Joined:
    Feb 16, 2013
    Posts:
    8
    Same problem for me :-(.
     
  5. DarKAleX8991

    DarKAleX8991

    Joined:
    Feb 12, 2013
    Posts:
    2
    For Tashren Water in unity 4.5.1. I somehow found the problem in the shader in this line(search with CTRL+F):

    Code (CSharp):
    1. half3 projTC = UNITY_PROJ_COORD(IN.proj0);
    and change with this:
    Code (CSharp):
    1. half4 projTC = UNITY_PROJ_COORD(IN.proj0);
     
    Last edited: Jul 17, 2014
  6. felipedejesus145

    felipedejesus145

    Joined:
    Nov 22, 2012
    Posts:
    7
    hi there, I know this is an old thread,but I found that the error
    Code (CSharp):
    1. 'tex2Dproj': no matching 2 parameter intrinsic function; Possible intrinsic functions are: tex2Dproj(sampler2D, float4|half4|min10float4|min16float4)
    was fixed by changing the Use DirectX 11 from the Player Settings.
    Guess there are some problems with it.
     
  7. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Was this ever solved? Having the same problem.
     
  8. gevarre

    gevarre

    Joined:
    Jan 19, 2009
    Posts:
    132
    Bumping this. I also need an answer to this. Now my whole project is unworkable.
     
  9. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    263
    Hey guys, I wrote Detonator (a long time ago, before the Asset Store existed) and just recently have started to give it some love. I submitted an update to the Asset Store but just started seeing this error even afterwards. I'm actively looking for a resolution now. If anyone has one please drop a note and I'll integrate it. Sorry for the inconvenience!
     
    FiveFingers likes this.
  10. Chronixxas

    Chronixxas

    Joined:
    Mar 18, 2014
    Posts:
    1
    I fixed it by doing:

    float2 uv = i.uvgrab.xy / i.uvgrab.w;
    half4 col = tex2D( _GrabTexture, uv );

    But then there was also an error in the FillDefaultMaterials() when running in build mode with development mode. For my needs I could just comment that section out though as I didn't need it.
     
  11. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    This seems to work for me. Thank you.
     
  12. SirGravy

    SirGravy

    Joined:
    Jan 4, 2015
    Posts:
    2
    I had this issue recently (with Unity 4.6.3f1) and was able to resolve it by adding the Detonator-TestWall scene to my game's build.
     
    Javier_8 likes this.
  13. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,532
    I thought the shader issue was sorted in the original Detonator forum thread? I don't think he ever pushed it to the store though. Doesn't really update it very often.
     
  14. Javier_8

    Javier_8

    Joined:
    Oct 12, 2014
    Posts:
    17
    FINALLY!!! I got it working on Andriod! It worked fine in the Editor, but when exporting to Android (Samsung Galaxy S4, Android 4.x) It just didn't work.
    I had to add the TestScene that comes with this package to the "Scenes in Build".
    Don't ask me why that worked, but it worked, I have a deadline so I can't stop to investigate, but it worked. I also added the Fix to the shader posted by Chronixxas a few posts above and added the resources to my Resorce folder (don't know If these 2 had anything to do with it working, but I'm posting to give more info to anyone reading this post in the future).
    But MAINLY it worked when I added the "Detonator-Testwall.unity" scene to the "Scenes in Build".

    The corrected version of the HeatDistort shader:

    Code (CSharp):
    1. half4 frag( v2f i ) : COLOR
    2. {
    3.     // calculate perturbed coordinates
    4.     half2 bump = UnpackNormal(tex2D( _BumpMap, i.uvbump )).rg; // we could optimize this by just reading the x & y without reconstructing the Z
    5.     float2 offset = bump * _BumpAmt * _GrabTexture_TexelSize.xy;
    6.     //i.uvgrab.xy = offset * i.uvgrab.z + i.uvgrab.xy;
    7.     float2 uv = i.uvgrab.xy / i.uvgrab.w;
    8.  
    9.     half4 col = tex2D( _GrabTexture, uv );
    10.     //half4 col = tex2Dproj( _GrabTexture, i.uvgrab.xyw );
    11.  
    12.     half4 tint = tex2D( _MainTex, i.uvmain );
    13.     return col * tint;
    14. }
    15. ENDCG
     
    MKhuram021 and azinicus like this.
  15. vasefa

    vasefa

    Joined:
    Jul 23, 2015
    Posts:
    1
    The real results may be : the imported Detonator is under "Standard Assets" folder, so when build, it maybe discard some resources of Detonator.
    My solution is move its resources, scripts ... into your "Assets". then delete the “Detonator” in Standard Assets.
    modify its Detonator.cs:
    Texture2D tex = Resources.Load("Detonator/Textures/Smoke") as Texture2D;
    change to your new path. For example, my path is Assets/Resources/Textures/Smoke. so I change it as:
    Texture2D tex = Resources.Load("Textures/Smoke") as Texture2D;
    there are 8 places in Detonator.cs should be modifyed.

    And it works on Android, no need to add the TestScene into the "Scenes in Build".