Batching Tools

Discussion in 'Assets and Asset Store' started by Ippokratis, Nov 28, 2011.

  1. Zantal

    Zantal

    New Member

    Joined:
    Mar 19, 2012
    Messages:
    2
    What i mean is this.

    The original UVs are overlapped, so my 3d artist exported the same fbx with another set of UVs that don't overlap (the overlapping ones are still there).

    so i thought that i could map the atlas based on the same original textures but using the second set of UVs (since the first ones overlap).

    I have already checked in the source files (although js is not my favourite) and found a function called ModifyUv (line 489 of BatchingTools.js) and i figured out that if the is something that can be done it could be done in here.

    is all this possible?

    The tool actually works great, but i overlooked the "non overlapping UV" thing. I really need to get this working without forcing my 3D guys to remake all the textures.
     
    Last edited: Mar 20, 2012
  2. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,
    Essential :
    It seems logical. Smaller lightmap size also means lower detail, so be aware of this tradeoff too.

    Zantal :
    I see, now it is clear to me.
    Sorry, I do not think this is possible.
    You can modify as much as you wish the source code so it fits your needs, as long as you do not resell it. I do not think it is possible, but you could prove me wrong.
    Sorry to hear that. Actually, non -overlapping uv are an issue as long as you need lightmaps and /or normal maps, otherwise they do not harm.

    Thanks for the feedback, if you need more help, please ask,
    -Ippokratis
     
  3. badawe

    badawe

    New Member

    Joined:
    Jan 17, 2011
    Messages:
    277
    Hey @Ippokratis
    Thanks for the GREAT plugin, since I bought, don't stop using until now ;P

    Just one thing, I'm trying to use one shader from AngryBots called SimpleSelfIllumination

    Code (csharp):
    1.  
    2. /*
    3.  
    4. illum shader.
    5.  
    6. self illumination based on base texture alpha channel.
    7.  
    8. */
    9.  
    10. Shader "AngryBots/SimpleSelfIllumination" {
    11.    
    12. Properties {
    13.     _MainTex ("Base", 2D) = "grey" {}
    14.     _SelfIllumination ("Self Illumination", Range(0.0,2.0)) = 1.0
    15. }
    16.  
    17. SubShader {
    18.     Pass {     
    19.         Program "vp" {
    20. // Vertex combos: 1
    21. //   opengl - ALU: 5 to 5
    22. //   d3d9 - ALU: 5 to 5
    23. SubProgram "opengl " {
    24. Keywords { }
    25. Bind "vertex" Vertex
    26. Bind "texcoord" TexCoord0
    27. Vector 5 [_MainTex_ST]
    28. "!!ARBvp1.0
    29. # 5 ALU
    30. PARAM c[6] = { program.local[0],
    31.         state.matrix.mvp,
    32.         program.local[5] };
    33. MAD result.texcoord[0].xy, vertex.texcoord[0], c[5], c[5].zwzw;
    34. DP4 result.position.w, vertex.position, c[4];
    35. DP4 result.position.z, vertex.position, c[3];
    36. DP4 result.position.y, vertex.position, c[2];
    37. DP4 result.position.x, vertex.position, c[1];
    38. END
    39. # 5 instructions, 0 R-regs
    40. "
    41. }
    42.  
    43. SubProgram "d3d9 " {
    44. Keywords { }
    45. Bind "vertex" Vertex
    46. Bind "texcoord" TexCoord0
    47. Matrix 0 [glstate_matrix_mvp]
    48. Vector 4 [_MainTex_ST]
    49. "vs_2_0
    50. ; 5 ALU
    51. dcl_position0 v0
    52. dcl_texcoord0 v1
    53. mad oT0.xy, v1, c4, c4.zwzw
    54. dp4 oPos.w, v0, c3
    55. dp4 oPos.z, v0, c2
    56. dp4 oPos.y, v0, c1
    57. dp4 oPos.x, v0, c0
    58. "
    59. }
    60.  
    61. SubProgram "gles " {
    62. Keywords { }
    63. "!!GLES
    64. #define SHADER_API_GLES 1
    65. #define tex2D texture2D
    66.  
    67.  
    68. #ifdef VERTEX
    69. #define gl_ModelViewProjectionMatrix glstate_matrix_mvp
    70. uniform mat4 glstate_matrix_mvp;
    71.  
    72. varying mediump vec2 xlv_TEXCOORD0;
    73.  
    74. uniform mediump vec4 _MainTex_ST;
    75. attribute vec4 _glesMultiTexCoord0;
    76. attribute vec4 _glesVertex;
    77. void main ()
    78. {
    79.  mediump vec4 tmpvar_1;
    80.  mediump vec2 tmpvar_2;
    81.  highp vec4 tmpvar_3;
    82.  tmpvar_3 = (gl_ModelViewProjectionMatrix * _glesVertex);
    83.  tmpvar_1 = tmpvar_3;
    84.  highp vec2 tmpvar_4;
    85.  tmpvar_4 = ((_glesMultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
    86.  tmpvar_2 = tmpvar_4;
    87.  gl_Position = tmpvar_1;
    88.  xlv_TEXCOORD0 = tmpvar_2;
    89. }
    90.  
    91.  
    92.  
    93. #endif
    94. #ifdef FRAGMENT
    95.  
    96. varying mediump vec2 xlv_TEXCOORD0;
    97. uniform lowp float _SelfIllumination;
    98. uniform sampler2D _MainTex;
    99. void main ()
    100. {
    101.  mediump vec4 tmpvar_1;
    102.  lowp vec4 tmpvar_2;
    103.  tmpvar_2 = texture2D (_MainTex, xlv_TEXCOORD0);
    104.  tmpvar_1 = ((tmpvar_2 * tmpvar_2.w) * _SelfIllumination);
    105.  gl_FragData[0] = tmpvar_1;
    106. }
    107.  
    108.  
    109.  
    110. #endif"
    111. }
    112.  
    113. SubProgram "glesdesktop " {
    114. Keywords { }
    115. "!!GLES
    116. #define SHADER_API_GLES 1
    117. #define tex2D texture2D
    118.  
    119.  
    120. #ifdef VERTEX
    121. #define gl_ModelViewProjectionMatrix glstate_matrix_mvp
    122. uniform mat4 glstate_matrix_mvp;
    123.  
    124. varying mediump vec2 xlv_TEXCOORD0;
    125.  
    126. uniform mediump vec4 _MainTex_ST;
    127. attribute vec4 _glesMultiTexCoord0;
    128. attribute vec4 _glesVertex;
    129. void main ()
    130. {
    131.  mediump vec4 tmpvar_1;
    132.  mediump vec2 tmpvar_2;
    133.  highp vec4 tmpvar_3;
    134.  tmpvar_3 = (gl_ModelViewProjectionMatrix * _glesVertex);
    135.  tmpvar_1 = tmpvar_3;
    136.  highp vec2 tmpvar_4;
    137.  tmpvar_4 = ((_glesMultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
    138.  tmpvar_2 = tmpvar_4;
    139.  gl_Position = tmpvar_1;
    140.  xlv_TEXCOORD0 = tmpvar_2;
    141. }
    142.  
    143.  
    144.  
    145. #endif
    146. #ifdef FRAGMENT
    147.  
    148. varying mediump vec2 xlv_TEXCOORD0;
    149. uniform lowp float _SelfIllumination;
    150. uniform sampler2D _MainTex;
    151. void main ()
    152. {
    153.  mediump vec4 tmpvar_1;
    154.  lowp vec4 tmpvar_2;
    155.  tmpvar_2 = texture2D (_MainTex, xlv_TEXCOORD0);
    156.  tmpvar_1 = ((tmpvar_2 * tmpvar_2.w) * _SelfIllumination);
    157.  gl_FragData[0] = tmpvar_1;
    158. }
    159.  
    160.  
    161.  
    162. #endif"
    163. }
    164.  
    165. SubProgram "flash " {
    166. Keywords { }
    167. Bind "vertex" Vertex
    168. Bind "texcoord" TexCoord0
    169. Matrix 0 [glstate_matrix_mvp]
    170. Vector 4 [_MainTex_ST]
    171. "agal_vs
    172. [bc]
    173. adaaaaaaaaaaadacadaaaaoeaaaaaaaaaeaaaaoeabaaaaaa mul r0.xy, a3, c4
    174. abaaaaaaaaaaadaeaaaaaafeacaaaaaaaeaaaaooabaaaaaa add v0.xy, r0.xyyy, c4.zwzw
    175. bdaaaaaaaaaaaiadaaaaaaoeaaaaaaaaadaaaaoeabaaaaaa dp4 o0.w, a0, c3
    176. bdaaaaaaaaaaaeadaaaaaaoeaaaaaaaaacaaaaoeabaaaaaa dp4 o0.z, a0, c2
    177. bdaaaaaaaaaaacadaaaaaaoeaaaaaaaaabaaaaoeabaaaaaa dp4 o0.y, a0, c1
    178. bdaaaaaaaaaaabadaaaaaaoeaaaaaaaaaaaaaaoeabaaaaaa dp4 o0.x, a0, c0
    179. aaaaaaaaaaaaamaeaaaaaaoeabaaaaaaaaaaaaaaaaaaaaaa mov v0.zw, c0
    180. "
    181. }
    182.  
    183. }
    184. Program "fp" {
    185. // Fragment combos: 1
    186. //   opengl - ALU: 3 to 3, TEX: 1 to 1
    187. //   d3d9 - ALU: 3 to 3, TEX: 1 to 1
    188. SubProgram "opengl " {
    189. Keywords { }
    190. Float 0 [_SelfIllumination]
    191. SetTexture 0 [_MainTex] 2D
    192. "!!ARBfp1.0
    193. # 3 ALU, 1 TEX
    194. PARAM c[1] = { program.local[0] };
    195. TEMP R0;
    196. TEX R0, fragment.texcoord[0], texture[0], 2D;
    197. MUL R0, R0, R0.w;
    198. MUL result.color, R0, c[0].x;
    199. END
    200. # 3 instructions, 1 R-regs
    201. "
    202. }
    203.  
    204. SubProgram "d3d9 " {
    205. Keywords { }
    206. Float 0 [_SelfIllumination]
    207. SetTexture 0 [_MainTex] 2D
    208. "ps_2_0
    209. ; 3 ALU, 1 TEX
    210. dcl_2d s0
    211. dcl t0.xy
    212. texld r0, t0, s0
    213. mul_pp r0, r0, r0.w
    214. mul_pp r0, r0, c0.x
    215. mov_pp oC0, r0
    216. "
    217. }
    218.  
    219. SubProgram "gles " {
    220. Keywords { }
    221. "!!GLES"
    222. }
    223.  
    224. SubProgram "glesdesktop " {
    225. Keywords { }
    226. "!!GLES"
    227. }
    228.  
    229. SubProgram "flash " {
    230. Keywords { }
    231. Float 0 [_SelfIllumination]
    232. SetTexture 0 [_MainTex] 2D
    233. "agal_ps
    234. [bc]
    235. ciaaaaaaaaaaapacaaaaaaoeaeaaaaaaaaaaaaaaafaababb tex r0, v0, s0 <2d wrap linear point>
    236. adaaaaaaaaaaapacaaaaaaoeacaaaaaaaaaaaappacaaaaaa mul r0, r0, r0.w
    237. adaaaaaaaaaaapacaaaaaaoeacaaaaaaaaaaaaaaabaaaaaa mul r0, r0, c0.x
    238. aaaaaaaaaaaaapadaaaaaaoeacaaaaaaaaaaaaaaaaaaaaaa mov o0, r0
    239. "
    240. }
    241.  
    242. }
    243.  
    244. #LINE 50
    245.  
    246.     }
    247. }
    248.  
    249. FallBack Off
    250. }
    251.  
    252.  
    What I must do to manage this to work with batching tools? Can you help me?
     
  4. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,
    Thanks for the kind words.
    I will have a look at the shader and report back in the thread.
    As a side note, here are some screenshots from a toon shader I am working on :
    $Screen shot 2012-03-24 at 3.22.26 PM.png $Screen shot 2012-03-24 at 3.26.00 PM.png
     
    Last edited: Mar 24, 2012
  5. I am da bawss

    I am da bawss

    Member

    Joined:
    Jun 2, 2011
    Messages:
    2,366
    Very interested, this is definitely on my to-buy list!
     
  6. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,

    I am da Bawss : Sure, take your time to read through documentation and try to watch the videos, so you can understand better what this tool does. If you need any clarifications, please ask.

    -Update-
    I plan to release a new update with support for two more shaders that are requested by 4-5 April.
    I also plan to release a new product, a toon shader, compatible with Batching Tools, around 30 April. I created a new thread about this shader here.
    Thanks,
    -Ippokratis
     
  7. wightwhale

    wightwhale

    Member

    Joined:
    Jul 28, 2011
    Messages:
    186
    We've been using the toon lighted outline shader on ios without too much trouble, but it uses shader model 2 which some games may not be able to afford. I'm excited for your shader to come out :)
     
  8. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,
    I just submitted a new version with support for two new self illuminated shaders. One is transparent ( BT/ Transparent SelfIllum ) and the other is opaque ( BT/ SelfIllum ). Both are fast :)
    [Edit] It is available at the Asset Store, wow, that was quick !
    Thanks for the support,
    -Ippokratis
     
    Last edited: Mar 29, 2012
  9. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,
    I have some nice results with the toon shader I currently develop :

    Web player link :

    $Screen shot 2012-04-01 at 10.47.49 PM.png

    The next revision of Batching Tools will be compatible with this shader family ( It is 6 of them actually :) ).
     
  10. Lars Steenhoff

    Lars Steenhoff

    Member

    Joined:
    Aug 7, 2007
    Messages:
    874
    Are the tree shaders from unity tree creator supported? I'm very interested in having trees working with batching for mobile.
     
  11. Essential

    Essential

    Member

    Joined:
    Sep 8, 2011
    Messages:
    248
    Just got my copy! Am very pleased and a few queries…

    - After combining, my light map disappeared. How do I get it back on the combined objects?

    Edit: I found the batching method menu and I also understand the stuff below so you can ignore it. The original group stayed because it still contained my collision geometry but disabled all the meshes. The only thing I'm confused about is my lightmap and how I can batch the light map together? Many thanks :)


    //Old: I'm confused… There seems to be 3 groups now… the original group of objects, a new batched group of objects, and a third group which is a copy of the original group but disabled. — Is this how it's meant to work? I thought it would simply replace my original group with the batched group.

    [​IMG]
     
    Last edited: Apr 3, 2012
  12. paul4tune

    paul4tune

    New Member

    Joined:
    Oct 8, 2011
    Messages:
    38
    i just bought this product its brilliant but,after batching i then bake a beast lightmap and it gets lots of odd artifacts all over the place,and its only on the batched meshes,can you help please.
    just another note after reading about bake lightmaps before batching i did that and soon as i batch the shadows disappear
     
    Last edited: Apr 3, 2012
  13. Essential

    Essential

    Member

    Joined:
    Sep 8, 2011
    Messages:
    248
    I'm having the same problem. I realized I needed to redo my lightmap after combining (I'm unsure why the manual states to do lightmapping before combining) but it still has artifacts. Tiling is set to 1,1, Offset is 0,0 and all textures are set to Clamp.
     
  14. paul4tune

    paul4tune

    New Member

    Joined:
    Oct 8, 2011
    Messages:
    38
    im just doing a little test now with one batched item if that doesnt work then i cant lightmap batched meshes,which makes the hole thing a waist of time

     
  15. paul4tune

    paul4tune

    New Member

    Joined:
    Oct 8, 2011
    Messages:
    38
    doesn't work i did my lightmapping before batching,i then batched my meshes,soon as it finished batching the shadows removed from the batched meshes,unless im missing something,

    the only other thing i can think of,is it only supports single lightmaps.
    no this doesnt work either,im at a loss
     
    Last edited: Apr 3, 2012
  16. Essential

    Essential

    Member

    Joined:
    Sep 8, 2011
    Messages:
    248
    Just curious, is your object using a repeating texture? Like a cube for example?
     
  17. paul4tune

    paul4tune

    New Member

    Joined:
    Oct 8, 2011
    Messages:
    38
    no just normal 512x512 texture atlases,another thing to add is that the light map works fine when casting shadows on other things but it cant cast a shadow from the same meshes

     
  18. Essential

    Essential

    Member

    Joined:
    Sep 8, 2011
    Messages:
    248
    If it helps to see my problem, here's my combined scene when lit by lights…

    [​IMG]

    …and here it is after processing the lightmapping…

    [​IMG]
     
  19. paul4tune

    paul4tune

    New Member

    Joined:
    Oct 8, 2011
    Messages:
    38
    does anyone have his email,
     
  20. Essential

    Essential

    Member

    Joined:
    Sep 8, 2011
    Messages:
    248
    You could private message him, but Ippokratis is pretty good at replying in this thread. I'm sure it won't be longer than 24 hours or so =]
     
  21. paul4tune

    paul4tune

    New Member

    Joined:
    Oct 8, 2011
    Messages:
    38
    lightmapping with batching
    [​IMG]

    lightmapping without batching
    [​IMG]

    it would be nice to get some reply,if communication is going to be an issue then maybe you should provide some kind of email
     
  22. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,
    Essential and paul4tune : Thanks for the feedback and suport :)
    The problems that you are facing with lightmaps are usually produced by using meshes with overlapping uvs or uvs outside the 0-1 range.
    Overlapping uv means that more than one uv coordinates correspond to the same pixels on a texture $comp_shadedUVs.png
    In the above picture, you can see how a uv map with overlapping uvs looks like.
    For instance, the cube prefab in unity has overlapping uvs.
    The above limitation is described in the documentation. You can also see me having problems with overlapping uv in one of the video tutorials :) The idea is that the models do batch without problems but the lightmaps and the normal maps are messed up. So, make sure that you do not use overlapping uv.
    If it is not the case, would you like to provide some example scene so I could test 'em out ?
    -Ippokratis
     

    Attached Files:

  23. paul4tune

    paul4tune

    New Member

    Joined:
    Oct 8, 2011
    Messages:
    38
    Ahh I bought the pallets of the asset store so didn't do the uvs,looks like I'll have to export the meshes and redo them myself,is it possible to overlap different objects,like if i have 2 different pallets on the same uv,

     
  24. paul4tune

    paul4tune

    New Member

    Joined:
    Oct 8, 2011
    Messages:
    38
    ok i exported the pallet re uv'd it without overlapping any uvs at all,and i got the exact same outcome,so whats next

    [​IMG]
    [​IMG]

     
    Last edited: Apr 5, 2012
  25. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,
    Thanks for the feedback, the sample scene you send hopefully will help me to spot the problem,
    I will try to solve this issue this weekend.
    -Ippokratis
     
  26. Essential

    Essential

    Member

    Joined:
    Sep 8, 2011
    Messages:
    248
    Ah, so I can't have a uv repeat OR repeat the texture around an object. So the only way I can use an identical texture that repeats on every face of a cube is to create a texture map that simply repeats itself 6 times within the texture, like this?

    [​IMG]

    Is this correct?
     
  27. paul4tune

    paul4tune

    New Member

    Joined:
    Oct 8, 2011
    Messages:
    38
    i already did that and got the same results

     
  28. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,
    After some tests, I realized that the lightmap support is broken.
    The new way Unity handles lightmaps in 3.5 version is not compatible with Batching Tools in its current version.
    Thanks a lot for bringing this issue to my attention, I will try to resolve this ASAP.
    You can also consider a full refund if you wish. It is handled by Unity Asset Store, but if you have any problems with the process, contact me personally. My email is ippobour at gmail com.
     
  29. Essential

    Essential

    Member

    Joined:
    Sep 8, 2011
    Messages:
    248
    It's okay. I believe you can fix it, Ippokratis. :)
     
  30. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Messages:
    11,288
    he's the man. I'm sure he will come to a solution.
     
  31. jrDev

    jrDev

    Member

    Joined:
    Nov 5, 2008
    Messages:
    1,214
    Hey Ippo, just so you know, 2 of your shaders in the BT section don't work called BT Self Illum and BT Transparent Self Illum. They give error about the shaders not being supported.

    Also, I have never noticed this before, but after batching a bunch of gameobjects, some of them batch to make 1 drawcall, but as soon as I add a certain gameobject, it breaks the batching? Everything else batches fine but that gameObject which of course Batching Tools put all under one material, texture and mesh atlas.

    EDIT: It seems that objects are only being batched if they have the same atlas size?? For eg, I have some 512X512 textures with some 128X128. They batch to their respective sizes but as soon as I have both in same view, batching breaks?

    EDIT2: No that's not it...I wasn't understanding BTDynamic, that's why.
     
    Last edited: Apr 11, 2012
  32. jrDev

    jrDev

    Member

    Joined:
    Nov 5, 2008
    Messages:
    1,214
    Yea, I just finally understood what BTDynamic does, and now I realize that I can't use it because it requires that I have the fully batched mesh viewable, which I can't since they are all separate items that appear at different times. If there is a solution around this Ippo, I'm all ears, else I just have to revert to Unity Batching (which is crap, because I will never understand why certain things batch and others don't - I've had meshes that go over the 300 vertices limit and batching still occurs, but other times, some game objects just wont batch...
     
  33. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,
    jrricky :
    Thanks a lot for your detailed feedback.
    I will provide a step by step tutorial on using the Self Illum if needed, but I think that you should make sure you use SelfIllum or Tranparent SelfIllum shader in the models you wish to combine. BT Self Illum and BT Transparent Self Illum are used internally by Batching Tools ( perhaps I should hide them so they do not confuse people ).

    I do not understand 100% the issue, I am suggesting submitting a sample scene along with the intended results.

    I will try my best to create a nice video tutorial explaining how to use BTDynamic this weekend. It seems that the workflow is not clear to you ( my bad ).

    There is not such requirement. I would greatly appreciate if you could send me a sample scene along with explanations regarding the intended behavior. In any case, if you cannot provide a scene, I will try my best to help you, just give me a concrete description of what exactly you try to achieve.
    Thanks,
    -Ippokratis
     
  34. badawe

    badawe

    New Member

    Joined:
    Jan 17, 2011
    Messages:
    277
    Hey @Ippokratis
    I just update the Batching Tools to the last version, but i don't know what I'm doing wrong:

    I have this 2 trees:
    [​IMG]

    They share the same material and the same mesh, after batch, but if I dupplicate it, i get more 2 draw calls, what is going on? Something change?
    [​IMG]

    Before that i get only single draw call for each batched object.
     
  35. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi badawe,
    Three observations :
    1. The best practice in this setting is to use batching tools after you place all 4 objects in the scene.
    2. Unity 3.5 does not reliably display the number of draw calls in certain situations. Please try to do the following : Combine, hit Play, check number of draw calls, hit Play again, check again, do it for a third time and keep an eye on the the nr of draw calls again. You should see it changing. I usually see the correct nr of draw calls on the second time I start the level ( I have seen a tweet from ReJ describing this as an known issue, I am sure it is planned to be resolved soon). If this does not happen in your case, please submit a sample scene that lets me reproduce the error.
    3. I am very happy that you and other customers provide me with more feedback about Batching Tools. I am very interested to know what does not work for you so I can improve the package. Please keep it up :)

    Thanks a lot for the feedback,
    -Ippokratis
     
    Last edited: Apr 13, 2012
  36. EvilNoodle

    EvilNoodle

    Member

    Joined:
    Nov 17, 2011
    Messages:
    26
    Hi,

    I just bought this tool and am very impressed with its ability to kill draw calls! This will make modular level building a lot easier!

    When I combined a whole bunch of objects with a single material all is well but I just tried to combine two different types of object to generate an atlas and it seems my normal maps are getting messed up. I am using the default bumped diffuse shader on both materials with 1024*1024 textures for both diffuse and normals.

    I have set the texture import settings to clamp for both textures and as far as I can see everything looks like it is set up correctly but when I combine them the normal maps seem to lose a load of definition or get messed up.

    Here is a picture of the objects pre-combine. Note the grill definition on the right hand cube and that the indentation on the left hand cube goes all the way around each face of the cube.

    $Pre.jpg

    And here is a link to a picture after the merge. The grill is much less defined and the indent seems to have been lost across two edges on each side of the cube.

    $Post.jpg

    I set the atlas size to 2048 as I am using 1024 textures and there are no overlapping UVs on the model (it is unwrapped as a net of 6 independent faces.

    When I look at the actual generated atlas texture everything looks fine so I am guessing it is something to do with how it is being applied to the objects that is causing the degradation in appearance.

    Any ideas what is going wrong?

    Many thanks

    EvilNoodle
     
  37. jrDev

    jrDev

    Member

    Joined:
    Nov 5, 2008
    Messages:
    1,214
    Hey Ippo,

    Ill see if I can get a sample to you in a few hours. But what I have are game pickup items that I want batched because there are going to be multiples of each item running in the game at the same time; so I want 1 draw call no matter how many are in play. Now when I BTDynamic batch them, they become 1 mesh which seems to give me no other control of the meshes but just to move them. So if I want to show only one item from that combined mesh, how would I handle that?
     
  38. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,
    EvilNoodle : Welcome onboard :)
    When you are using normal maps you should be aware that each normal map size should match the respective Main Texture size. You are doing it already, but it is a good thing to point out anyway.
    Regarding the "normal maps seem to lose a load of definition" issue, it seems to be a matter of "bumpiness". Select the normal map atlas in the project view and change its bumpiness in the inspector until it matches the look you desire. Playing with filtering popup can also help.
    I 'll be happy to help you further if needed, just post here any other questions - suggestions. Sending me an example scene helps a lot too.


    jrricky: At the beggining of the level you place the pickable items where you want them to be and then, when player picks them,
    place the picked item behind the camera. Something like " when user picks item x move it 1 unit behind current camera position ". If it is not clear, send me the scene and I will write a little script that demonstrates how to do it.

    paul4tune, Essential : Sorry for the delay. I am still working on solving the lightmap issues, the way Unity treats lightmaps and light changed in 3.5 and changed again in 3.51. I now focus on integrating lightmaps to the latest Unity version, which came out recently ( yesterday ? ).

    Also, I would greatly appreciate if users could report back the current status of the issues they are having. If something is solved, please report. If problems remains, please report again so I can search for a solution. And please try to include a minimal scene that reproduces the issue you are having, it would save much time for everyone.

    Thanks for your support,
    -Ippokratis
     
  39. jrDev

    jrDev

    Member

    Joined:
    Nov 5, 2008
    Messages:
    1,214
    How do you recommend me to create prefabs of these items Ippo, add the full mesh and the item controller gameobject to the same prefab?
     
  40. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,
    I 'll make a simple sample scene in the next days. If someone :) could send some simple assets I could finish it sooner.
    -Ippokratis
     
  41. EvilNoodle

    EvilNoodle

    Member

    Joined:
    Nov 17, 2011
    Messages:
    26
    What is the best way to send you a sample scene?

    I have created one for this normal map degradation issue and would like to send it over. I have tried playing with the texture import settings and bumpiness etc. but to no success so I would be very grateful if you could take a look.

    For this tool to be really useful for me I need to be able to combine modular level building blocks containing diffuse and normal maps together without any loss in quality.

    EvilNoodle
     
  42. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi EvilNoodle,
    I have responded to the PM you send me as well, please send the sample scene at my email ippobour at gmail dot com.
    Thanks for the feedback,
    -Ippokratis
     
  43. EvilNoodle

    EvilNoodle

    Member

    Joined:
    Nov 17, 2011
    Messages:
    26
    Many thanks Ippokratis.

    I just sent you an email with the test project as an attachment. By the way I played your Thyella game - Nice one!

    EvilNoodle
     
  44. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,
    I released Toon Shader at the Asset Store :)
    Forum thread

    Now what ?

    I will try to spend the next month in fixing lightmaps and normal maps problems, as well as making some new tutorials on how to use Batching Tools. At some point I will release a new version that will support Toon Shader too.

    Evil Noodle : Thanks for the feedback, the detailed description and project file helped me spot the issue. I am working on a fix.

    Thanks for your support,
    -Ippokratis
     
  45. Essential

    Essential

    Member

    Joined:
    Sep 8, 2011
    Messages:
    248
    Thanks! Fix the light map problem before the end of April. I know you can do it! :)
     
  46. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,

    Essential : Thanks for the support :)

    EvilNoodle : I send you a response via email, please report back if this solves the issues you are having.

    -Update-
    I fixed the normal maps issue, an updated version will be available in this week, including Toon Shader support too.
    Thanks for your patience,
    -Ippokratis
     
  47. markhula

    markhula

    New Member

    Joined:
    Sep 3, 2011
    Messages:
    630
    Hey Ippokratis,

    I am having some issues with batching tools.
    When I combine everything seems fine but the texture generated is in correct and consists of mainly just 1 colour.
    I am doing nothing fancy! :) i.e. no light maps or anything - just standard stuff
    Please see before and after batch pic's.

    Cheers

    $Screen Shot 2012-04-23 at 13.20.08.png $Screen Shot 2012-04-23 at 13.19.46.png
     
    Last edited: Apr 23, 2012
  48. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi badawe,
    Thanks for the feedback.
    Could you please show an image of your cubes uv mapping ?
    Thanks,
    -Ippokratis
     
  49. markhula

    markhula

    New Member

    Joined:
    Sep 3, 2011
    Messages:
    630
    Hey Ippokratis,

    I am still having problems. So I have a new scene with just 2 cubes each with their own material I wish to combine.
    BT says to expand one of the meshes (though I can't see why), it just has a cube mesh filer,mesh rendered and 1 material (as does the other cube).
    Anyway I 'expand it'. Then on combine it tells me to remove the mesh renderer. If I do that though on combine it complains their is no mesh renderer!! <confused>
    What I am *trying* to do is combine these 2 meshes and 2 textures into 1 mesh and 1 texture. Then I can use this 'pair' of objects anywhere and they will always be only 1 draw call.
    Please help - I am sure I am doing something wrong :))

    Cheers
     
  50. Ippokratis

    Ippokratis

    Member

    Joined:
    Oct 13, 2008
    Messages:
    1,196
    Hi,
    Would you like to send me a scene with these models so I can have a look at them ?
    Kind regards,
    -Ippokratis

    [EDIT] I also found a solution for lightmaps, I will try to submit a new build by Monday 02/05/12.
     
    Last edited: Apr 25, 2012