Search Unity

Jove 2.0: DX11 Rendering System (Alpha Release)

Discussion in 'Assets and Asset Store' started by Aieth, Aug 17, 2014.

  1. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Might want to work with @nasos_333 on the grass stuff...
     
  2. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    BTW slip-out-of-your-chair beautiful....
     
    chiapet1021 and hopeful like this.
  3. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Haha thanks ;)
    I'll contact nasos and see if it is possible to convince him to make his grass jove ready :)
     
    Licarell likes this.
  4. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    This looks like a good horror, but for me it was way toooooooooo much fog XD
     
    Last edited: Sep 27, 2015
  5. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Yes I agree I went a bit overboard with fog, but I kinda wanted that can't see much feel without being pitch black.
     
  6. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    I didn't realize that Unity 4.x was still supported, until I just got an email from Unity..

    They are dropping support for it!
     
  7. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Does Jove even support 4.x anymore?
     
  8. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    Yep, the free version..
     
  9. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    I wonder if Jove could support real translucency in the grass as standard, is that possible ?

    That would be extremely cool
     
  10. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    Translucency is supported, but I'm not sure what you mean by "as standard"?
     
  11. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    While we wait to see if we can get nasos grass inside Jove, I decided to also do my own grass shader for Jove and will be doing LOD's and such for it as well, the first LOD shader will use transparancy mixed with cutout as you can remove harsh lines between the ground and grass doing this. It will have some extra things like global colour map as well as vertex displacement based off vertex colours perhaps.
    Later shader LOD's will not use the transparancy but just cutout and no shadows to reduce performance hit while the ones up close will have everything on :)


    On the terrain

    Edit: added quick AO to the shader and texture.
     
    Last edited: Sep 27, 2015
    chiapet1021, Licarell and hopeful like this.
  12. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    Though all of this looks "awesome", the thing that I would mostly want to see is indeed:
     
  13. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Cant you just use speedtree shaders but converted for Jove? :p
     
  14. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Without modifying the shader further. I dont have Jove and dont know what is supported out of the box
     
  15. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Translucency is probably the stand out in Joves standard shader. The rest is standard pbr inputs.
     
  16. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    I've had this idea of using mesh particles as the tree leaves...
     
  17. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    like a particle system? thats kinda weird approach.
    Doesn't jove's cutout shader suffice?
     
  18. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    It does, but why would it be a weird approach? I mean it could be useful, first you have a fully realistic tree and then with a few controls on the particle system and BAM! You have flying leaves, or tornado of leaves..
     
  19. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    Or if you're creative enough, you could make it so all the leaves in a small forest turn into a giant monster!
     
  20. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    Leafy, the monster...
     
  21. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Don't think so with shuriken m8, be pretty annoying to setup.
     
  22. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
  23. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Yes but I've never really heard of anyone using a particle system for tree leaves and stuff, for leaves falling down yeah but not the actual tree mesh. But if it works for you go ahead lol.

    Anyways grass shader is getting there, probably spend some time tommorow making a proper grass mesh and textures. Progress is that occlusion is dynamically generated as well as vertex displacement to give it a wind effect. With a proper mesh the wind will look better as well with the wind :)

    Shown in the gif is wind as well as the dynamic occlusion which can be modified and the fade length to remove hard seams. Will be sure to add global colour tinting based on a texture as well as a global chaos map to make the wind a bit more realistic :)
     
    hopeful likes this.
  24. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    dude you are a master
     
  25. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    Last edited: Sep 27, 2015
  26. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
  27. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    So, with Unity 5.2.1 out, how is Jove working these days?
    And @Aieth, any news on how the update is progressing? :)
     
    hopeful likes this.
  28. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Works fine although at play time it does spit out errors every frame but it doesn't seem to cause any effects to the rendering at all and renders the scene nicely unlike 5.1 :D
     
    hopeful likes this.
  29. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Finally figured out how to implement tesselation into Jove, sooo happy lol ! Spent some time and after some shader forge + googling I managed to implement it without destroying the normals and UV's :D

    Will make it distance base but we are getting close :) now phong smoothing will make it that much better perhaps :p
     
  30. cg_destro

    cg_destro

    Joined:
    Aug 13, 2013
    Posts:
    142
  31. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Thanks man :) Means a lot :p
    Anyway finally managed to get the distance tesselation in unity, it was quite easy to do although for the first hour I forgot to make the vector a vector 3 so it wasn't working. Then after fiddling for an hour I found it and felt like a retard lol.


    Now for displacement :) phong tesselation i'll put on hold until I learn how to do it lol.
     
    bac9-flcl likes this.
  32. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Hey guys I think I reached a point to say that the terrain shader is done, still need to adds some more parameters to give the user even more control (for tessellation). If I learn how to make a phong tessellation i'll implement that later :p but right now I thinks its pretty damn good :D
    Features:
    -Jove compatible(and works only in Jove), using a custom mesh (not unity terrain)
    -4 texture splatmap with heightmap blending
    -Normal and PBR maps
    -View based tessellation with displacement mapping.

    Todo - phong tessellation to remove sharper peaks (required? LOD's could be easily done in any application)
    Images :) Note- Textures and Terrain are from marmoset skyshop I didn't make them since I was too lazy to make my own :p
    In addition all textures are not PBR and heightmaps are generated in unity so this could be said 'worst case scenario' for the quality of the terrain.






    Hope you like :) Will provide a link to it when done and maybe if we do a wiki it can be on there :O
    Maybe I could also do a webplayer?
    Anyways off to physics homework now :(
     
    Last edited: Sep 28, 2015
  33. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Updated Shader
    Code (CSharp):
    1. Shader "Jove/ObjectTerrain"
    2. {
    3.     Properties
    4.     {
    5.         _Color("Color(RGB) Reflectance(A)", Color) = (1,1,1,1)
    6.         _Tess("Max Tessellation", Range(1,32)) = 1
    7.         _Fall("Tessellation Falloff", Range(0.1,2)) = 1
    8.         _Trans("Tessellation Transition", Range(0,100)) = 1
    9.         _SmoothnessMult("Smoothness multiplier", Range(0, 1)) = 1
    10.        
    11.         _Disp("Displacement Strength", Range(0, 2)) = 1
    12.         _SplatMap("SplatMap", 2D) = "white" {}
    13.         _ColorG("GlobalColor", 2D) = "white" {}
    14.         _BumpMapG("GlobalNormal", 2D) = "bump" {}
    15.         _Height1("Height0", Range(0, 0.5)) = 0.5
    16.         _Height2("Height1", Range(0, 0.5)) = 0.5
    17.         _Height3("Height2", Range(0, 0.5)) = 0.5
    18.         _Height4("Height3", Range(0, 0.5)) = 0.5
    19.         _MainTex ("Albedo0", 2D) = "white" {}
    20.         _MainTex1("Albedo1", 2D) = "white" {}
    21.         _MainTex2("Albedo2", 2D) = "white" {}
    22.         _MainTex3("Albedo3", 2D) = "white" {}
    23.         _AttributeTex("Metalness0", 2D) = "black" {}
    24.         _AttributeTex1("Metalness1", 2D) = "black" {}
    25.         _AttributeTex2("Metalness2", 2D) = "black" {}
    26.         _AttributeTex3("Metalness3", 2D) = "black" {}
    27.         _BumpMap ("Normal0", 2D) = "bump" {}
    28.         _BumpMap1("Normal1", 2D) = "bump" {}
    29.         _BumpMap2("Normal2", 2D) = "bump" {}
    30.         _BumpMap3("Normal3", 2D) = "bump" {}
    31.  
    32.     }
    33.  
    34.         Category
    35.     {
    36.         Fog { Mode Off }
    37.  
    38.         SubShader
    39.         {
    40.             Tags
    41.             {
    42.                 //This name needs to be unique
    43.                 "JoveShaderName" = "JoTerrain"
    44.                 "JoveGBufferPass" = "THIS_FILE/"
    45.         //"JoveForwardPass" = ""
    46.         "JoveShadowPass" = "Hidden/JoveShadowCaster/OPAQUE"
    47.     }
    48.  
    49.     Pass
    50.     {
    51.         Stencil { Ref 128 WriteMask 128 Comp Always Pass Replace }
    52.  
    53.         CGPROGRAM
    54.         #include "Assets/Jove/Resources/Includes/JoveCG.cginc"
    55.         #pragma vertex tessvert
    56.         #include "Tessellation.cginc"
    57. #pragma hull hull
    58. #pragma domain domain
    59.                 #pragma fragment frag
    60.                 #pragma target 5.0
    61.  
    62.                 #pragma multi_compile JOVE_AMBIENT_REFLECTIONPROBE JOVE_AMBIENT_LIGHTMAP
    63.         float _Tess;
    64.     float _Disp;
    65.     float _Fall;
    66.     float _Trans;
    67.      float4 distancePos;
    68.      uniform sampler2D _MainTex;
    69.      uniform sampler2D _MainTex1;
    70.      uniform sampler2D _MainTex2;
    71.      uniform sampler2D _MainTex3;
    72.      uniform sampler2D _BumpMap;
    73.      uniform sampler2D _BumpMapG;
    74.      uniform sampler2D _BumpMap1;
    75.      uniform sampler2D _BumpMap2;
    76.      uniform sampler2D _BumpMap3;
    77.      uniform sampler2D _AttributeTex;
    78.      uniform sampler2D _AttributeTex1;
    79.      uniform sampler2D _AttributeTex2;
    80.      uniform sampler2D _AttributeTex3;
    81.      uniform sampler2D _SplatMap;
    82.      uniform sampler2D _ColorG;
    83.  
    84.  
    85.      uniform fixed4 _Color;
    86.      uniform float4 _MainTex_ST;
    87.      uniform float4 _BumpMapG_ST;
    88.      uniform float _SmoothnessMult;
    89.      uniform float _TranslucencyMult;
    90.      uniform float _Height1;
    91.      uniform float _Height2;
    92.      uniform float _Height3;
    93.      uniform float _Height4;
    94.      uniform float _rotationUV;
    95.    
    96.    
    97.                 struct a2v
    98.                 {
    99.                     float4 vertex         : POSITION;
    100.                     float3 normal         : NORMAL;
    101.                     float4 tangent         : TANGENT;
    102.                     float4 texcoord     : TEXCOORD0;
    103.                     float4 vertexColor : COLOR;
    104.  
    105.                     JOVE_DEFERRED_A2V_STRUCT(1)
    106.                 };
    107.  
    108.  
    109.                 struct v2f
    110.                 {
    111.                     float4 pos            : SV_POSITION;
    112.                     float2 tex            : TEXCOORD1;
    113.                     float3 normalDir     : TEXCOORD2;
    114.                     float3 tangentDir     : TEXCOORD3;
    115.                     float3 binormalDir     : TEXCOORD4;
    116.                    
    117.                     float4 vertexColor : COLOR;
    118.                     JOVE_DEFERRED_V2F_STRUCT(5)
    119.                 };  
    120.  
    121.                 float blendAlpha(float t1, float a1, float t2, float a2, float t3, float a3, float t4, float a4) {
    122.                     float depth = 0.01;
    123.                     float ma = max(t1 + a1, t2 + a2) - depth;
    124.                     ma = max(ma, t3 + a3) - depth;
    125.                     ma = max(ma, t4 + a4) - depth;
    126.                     float b1 = max(t1 + a1 - ma* (1 - _Height1), 0);
    127.                     float b2 = max(t2 + a2 - ma * (1 - _Height2), 0);
    128.                     float b3 = max(t3 + a3 - ma* (1 - _Height3), 0);
    129.                     float b4 = max(t4 + a4 - ma*(1 - _Height4), 0);
    130.                     return(t1*b1 + t2*b2 + t3*b3 + t4*b4) / (b1 + b2 + b3 + b4);
    131.                 }
    132.                 JOVE_DEFERRED_VARIABLES
    133.  
    134.                     v2f vert(a2v v)
    135.                 {
    136.                     v2f o;
    137.  
    138.  
    139.  
    140.                     o.vertexColor = v.vertexColor;
    141.                     o.tangentDir = normalize(mul((float3x3)_Object2World, v.tangent.xyz));
    142.                     o.normalDir = normalize(mul(v.normal.xyz, (float3x3)_World2Object));
    143.                     o.binormalDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
    144.                     o.tex = v.texcoord;
    145.  
    146.  
    147.                     //Displacement
    148.                    
    149.                    
    150.                     float2 mainUV = TRANSFORM_TEX(o.tex, _BumpMapG);
    151.                     float4 splat = tex2Dlod(_SplatMap, float4(mainUV, 0, 0));
    152.                     float2 detailUV = TRANSFORM_TEX(o.tex, _MainTex);
    153.                     float4 height0 = tex2Dlod(_MainTex, float4(detailUV, 0, 0));
    154.                     float4 height1 = tex2Dlod(_MainTex1, float4(detailUV, 0, 0));
    155.                     float4 height2 = tex2Dlod(_MainTex2, float4(detailUV, 0, 0));
    156.                     float4 height3 = tex2Dlod(_MainTex3, float4(detailUV, 0, 0));
    157.  
    158.                
    159.                    
    160.                     float4 localTex = blendAlpha(height0.a, splat.r, height1.a, splat.g, height2.a, splat.b, height3.a, splat.a);
    161.                     v.vertex.xyz += v.normal*pow(localTex,2)*_Disp;
    162.  
    163.                     o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
    164.                     distancePos = mul(_Object2World, v.vertex);
    165.            
    166.  
    167.                     JOVE_DEFERRED_VERTEX(v, o)
    168.  
    169.                         return o;
    170.                 }
    171.                 #ifdef UNITY_CAN_COMPILE_TESSELLATION
    172.                                 struct TessVertex {
    173.                                     float4 vertex : INTERNALTESSPOS;
    174.                                     float3 normal : NORMAL;
    175.                                     float4 tangent : TANGENT;
    176.                                     float4 texcoord : TEXCOORD0;
    177.                                 };
    178.                                 struct OutputPatchConstant {
    179.                                     float edge[3]         : SV_TessFactor;
    180.                                     float inside : SV_InsideTessFactor;
    181.                                     float3 vTangent[4]    : TANGENT;
    182.                                     float2 vUV[4]         : TEXCOORD;
    183.                                     float3 vTanUCorner[4] : TANUCORNER;
    184.                                     float3 vTanVCorner[4] : TANVCORNER;
    185.                                     float4 vCWts          : TANWEIGHTS;
    186.                                    
    187.                                 };
    188.                                 TessVertex tessvert(a2v v) {
    189.                                     TessVertex o;
    190.                                     o.vertex = v.vertex;
    191.                                     o.normal = v.normal;
    192.                                     o.tangent = v.tangent;
    193.                                     o.texcoord = v.texcoord;
    194.                                    
    195.                                    
    196.                                    
    197.                                     return o;
    198.                                 }
    199.                                 float Tessellation(TessVertex v) {
    200.                                     float3 distanceF = mul(_Object2World, v.vertex);
    201.                                     float3 distanceP = distance(distanceF, _WorldSpaceCameraPos);
    202.  
    203.                                     distanceP /= _Trans;
    204.                                     distanceP = pow(distanceP, _Fall);
    205.  
    206.                                     distanceP = saturate(distanceP);
    207.  
    208.                                     return clamp(2/distanceP,1, _Tess);
    209.                                 }
    210.  
    211.        
    212.  
    213.                                 float4 Tessellation(TessVertex v, TessVertex v1, TessVertex v2) {
    214.                                     float tv = Tessellation(v);
    215.                                     float tv1 = Tessellation(v1);
    216.                                     float tv2 = Tessellation(v2);
    217.                                     return float4(tv1 + tv2, tv2 + tv, tv + tv1, tv + tv1 + tv2) / float4(2, 2, 2, 3);
    218.                                 }
    219.                                 OutputPatchConstant hullconst(InputPatch<TessVertex, 3> v) {
    220.                                     OutputPatchConstant o = (OutputPatchConstant)0;
    221.                                     float4 ts = Tessellation(v[0], v[1], v[2]);
    222.                                     o.edge[0] = ts.x;
    223.                                     o.edge[1] = ts.y;
    224.                                     o.edge[2] = ts.z;
    225.                                     o.inside = ts.w;
    226.                                     return o;
    227.                                 }
    228.                                 [domain("tri")]
    229.                                 [partitioning("fractional_odd")]
    230.                                 [outputtopology("triangle_cw")]
    231.                                 [patchconstantfunc("hullconst")]
    232.                                 [outputcontrolpoints(3)]
    233.                                 TessVertex hull(InputPatch<TessVertex, 3> v, uint id : SV_OutputControlPointID) {
    234.                                     return v[id];
    235.                                 }
    236.                                 [domain("tri")]
    237.                                 v2f domain(OutputPatchConstant tessFactors, const OutputPatch<TessVertex, 3> vi, float3 bary : SV_DomainLocation) {
    238.                                     a2v v = (a2v)0;
    239.  
    240.  
    241.                                     v.vertex = vi[0].vertex*bary.x + vi[1].vertex*bary.y + vi[2].vertex*bary.z;
    242.                                     v.normal = vi[0].normal*bary.x + vi[1].normal*bary.y + vi[2].normal*bary.z;
    243.                                     v.tangent = vi[0].tangent*bary.x + vi[1].tangent*bary.y + vi[2].tangent*bary.z;
    244.                                     v.texcoord = vi[0].texcoord*bary.x + vi[1].texcoord*bary.y + vi[2].texcoord*bary.z;
    245.                                    
    246.                                    
    247.                                     a2v o = vert(v);
    248.                                     return o;
    249.                                 }
    250.                 #endif
    251.  
    252.                
    253.                              
    254.                
    255.  
    256.                 float3 combineNormalMaps(float3 base, float3 detail) {
    257.                     base += float3(0, 0, 1);
    258.                     detail *= float3(-1, -1, 1);
    259.                     return base * dot(base, detail) / base.z - detail;
    260.                 }
    261.  
    262.                 float3 blendTexturesNormals(float3 t1,float ta1, float a1, float3 t2,float ta2, float a2, float3 t3,float ta3, float a3, float3 t4,float ta4, float a4) {
    263.                     float depth = 0.01;
    264.                     float ma = max(ta1 + a1, ta2 + a2) - depth;
    265.                     ma = max(ma, ta3 + a3) - depth;
    266.                     ma = max(ma, ta4 + a4) - depth;
    267.                     float b1 = max(ta1 + a1 - ma* (1-_Height1), 0);
    268.                     float b2 = max(ta2 + a2 - ma * (1-_Height2), 0);
    269.                     float b3 = max(ta3 + a3 - ma* (1-_Height3), 0);
    270.                     float b4 = max(ta4 + a4 - ma*(1 - _Height3), 0);
    271.  
    272.                     //(t1.rgb * b1 + t2.rgb* b2) / (b1 + b2);
    273.                     return (t1.rgb * b1 + t2.rgb* b2 + t3.rgb*b3 + t4.rgb * b4) / (b1 + b2 + b3+b4);
    274.                 }
    275.                 float4 blendTextures(float4 t1, float ta1, float a1, float4 t2, float ta2, float a2, float4 t3, float ta3, float a3, float4 t4, float ta4, float a4) {
    276.                     float depth = 0.01;
    277.                     float ma = max(ta1 + a1, ta2 + a2) - depth;
    278.                     ma = max(ma, ta3 + a3) - depth;
    279.                     ma = max(ma, ta4 + a4) - depth;
    280.                     float b1 = max(ta1 + a1 - ma* (1 - _Height1), 0);
    281.                     float b2 = max(ta2 + a2 - ma * (1 - _Height2), 0);
    282.                     float b3 = max(ta3 + a3 - ma* (1 - _Height3), 0);
    283.                     float b4 = max(ta4 + a4 - ma*(1 - _Height4), 0);
    284.  
    285.                     //(t1.rgb * b1 + t2.rgb* b2) / (b1 + b2);
    286.                     return (t1.rgba * b1 + t2.rgba* b2 + t3.rgba*b3 + t4.rgba * b4) / (b1 + b2 + b3 + b4);
    287.                 }
    288.  
    289.                
    290.                
    291.                
    292.                 GBufferData frag(v2f i)
    293.                 {      
    294.                    
    295.  
    296.                    
    297.  
    298.                     float2 mainUV = TRANSFORM_TEX(i.tex, _BumpMapG);
    299.                     float2 detailUV = TRANSFORM_TEX(i.tex, _MainTex);
    300.                
    301.  
    302.                     float4 splat = tex2D(_SplatMap, mainUV);
    303.                     float4 color = tex2D(_ColorG, mainUV);
    304.  
    305.                     //Albedo Projection
    306.                     float4 albedo0 = tex2D(_MainTex, detailUV);
    307.                     float4 albedo1 = tex2D(_MainTex1, detailUV);
    308.                     float4 albedo2 = tex2D(_MainTex2, detailUV);
    309.                     float4 albedo3 = tex2D(_MainTex3, detailUV);
    310.  
    311.                    
    312.                
    313.                     //Metalness Projection
    314.                     float4 metal0 = tex2D(_AttributeTex, detailUV);
    315.                     float4 metal1 = tex2D(_AttributeTex1, detailUV);
    316.                     float4 metal2 = tex2D(_AttributeTex2, detailUV);
    317.                     float4 metal3 = tex2D(_AttributeTex3, detailUV);
    318.  
    319.                     //Normal Projection
    320.                     float3 normal = UnpackNormal(tex2D(_BumpMap, detailUV));
    321.                     float3 normal1 = UnpackNormal(tex2D(_BumpMap1, detailUV));
    322.                     float3 normal2 = UnpackNormal(tex2D(_BumpMap2, detailUV));
    323.                     float3 normal3 = UnpackNormal(tex2D(_BumpMap3, detailUV));
    324.  
    325.                
    326.                     float3 finalN = blendTexturesNormals(normal, albedo0.a, splat.r, normal1, albedo1.a, splat.g, normal2, albedo2.a, splat.b, normal3, albedo3.a, splat.a);
    327.  
    328.                     float3 baseNormal = UnpackNormal(tex2D(_BumpMapG, mainUV));
    329.                     float3 detailNormal = finalN;
    330.                     float3 tangentNormal = combineNormalMaps(baseNormal, detailNormal);
    331.  
    332.                     float3x3 local2World     = float3x3(i.tangentDir, i.binormalDir, i.normalDir);
    333.                     float3 worldNormal         = normalize(mul(tangentNormal, local2World));
    334.                        
    335.                     DeferredInput input;
    336.                
    337.                 input.color = blendTextures(albedo0, albedo0.a, splat.r, albedo1, albedo1.a, splat.g, albedo2, albedo2.a, splat.b, albedo3, albedo3.a, splat.a)*color.rgb;
    338.                     input.reflectance     = _Color.w;
    339.                     input.metallic         = metal0.x;
    340.                     input.occlusion     = color.w;
    341.                     input.translucency     = metal0.z * _TranslucencyMult;
    342.                     input.smoothness     = blendTextures(metal0, albedo0.a, i.vertexColor.r, metal1, albedo1.a, i.vertexColor.g, metal2, albedo2.a, i.vertexColor.b, metal3, albedo3.a, i.vertexColor.a).w * _SmoothnessMult;
    343.                     input.worldNormal     = worldNormal;
    344.                        
    345.                     JOVE_DEFERRED_FRAGMENT(i, input)  
    346.                    
    347.                     return PackGBuffer(input);
    348.                 }
    349.                
    350.                
    351.                 ENDCG
    352.             }
    353.         }
    354.     }
    355. }
    356.  
    357.  
    358.  
     
    Last edited: Oct 2, 2015
    kebrus likes this.
  34. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    All dat math. So sexy :p
     
  35. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    haha yeah, the only math part in the shader I dont really understand is the tessellation. I kinda get it but I really didn't want to spend a lot of time actually learning how tessellation works but would rather know how to implement it lol.
     
  36. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    Nice, and we should do a wiki soon.
     
    chiapet1021 likes this.
  37. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    I'll maybe start a group chat but I think we should clear it with Aieth first you know ;)
     
    chiapet1021 likes this.
  38. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    BTW where is @Aieth I thought for sure he would chime in with all these sexy shots flying up on this thread....
     
  39. Aieth

    Aieth

    Joined:
    Apr 13, 2013
    Posts:
    805
    Lurking in the shadows ;)
     
    SAOTA and chiapet1021 like this.
  40. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    Batman confirmed?
     
    Tiny-Man likes this.
  41. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Aieth is Bruce Wayne :O
     
    NikProductions likes this.
  42. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Now are those realtime or baked...:D
     
  43. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Just like to say that I changed the shader a bit as when I was making it I was using gamma space for some reason (Jove is meant to use Linear) so it was very dark in Linear, I fixed that also changed some stuff, for good and bad. Textures are now a bit crisper and colourful although on the downside tiling is a bit more obvious, but tbh I think it's worth it. The reason for this is that the texture blending wasnt playing nice in linear space so I had to remove it :/
    Some images of the update



    I think you can quite easily see just how much more pop the textures have now than before.

    Also going to say that the wiki in under construction, hopefully there will be something to show next week with a link to it :)
     
    cg_destro, hopeful and Licarell like this.
  44. Aieth

    Aieth

    Joined:
    Apr 13, 2013
    Posts:
    805
    Yeah don't try and use gamma lighting in Jove, whatever happens is completely untested and likely if not guaranteed to be completely wrong :p
     
  45. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Well its linear now so its ok :)
     
  46. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Wow! That looks downright photographic!
     
  47. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    @Tiny Man - You could say that your definitely getting there....


    Man I wish there was some way to get other asset developers to jump on the Jove train, Time Of Day, Unistorm, Truesky, Ceto... augh.....
     
  48. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    @Licarell that's my wish too. I'm guessing it'll happen eventually, or Aieth or Dolkar will come up with amazing implementations of their own. But patience is a virtue I lack... :p
     
  49. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Well we managed to get Nasos kinda on the Jove train lol, thats one step forward. Still need to test and talk a bit more about it, but i'm a bit busy doing the wiki and stuff to do so right now.
     
    chiapet1021 likes this.
  50. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Well I'm concerned that @Aieth might be at the point of diminished returns... we used to get updates all the time and we where promised smaller more frequent updates but yet not much has come our way. I know he said he's in the middle of a huge refactoring... I'm just scared he's thrown his keyboard against the wall and cursed out his monitor:eek: while working on it...