Search Unity

Spiderweb Generator

Discussion in 'Assets and Asset Store' started by kalagaan, Mar 10, 2017.

  1. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501

    Spiderweb generator is a tool for designing spiderweb within the unity editor.
    You can create spiderwebs which fit exactly with your scene. The geometry tool is really easy to use, the UI is displayed in the scene view for a fast design.

    The procedural shader generates unique customizable spiderwebs in no time!
    You can choose to use the procedural shader or bake it into a texture and share it between spiderweb objects.
    Each spiderweb can cast shadows, this really improves the visual of your game.



    Asset store link
     
    Last edited: Mar 31, 2017
    P_Jong and Hikiko66 like this.
  2. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    Comming soon on the assetstore :)

    Edit : Available HERE
     
    Last edited: Apr 3, 2017
    LaurieAnnis likes this.
  3. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    Here a screenshot of the UI

     
    P_Jong likes this.
  4. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Cool!
    Do you have an example of the web strung between only two surfaces, like the ceiling and a wall, or a tree limb and tree trunk?
     
  5. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    Here a screenshot ;)
    this demo scene is included in the package.

     
  6. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
  7. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    Looks really good. Do you have an idea on the price?
     
  8. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    I've submitted it to the assetstore : 20$
    It should be available next week :)
     
  9. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    Here a lighting test :)

     
    Last edited: Mar 11, 2017
    P_Jong and punk like this.
  10. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    Available at the asset store :)
    HERE
     
  11. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    This looks nice! I imagine it would be difficult, but any chance this could be used in real time, like a giant spider that creates webs?
     
  12. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    This is a procedural shader, so you can modify it in real time :)
    I could try to update the shader if you need a specific feature ;)
     
  13. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    Are the web shapes always on a plane, or could they be more 3D, like a cone?
     
  14. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    Ah dude, you make the most useful plugins! bought
     
    kalagaan and hopeful like this.
  15. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    You can move each control points (borders & center) , so you could create a cone :)
    It's really easy to add and to remove control points with the tool.
     
    hopeful likes this.
  16. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    Thank you!
     
    Last edited: Apr 2, 2017
  17. ZeroKuhl

    ZeroKuhl

    Joined:
    Sep 4, 2015
    Posts:
    2
    It looks like a great package.

    1. Are the assets mobile ready?
    2. Do the webs have motion - like moving in the wind?

    Thanks!
     
  18. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    1. Yes, it works on Android (didn't try on iOS):
    geometry is really low poly and the procedural shader works.
    You can also bake the spiderweb to a texture or use another shader ;)

    2. Not yet, I'll add this feature in the next version ;)
     
    hopeful and punk like this.
  19. ZeroKuhl

    ZeroKuhl

    Joined:
    Sep 4, 2015
    Posts:
    2
    Great.
    Thanks for your reply.
     
  20. altugs

    altugs

    Joined:
    Jan 14, 2017
    Posts:
    17
    Just bought the asset, and unfortunately it does not work. The web shape is in complete purple and I have many error messages related to generator and its shader. Is it a compability problem for unity 5.6? (My scene is in linear lighting and deferred rendering path.)
     
  21. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    I did additionnal tests on unity 5.6.0f3 and 5.6.2f1, all works as expected (linear/gamma & forward/deferred).
    Could you try to import the package in an empty project?
    If you still have the problem, please, send me an email (contact@kalagaan.com), I'll help you to fix it.;)
     
  22. altugs

    altugs

    Joined:
    Jan 14, 2017
    Posts:
    17
    New project works fine, thanks. (mailed you the errors from my project)
     
  23. Marquessa

    Marquessa

    Joined:
    May 28, 2017
    Posts:
    4
    Is there a way to make it tear if something walks or moves through it?
     
  24. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    No, in the current version spiderwebs are static.
    But I think that I could create some kind of tearable spiderweb with the cloth component.
    I'll think about it ;)
     
    P_Jong, hopeful and punk like this.
  25. Rumbleboxer

    Rumbleboxer

    Joined:
    Dec 26, 2012
    Posts:
    27
    Hey man how goes it with the cloth component? I'm looking for a solution where the spiderweb is indeed able to be affected by the wind or has it's own flowiness.
     
  26. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    I won't use the cloth component, it's not very stable for each unity version...
    I'll work on a wind FX in the shader (performances will be better than using cloth), but this is not yet available.
     
    StevenPicard and mons00n like this.
  27. AvalonGamingZone

    AvalonGamingZone

    Joined:
    Jul 23, 2017
    Posts:
    5
    This asset is really cool and procedural ! Has a Substance Designer user I know that you can achieve a lot with something procedural ^^ I currently have two issues with this asset... if placed between two light source, the transparent part become not fully transparent... Dunno why... The second issue with it is maybe not an issue by itself is the fact that the control point are moved in function of the view and it is not very easy to place them correctly in the 3d space but I imagine that with a bit of training I could achieve what I want ^^ Bydaway thanks for your excellent work !
     
  28. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    Thank you ;)
    Could you send me an email (contact@kalagaan.com) with some screenshots of the lighting issue ?
    I can add a "3-axis control point" option ;)
     
  29. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    I've pushed a new version to the asset store with a 3-axis handles option. ;)
    Edit : The version (1.0.5) is already available! the asset store submission was very fast :)

     
    Last edited: Feb 5, 2018
    hopeful likes this.
  30. EvalDaemon

    EvalDaemon

    Joined:
    Aug 8, 2013
    Posts:
    107
    Could you please demonstrate some code of adding a new web with anchors given vector3 world positions. I have these points (5 to 6 of them) but am struggling on how apply the positions to anchors update the procedural shader.
     
  31. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    Here a sample of a procedural spiderweb generation ;)

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using Kalagaan.SpiderwebGeneratorExtension;
    4.  
    5. public class GenerateSpiderweb : MonoBehaviour {
    6.  
    7.     public SpiderwebGenerator m_generator;
    8.     public int refreshCount = 0;
    9.  
    10.     void Start () {
    11.  
    12.         //create a new spiderweb
    13.         m_generator.m_spiderWebLst.Add(new SpiderwebGenerator.SpiderWeb(gameObject));
    14.  
    15.         //modify the anchors
    16.         Vector3 worldPos = Vector3.one;
    17.         m_generator.m_spiderWebLst[0].m_anchors[0].m_position = transform.InverseTransformPoint(worldPos);
    18.         //add new ones
    19.         worldPos = new Vector3(1,1,0);
    20.         SpiderwebGenerator.SpiderWeb.Anchor anchor = new SpiderwebGenerator.SpiderWeb.Anchor();
    21.         anchor.m_position = transform.InverseTransformPoint(worldPos);
    22.         m_generator.m_spiderWebLst[0].m_anchors.Add(anchor);
    23.  
    24.         //change the center of the spiderweb
    25.         Vector3 center = Vector3.zero;
    26.         for (int i = 0; i < m_generator.m_spiderWebLst[0].m_anchors.Count; ++i)
    27.             center += m_generator.m_spiderWebLst[0].m_anchors[i].m_position;
    28.         m_generator.m_spiderWebLst[0].m_center = center / (float)m_generator.m_spiderWebLst[0].m_anchors.Count;
    29.  
    30.         //Generate mesh & renderer
    31.         m_generator.m_spiderWebLst[0].GenerateMesh(transform);
    32.         m_generator.m_spiderWebLst[0].GenerateRenderer(m_generator, 0);
    33.  
    34.         //generate and change the shader parameters
    35.         m_generator.m_spiderWebLst[0].m_shaderParams = new SpiderwebGenerator.SpiderWeb.ShaderParams();
    36.         m_generator.m_spiderWebLst[0].m_shaderParams.color = Color.green;
    37.  
    38.         //Update the shader
    39.         m_generator.m_spiderWebLst[0].UpdateShader(true);
    40.  
    41.     }
    42.  
    43. }
     
    NeatWolf and hopeful like this.
  32. Seoyeonchoi

    Seoyeonchoi

    Joined:
    May 8, 2018
    Posts:
    1
    Hi, sorry to bother.
    Is there any simple tutorial? Could you please tell me how to use this plugin?
    and can I bake the light map with this plug in?(if can, how??)
     
  33. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    Have a look to the documentation (Assets/SpiderwebGenerator/Doc/),
    it explains step by step how to use the plugin. ;)
    - Create a new GameObject
    - Add the SpiderwebGenerator component
    - enter the edit mode and use the sliders and the Handler to edit the shape and the shader's options.

    If you want to bake the spiderweb shadows in the lightmap, you have to set the Render mode to 'TEXTURE'.
    And you'll have to set the spiderweb gameobject to static.
    In the current version, each modification will modify the static flag, because the gameobject of the spiderweb is generated. I'll fix it in the next version, it will copy the static flag from the SpiderWeb generator.
     
    hopeful likes this.
  34. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    the version 1.1.0 has been submitted to the asset store and should be available soon :)
    It includes the windzone support.



    Here a GIF
     
    StevenPicard, hopeful and punk like this.
  35. Palanai

    Palanai

    Joined:
    May 3, 2017
    Posts:
    12
    Is it possible to set up spider webs as re-usable prefabs?

    I'd really like to generate a few of them between trees and boulders, save the group as a prefab and then re-use them to decorate the map.

    Right now each time I set them up as a prefab (both with baked textures and in material mode), the actual web is missing if I drag a prefab into a scene. The mesh is missing, and the web is no longer tied to the game object with the spiderweb generator script.
     
    Last edited: Jul 13, 2018
  36. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    Thank you for the feedback,

    In the current version the web meshes are not generated when the prefab is instantiated.

    Here a fix for the script SpiderwebGenerator.cs :

    Code (CSharp):
    1. void Awake()
    2.             {
    3.                 m_lockedPosition = transform.localPosition;
    4.                 m_lockedRotation = transform.localRotation;
    5.  
    6.                 for (int i=0; i<m_spiderWebLst.Count; ++i )
    7.                 {
    8.  
    9.                     //here the fix
    10.                     if (m_spiderWebLst[i].m_mesh == null)
    11.                         m_spiderWebLst[i].GenerateRenderer(this, i);
    12.  
    13.                     m_spiderWebLst[i].UpdateShader(false);
    14.                 }
    15.             }
     
    StevenPicard and hopeful like this.
  37. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Hi there!

    I've been keeping an eye on your asset, pretty unique, and it's great to see how it got better and better! :)

    I haven't purchased it - yet ;) Yet, I'd love to know (yup, I'm very shader focused lately, sorry about that :p ), since the material+shader pair play a great part in the whole asset:
    Note: please take this in the most positive way possible, this is kind of a wishlist, since a lot of this could be already there :p

    1) Is the shader PBR ready?
    2) Is it double sided only?
    3) Is improving the included shader a priority at the moment? That is, are we going to be able to work with randomized world-space textures which seamlessly blend with probes and the native lighting system, possibly with some soft-particle attenuation (Z depth) near the edges?
    4) Is the shader both shadow casting, shadows receiver, 2 sided, normal mapped and, soft-edged with proper depth sorting? :p
    5) Translucent and back-shadow receiving? (well, ok, I know that's a lot of wishes)
    6) Capable to generate textures of given resolution, with H number of hooks and L number of loops, with T thickness?

    I see that some basic coding is required, but I feel that would be great if it worked like (I can't know how it works at the moment):
    a) Drag a prefab in the scene, set position and orientation
    b) An integrated component automatically raycasts against geometry according the indicated plane (OnDrawGizmo), and a few parameters like number of hooks, max Distance, random position offsets using the spiderweb local space
    b2) ...and templates for that, to use and reuse the same settings consistently
    c) Ready to use methods to add a single (or more) hooks at runtime - single call.

    extending this to a new level of automation, would be also cool if
    d) Could procedurally automatically spawn inside a volume, crawling and looking for crevices, in a way similar to AO.

    finally

    e) Realtime in-editor preview of b) :p (that is, reflecting the changes as you rotate/move the dynamic raycasting prefab around)

    Have you got a roadmap of features you'd love to implement?

    Please don't hate me :D
    EDIT: I found the docs, apparently a lot of my wishes are already ready out of the box :)
     
    Last edited: Sep 5, 2018
  38. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    1) Yes the shader is PBR
    2) this is 2sided only
    3) I'll continue to improve the shader. The shader is based on the standard lighting.
    4) the shader cast shadows, I'll add a normal map.
    5) no translucent and back shadows yet.
    6) you can bake the texture in different size from 64x64 to 4096x4096 :D
    You can set a lot of parameters like with, radius, shape...

    The process is really simple :
    - add a generator to an empty object.
    - add a new spiderweb object
    - move it in the scene and add some anchors with the tool.

    There's no automatic raycasting tool.
    It would be a lot of work for this kind of tool I guess... :confused:

    You can duplicate spiderwebs, or copy/past the parameters.

    Don't worry, I don't hate you :p
     
    Last edited: Sep 6, 2018
    NeatWolf likes this.
  39. baconbap

    baconbap

    Joined:
    Sep 13, 2013
    Posts:
    3
    Has anyone had any luck making this work with URP? currently all the shaders come out pink.
     
  40. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    the shaders are not yet compatible with URP/HDRP
    I'll work on an update ;)
     
  41. baconbap

    baconbap

    Joined:
    Sep 13, 2013
    Posts:
    3
    Awesome ! I tried myself but got lost in the wizardry.
     
    kalagaan likes this.
  42. Mike891

    Mike891

    Joined:
    May 18, 2019
    Posts:
    23
    Is it working in 2020? UAS version is of 2018.
     
  43. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    Yes, it works with Unity 2020 with the built-in render pipeline.
     
    StevenPicard likes this.
  44. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    The version 1.2.0 will be available soon on the assetstore.
    It includes the URP compatibility. :)
     
  45. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    @kalagaan I just purchased this and am creating my first spiderweb. Everything seems to work as explained in the documentation, but I am not able to change the web's color. When I click on the color or even the eyedropper tool, it just ignores it completely. I'm using Unity 2019.4.13f.
     
  46. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    It looks like a bug in this version of unity :confused:
    You have to use the 'hand tool' for selecting the color in the UI.


    I'll test with other versions of Unity.
     
    hopeful likes this.
  47. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Hi, can this asset create other "webby" things besides spider webs, like nets or hanging cables/chains/ropes?
     
  48. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    No, it only generates the spider web mesh.
     
  49. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    How is the performance of the shader, when not baked into texture.
     
  50. kalagaan

    kalagaan

    Joined:
    May 27, 2012
    Posts:
    1,501
    You can use the procedural shader, but if you need to instantiate a lot of spiderwebs, it would be more efficient to bake the textures.