Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[RELEASED] Marvelous Techniques

Discussion in 'Assets and Asset Store' started by Kirnu-Interactive, Aug 22, 2015.

  1. hnstbndr

    hnstbndr

    Joined:
    Sep 8, 2016
    Posts:
    9
    Hi Arto,

    thanks again for the great asset!

    Any chance you add support for multiple light sources to this asset? So far only one directional light per scene seems to be supported for real time shadows.

    Also it looks like the directional light ignores meshes that are in its way (cf screenshot where the light basically shines through the upper mesh).

    Looking forward for your help :)

    Thanks
     

    Attached Files:

  2. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    I try to keep the shaders as simple as possible so there is not going to be multi light support.
    The lights don't account any obstacles so shine through objects like ordinary directional lights.

    -Arto
     
  3. hnstbndr

    hnstbndr

    Joined:
    Sep 8, 2016
    Posts:
    9
    Thanks Arto! Could you kindly point me in the direction as to where to add multi light support and obstacles in your shaders?
     
  4. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    Send me email and I'll give you customMasterShader with multi light support.

    -Arto
     
  5. tomraegan

    tomraegan

    Joined:
    Mar 28, 2016
    Posts:
    98
    Hi Arto.

    Love your shader, but so far I'm unable to get what I'm after at runtime. In the editor it's perfect. Maybe I'm misunderstanding.

    This is the editor shot and is essentially what I'm after. Hopefully the settings are obvious enough.
    marv_01.jpg


    What I get at runtime is this:
    marv_02.jpg

    It's rendering incorrectly and I'm not sure why. Am I misunderstanding layout texture?
     
  6. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    Did you run the UVLayoutGeneratorEditor script on the object?
    Create a empty object, place the desired object as a child. Add script to the parent object and run the script.
    Some of example scenes have this setup so you can study them if you still have problems.

    -Arto
     
  7. tomraegan

    tomraegan

    Joined:
    Mar 28, 2016
    Posts:
    98
    Thanks. I'm onto it now. It still gives me unexpected results from time to time...for example, the pattern before applying the script is different to the pattern after the script is applied. I'll keep working on it.

    I've used a few of the shaders and yours is very powerful. I'm very hopeful it can give me what I'm after. Thanks for your time.
     
  8. PatBGames

    PatBGames

    Joined:
    Mar 28, 2009
    Posts:
    120
    Hi Arto and thank you for this great asset.

    I have a question about the CustomLightingMaster shader:
    Why the Tiling and Offset parameters of the Main Texture aren't visible in inspector, they seem to be used after-all ?

    If I change the shader of my material to "Standard", set values to Tiling and Offset and then reset the shader of my material to CustomLightingMaster, the Tiling and Offset apply to the Main Texture of CustomLightingMaster, and it is what I want, but the trick is a little annoying for my workflow.

    Is it possible to display Tiling and Offset in the inspector, near the "Main Texture Power" parameter?
    According to the workflow you display in your videos, it should be interesting to play with Tiling and Offset for applying a different part of the texture to a model, and easier than duplicate the model and change it's UV.

    EDIT: I've re-watched your video tutorial and It seems that I try to achieve a similar result with a different approach. Taking your 1st tutorial as an example, you are using 1 texture, 1 material, multiple cube models with different UV. I do something similar with 1 texture, 1 cube model UV mapped to the top left of the texture and multiple material using different offset.
    Does my method have a drawback ? What about run-time performance : more models vs more materials ?
    My game is primarily for WebGL (and later for mobile).
     
    Last edited: Oct 5, 2016
  9. Nuugames

    Nuugames

    Joined:
    Oct 5, 2012
    Posts:
    10
    Arto, got a question on your awesome asset. I am trying to set the CustomLightingMaster's transparent flag ON/OFF programmatically using C#. I am using the code below and it doesn't work. Any idea?

    MeshRenderer renderer = gameObject.GetComponent<MeshRenderer>();
    Material material = renderer.material;
    material.SetFloat("_Mode", 3f);

    Edit: [RESOLVED] I dug into the code and found out that this flag is not stored but instead it sets a number of flags to different values. I simulated the setting of the flags and got it to work.
     
    Last edited: Oct 14, 2016
  10. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    Different materials require one draw call(set pass) each so using many materials would be slower. This is ok if there are not many different materials.

    Modern GPUs can handle very big vertex counts even in mobile.

    You have to experiment to find a good balance between different methods.
     
  11. iain-nicholls

    iain-nicholls

    Joined:
    Nov 15, 2013
    Posts:
    5
    Hello Arto
    Thinking of purchasing this asset but before I do can you tell me if this works OK with the HTC Vive VR ? I just bought another shader which although it works with the Vive the frame rate drops right down to a stuttering unaceptable level. (In normal FPS camera it is fine, only when viewed with the Vive in VR). ??? (I am asking this now before I buy any new shaders!) I hope it does! Iain (PC is an 8 core i7 16GB GTX980 so it runs the Vive fine)
     
  12. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    I'm sure the asset works fine with HTC Vive.
    I can give you a trial version for testing so you can test the asset before the purchase.
    Please send PM including your email address.

    -Arto
     
  13. iain-nicholls

    iain-nicholls

    Joined:
    Nov 15, 2013
    Posts:
    5
    That would be great. Sorry, new to this Arto - how do I contact you privately? (PM)
     
  14. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    You have to click on my profile image/link -> Start a Conversation
     
  15. painkiller2007

    painkiller2007

    Joined:
    May 25, 2013
    Posts:
    43
    @Kirnu-Interactive Is it possible to use point lights for lighting on the object using customlightingmaster ?.... Currently only the directional light can affect lighting on the material.
     
  16. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    It's not possible to use 'real' lights with MT shaders.
     
  17. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    72
    For some reason the LightMaxDistance on my SimpleDistanceLightRS shader constantly is reverting to a value of 5 on play. But I need to be be a different value(15). Any idea why it might be doing this?
     
  18. dearamy

    dearamy

    Joined:
    Mar 17, 2015
    Posts:
    68
    I got this error with unity 5.4.3f1

    Shader error in 'Kirnu/Marvelous/TextureAnimationTransparent': invalid subscript 'main_uv' at line 76 (on d3d11)

    Compiling Vertex program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING
     
  19. KYL3R

    KYL3R

    Joined:
    Nov 16, 2012
    Posts:
    41
    Hey, I just bought the package. I cannot get shadows to work: Objects are shaded, but do not cast a shadow on the ground. I opened up the cave scene. See image: http://imgur.com/a/L7qdm

    Demo scene in browser (provided by you) does have shadows: http://imgur.com/a/7G5jp

    How do I get shadows? Why is it not working? Unity 5.4.2
     
    Last edited: Dec 9, 2016
  20. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    You have to enable 'Receive Shadows' from Mesh Renderer and 'Realtime Shadows' from CustomLightingMaster shader
     
  21. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    Sorry for this. Please send me an email and I'll send fixed version for you.

    -Arto
     
  22. KYL3R

    KYL3R

    Joined:
    Nov 16, 2012
    Posts:
    41
    That did the trick, thanks. Was confused, because I expected the cave scene to look exactly like the demo in browser. Works now, so thanks a lot.
     
  23. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Just a very quick question, now that Linear lighting is supported on Android, do you recommend using Marvelous Techniques with Gamma or Linear for best results? Thanks.
     
  24. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    To be honest I don't know very well linear color space. I have newer used it. I think the linear color space is used with PBR so if you are heading that way I suggest using linear color space.
     
    jonfinlay likes this.
  25. Megalithic

    Megalithic

    Joined:
    Apr 21, 2014
    Posts:
    61
    Hey,

    I am having problems with lightmapping and shadsows both real time and baked. What to do? I tried customlight, customlightmaster, customlightsimple with lightmapping on. It doesn't work. Then for shadows I ticked recieve shadows in mesh renderer and activate shadows in the shaders but still no shadows. The only thing that I could do was change the front, right and left colors, ambient related stuff. Lightmapping and shadows that I need are being a pain.

    I am building for android on a very high end PC. I doubt it is anything to with my PC. I can't figure out what the problem is. I import my meshes from 3ds max, I even put 2 UV channels. That didn't work. So I ticked generate lighmap uvs in the import settings but that didn't work either.

    I need your help.
     
  26. Megalithic

    Megalithic

    Joined:
    Apr 21, 2014
    Posts:
    61
    Another question. Did you create a second UV channel in your 3d modelling software and unwrap the model for lightmapping there? That would probably explain why I can't get to work the lightmapping with your asset.
     
  27. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    When importing the model select 'Generate Lightmap UVs' from the model import settings.

    -Arto
     
    rubble1 likes this.
  28. Megalithic

    Megalithic

    Joined:
    Apr 21, 2014
    Posts:
    61
    I have already done that. I tried everything that you have done in your sample scenes and followed your documentation but nothing was fruitful.
    If I apply a unity standard material and then bake my light maps it works fine. But when I apply the custom lighting master material or anything from your asset it doesn't create any AO nor are there any shadows.
    Only realtime shadows are working.
     
  29. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    Can you send me minimal test scene and I'll see what's wrong there.
    Do the example scenes work for you?
     
  30. Megalithic

    Megalithic

    Joined:
    Apr 21, 2014
    Posts:
    61
    Yes they are working fine.
    I have discarded light maps for now. That seems to be a very time consuming process! Lighting effects work just fine for me. But only if I could get the shadows to work .
    Do you know a way I could cast shadows of an object A onto object B without receiving shadows of object B? That would simplify a lot of my troubles!

    Another one, Do you know a way for me to achieve a real time point light or spot light feature?
     
    Last edited: Jan 6, 2017
  31. DenisTilak

    DenisTilak

    Joined:
    Jan 11, 2017
    Posts:
    3
    Hey Arto,

    Is there a way to use normal maps with your shaders ?
     
  32. abhijeet1001

    abhijeet1001

    Joined:
    Jan 6, 2015
    Posts:
    60
    So is there anyway to cast shadow ? when complete world is made up of marvelous shaders ?
     
  33. THEAK472009

    THEAK472009

    Joined:
    Jan 24, 2013
    Posts:
    21
    Yo these shaders are meant for games with minimalist art like Monument Valley, Lara Croft GO, ...Normal maps won't look good with this kind of art style so why implement it XDD
     
  34. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    72
    Hi Arto,
    I have a scene quite like the sample Building scene.
    I am getting good performance on my iPhone, but bad performance on iPad4 using the CustomLightingSoftFog shader. Any suggestions?
    This is my Xcode output:


    -------- Shader compilation failed

    #version 100

    #extension GL_EXT_frag_depth : enable

    precision highp float;

    uniform highp vec4 _ProjectionParams;

    uniform highp vec4 _ZBufferParams;

    uniform highp mat4 unity_CameraToWorld;

    uniform highp mat4 _NonJitteredVP;

    uniform highp mat4 _PreviousVP;

    uniform highp sampler2D _CameraDepthTexture;

    varying highp vec2 xlv_TEXCOORD0;

    varying highp vec3 xlv_TEXCOORD1;

    void main ()

    {

    highp vec4 tmpvar_1;

    tmpvar_1 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0);

    mediump vec2 tmpvar_2;

    highp vec4 tmpvar_3;

    tmpvar_3.w = 1.0;

    tmpvar_3.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/((

    (_ZBufferParams.x * tmpvar_1.x)

    + _ZBufferParams.y))));

    highp vec4 tmpvar_4;

    tmpvar_4 = (unity_CameraToWorld * tmpvar_3);

    highp vec4 tmpvar_5;

    tmpvar_5 = (_PreviousVP * tmpvar_4);

    highp vec4 tmpvar_6;

    tmpvar_6 = (_NonJitteredVP * tmpvar_4);

    highp vec2 tmpvar_7;

    tmpvar_7 = (((tmpvar_5.xy / tmpvar_5.w) + 1.0) / 2.0);

    highp vec2 tmpvar_8;

    tmpvar_8 = (((tmpvar_6.xy / tmpvar_6.w) + 1.0) / 2.0);

    tmpvar_2 = (tmpvar_8 - tmpvar_7);

    mediump vec4 tmpvar_9;

    tmpvar_9.zw = vec2(0.0, 1.0);

    tmpvar_9.xy = tmpvar_2;

    gl_FragDepthEXT = tmpvar_1.x;

    gl_FragData[0] = tmpvar_9;

    }

    -------- failed compiling:

    fragment evaluation shader

    WARNING: 0:4: extension 'GL_EXT_frag_depth' is not supported

    ERROR: 0:38: Use of undeclared identifier 'gl_FragDepthEXT'



    Note: Creation of internal variant of shader 'Hidden/Internal-MotionVectors' failed.

    WARNING: Shader Unsupported: 'Hidden/Internal-MotionVectors' - Pass '' has no vertex shader

    WARNING: Shader Unsupported: 'Hidden/Internal-MotionVectors' - Setting to default shader.

    WARNING: Shader Unsupported: 'Hidden/FXAA Preset 3' - Pass '' has no vertex shader

    WARNING: Shader Unsupported: 'Hidden/FXAA Preset 2' - Pass '' has no vertex shader

    WARNING: Shader Unsupported: 'Toon/Basic Outline' - Pass 'OUTLINE' has no vertex shader

    WARNING: Shader Unsupported: 'Toon/Basic Outline' - All passes removed

    UnloadTime: 8.386041 ms

    NullReferenceException: A null value was found where an object instance was required.





    (Filename: currently not available on il2cpp Line: -1)
     
  35. alvifarooq

    alvifarooq

    Joined:
    Sep 14, 2015
    Posts:
    19
    Hi Arto,

    Could I get some help on the "bloom shader"? I'm trying to understand how I can apply bloom selectively (i.e. on a specific sprite in the game). When I play around with the settings right now (threshold and intensity) I feel as if the bloom is added to the overall scene with pretty much everything highlighted (almost like it starts from the center of the screen).

    Regards,

    Farooq
     
  36. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    I think your problems are caused other shader than MT shader. Are you using some image effects?
    If so try to disable AA and see if that makes a difference.
     
  37. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    MT bloom shader doesn't support selective bloom.
     
  38. ayk

    ayk

    Joined:
    Nov 14, 2013
    Posts:
    54
    Hi Arto,

    So I'm having a little problem using MT with Synty Studios's Simple Military pack. I've attached a screenshot below:

    Screenshot 2017-04-20 09.55.13.png

    All the characters have MT Custom Lighting Master as the shader, but the one on the far left is showing up as pure black, but the others are fine. The character only appears black when using MT. If I switch to any other shader, it displays fine. Any ideas about what could be causing this?

    I have similar issues with other Synty Studios characters, by the way. Some work properly, but some only show up as black, and only with MT. They work fine with other shaders. Any suggestions for fixing would be welcome.
     
  39. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    Could be that the object vertex colors are black. You can try to comment out line 131 from Marvelous.cginc in Shaders folder to disable vertex colors.
     
  40. ayk

    ayk

    Joined:
    Nov 14, 2013
    Posts:
    54
    Is this the right line:
    o.color.rgb=v.color.rgb;

    When I comment it out, all the models turn black.

    Edit:

    I think I got it. I commented out line 301, which is:
    outColor.xyz*=v.color;

    And that seems to work!

    Edit2:

    I did some research and created a little editor script to strip the vertex colors from the skinnedmesh, so now I can fix the problem at the source, rather than tampering with MT's code. Thanks so much for pointing me in the right direction, and for making MT in the first place :)

    Edit3:

    Spoke too soon. Looks like the changes to the vertex colors don't save permanently and are lost when I quit Unity. Guess I'll just comment out vertex colors from Marvelous.cginc and use that.
     
    Last edited: Apr 20, 2017
  41. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    I'll add a property to the shader UI editor to do this more conveniently.
    Please contact me via email and I'll send the new version to you.
     
  42. ayk

    ayk

    Joined:
    Nov 14, 2013
    Posts:
    54
    Awesome! I sent you the email. Thanks! :)
     
  43. inkclear

    inkclear

    Joined:
    May 13, 2016
    Posts:
    4
    Hi, first of all thanks for making this great asset!

    I have a question, Im using the "CustomLightingSimpleSoftFog" shader, and the fog is working
    perfect for me, but I would like to use it on a unlit texture, it that possible?

    Thanks in advance!
     
  44. JesusMartinPeregrina

    JesusMartinPeregrina

    Joined:
    Nov 2, 2013
    Posts:
    36
    I have a textured character model, with generate Lightmap UV off (if I put it ON texture placement is wrong).
    Im using the customLightingMaster with a basic setup (all checkbox off).
    I cant see any difference between using the texture as Main Texture and as Layout Texture, what is the difference?
    And another question, can the textures be tileable? If I merge some floor quads, the final mesh has the texure stretched.
     
    Last edited: Jul 21, 2017
    rubble1 likes this.
  45. kreso

    kreso

    Joined:
    Sep 7, 2013
    Posts:
    105
    Hello,

    It is a really cool asset :)

    I am trying to change Tint Color, via CustomLightingMaster.
    I tried accessing "_TintColor" but it wasn't found.

    Inspecting Shader I found "_LightTint".
    However, when I set it - the color that turns out is always pink.
    It is not being set correctly.

    1) How can I change the color via script?

    2) Does changing the color on Update (to animate it) affect the performance?
    I am changing "_MainColor" a lot via code. It looks cool, I am just curious if it affects performance?

    Thank you,
    Kreso
     
  46. Kirnu-Interactive

    Kirnu-Interactive

    Joined:
    May 5, 2014
    Posts:
    153
    If you look at the included scripts you can see how to modify shader properties.
    Such scripts are for example:
    DistanceLight.cs, CustomLightingManager.cs and DirectionalLightManager.cs.

    The correct parameter is _LightTint

    -Arto
     
    kreso likes this.
  47. kreso

    kreso

    Joined:
    Sep 7, 2013
    Posts:
    105
    You are absolutely right.
    My problem (with pink color always) was that I was defining color in wrong way :)

    Thanks again!
     
  48. Muhamad_Faizol

    Muhamad_Faizol

    Joined:
    Jan 21, 2017
    Posts:
    47
    Hi,

    Has anyone use this shader with Mesh Baker? Is it possible to share tips and tricks on how to get these two assets working properly with each other?

    Many thanks.

    Cheers,
     
  49. jim00

    jim00

    Joined:
    Feb 1, 2015
    Posts:
    41
    Why at the back of the object (like building) didn’t received light, even if I put a bright light to shine on it? Can you please tell me how to enable lighting back to normal?
     
  50. jim00

    jim00

    Joined:
    Feb 1, 2015
    Posts:
    41
    I can seem to get the Object Rotator to center on the whole object, the rotation always goes to the side of the box? How to fix this. thanks.