Home Technical Talk

xNormal - MASTER THREAD

191012141559

Replies

  • conte
    Options
    Offline / Send Message
    conte polycounter lvl 18
    jogshy, i am downloading it, when it comes to 15mb- downloading torning- i don't know why. i did it few times,
    that won't help
    anyway, i'll find some way, thx for time.
  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    [ QUOTE ]
    jogshy, i am downloading it, when it comes to 15mb- downloading torning- i don't know why. i did it few times,
    that won't help

    [/ QUOTE ]
    Try to clear the web browser disk cache. That happened me sometimes when a download stopped suddenly and you retry to download the required file again ( it finishes immediatly because the browser things the file was already downloaded ok ).
  • poopinmymouth
    Options
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    I'm not 100% sure how to describe this problem, but I'll try.

    The way that Xnormal "records" the normal colors to the texture, creates rendering errors within the default 3dsmax preview (using DX display of standard materials). Basically I rendered the same object, once in Max with no cage and a numbered ray offset, then again in Xnormal with the exact settings. The normal map looks different between the two in photoshop. The one from Max previews silky smooth and round in max's viewport, the one from Xnormal has some funky shading in some areas. It still looks mostly right, but it's just not as round as the Max version. I think it has something to do with binormals and tangents, but I'm not sure.

    Is there any way to ask for a max style recording of the normal map when it's layed down to the texture? I know plenty of people use Xnormal with a 3dsmax pipeline, and base their in-engine normal display to correspond exactly with max's way of displaying, so it'd be quite beneficial.

    If this doesn't make sense, I can show you an example of what I mean, but hopefully you know what I'm talking about.

    Thanks again for this awesome tool.

    poop.gif
  • conte
    Options
    Offline / Send Message
    conte polycounter lvl 18
    downloaded at last, really lovely tool!!!111
    thanks you soo much, jogshy
  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    Poop: Can you post two photos of the max's viewport showing that, please? Also if you have two examples I could load and test fast will help too.

    Btw, don't use the 3dsmax obj importer/exporter to make the test, it makes something rare with the smoothing groups. Try to use the SBM exporter to be 100% sure the object is the same.

    Oh, you need to flip vertically the green component of the normalmap to see it well in MAX ( use swizzle X+Y-Z+ ). This is because the DirectX effects need the texture origin at top-left and not at bottom-left.

    Also remember max uses antialiased rendering by default so enable it too in xNormal to compare similar results.

    Well, I'm gonna investigate a few that.
    thx Poop!
  • EarthQuake
    Options
    Offline / Send Message
    [ QUOTE ]
    I'm not 100% sure how to describe this problem, but I'll try.

    The way that Xnormal "records" the normal colors to the texture, creates rendering errors within the default 3dsmax preview (using DX display of standard materials). Basically I rendered the same object, once in Max with no cage and a numbered ray offset, then again in Xnormal with the exact settings. The normal map looks different between the two in photoshop. The one from Max previews silky smooth and round in max's viewport, the one from Xnormal has some funky shading in some areas. It still looks mostly right, but it's just not as round as the Max version. I think it has something to do with binormals and tangents, but I'm not sure.

    Is there any way to ask for a max style recording of the normal map when it's layed down to the texture? I know plenty of people use Xnormal with a 3dsmax pipeline, and base their in-engine normal display to correspond exactly with max's way of displaying, so it'd be quite beneficial.

    If this doesn't make sense, I can show you an example of what I mean, but hopefully you know what I'm talking about.

    Thanks again for this awesome tool.

    poop.gif

    [/ QUOTE ]

    I havent used max since 7 or 8, but even then the results max creates will give you errors in the realtime veiwports, but display correctly in max's renderer, i'm pretty sure it comes down to exactly how the tangents and bitangents are calculated, and really isnt documented anywhere. IIRC max's normals are only really usefull in UE3, and pretty much everything else will give you errors if you dont set up smoothing groups on your mesh in max. Atleast thats been my experience with it and every engine i've used. Max renders differently than pretty much everything, xsi, xnormal, etc....
  • poopinmymouth
    Options
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    I'll try to put together an example. I thought I had one ready to go, but I deleted the Xnormal version when cleaning up the PSD. The only thing you suggested Jogshy that I didn't try, was the SBM exporter. I'll be sure to see if that fixes it.

    EQ, as of Max 8 with SP2, the max baked normals display 100% perfectly in the max viewport, and render fine. I'd say max is prevalent enough in the game industry that a baker like this should probably have max compatible baking as an option. Then there is the fact that UE3 uses the same normals too, really makes it a no brainer. XSI and Xnormal are the two non standard tools you mentioned, whereas max and ue3 are extremely wide spread in their use.

    For example, the Neversoft engine uses Max normal standard, because that's the tool they use in house. I bet there are quite a bit of companies engines who follow the same logic.

    poop.gif
  • EarthQuake
    Options
    Offline / Send Message
    Whenever i've discused this with anyone writing tools or working on engines the problem has always been lack of documentation as to exactly what max(or ue3) does, so if you actually know what max is doing differently i(and i'm sure plenty of people) would be very interested to know. Otherwise......
  • poopinmymouth
    Options
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    I'll try to find out from the programmers at NS. They managed to get a shader working identically to how max's worked. I'm not a programmer, so I don't really think it's fair to expect an artist to know how tangents and binormals work, that's kind of what the people who make rendering engines and baking tools are expected to know. :-)

    poop.gif
  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    I think 3dsmax uses NVMeshMender or the D3DX one.
    Probably if I implement a XNormal ITangentBasisCaculator using it the problems will dissapear. In fact I prepared the SDK for it some time ago but I was too lazy to implement it. Just tell me if the SBM exporter does not solve it and I will start to code it tongue.gif With luck is just another 3dsmax2obj bug with the normals. Oh btw, i'm doing a SBM importer too for the next version.

    I agree... total compatibility with 3dsmax will be very good, just show me two photos with the problem so I can see wheres the problem. Also if you could send me the .max, shaders, objects, textures and your xnormal settings and files will be very nice pls wink.gif
  • poopinmymouth
    Options
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    Ok, example time. Plus I emailed you a max 8 file jogshy with my two example meshes inside.

    Face with preview. (click for big) The difference between the max bake and the xNormal sbm bake is slight, but the max version is very smooth with no weird spots. The xnormal bake has some wonkiness going on in the cheek and the flap of flesh to the side of the lips. Switching to SBM fixed most of the errors I was having before with a straigh obj export, but I'd like it even more if it was identical.
    face_test_example_thumb.jpg

    Normal maps themselves. (ignore the lip overlap) I had to tell Xnormal not to ignore backfaces, or it missed a crapload of rays in the temple and forehead area, even though that fixed the lip overlap. Not sure what was going on there.
    face_test_tex_thumb.jpg
  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    ok thx poop, i'm investigating it.
    Just a question... did you used the "Smooth normals" inside xNormal or kept it unchecked? I think the 3dsmax projeciton modifier averages all the normals to use them as extrusion direction when you grow the cage. Using the "smooth normals" option in xnormal should help.

    However, I think the small differences between the max and the sbm are due to the tangent basis like you suggested. Gonna implement the NVMeshMender/D3DX method to see if makes the render closer to 3dsmax.
  • EarthQuake
    Options
    Offline / Send Message
    Poop: Did max ever fix the whole hard surface modeling thing, where you need to set up smoothing groups, or use extra geometry for mechanical objects to look good in the viewport, or is there still a huge difference between that and the scanline renderer? It seems UE3 handles that stuff quite well. Is it still shite in the viewport? Thats really the only thing i'de like to see from max's normals, getting tangent space maps that actually work for mechanical stuff.
  • Joshua Stubbles
    Options
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    in Max 8 SP2, yes it looks like crap in the viewport.
  • EarthQuake
    Options
    Offline / Send Message
    Oh damn that sucks, i was hoping they would have actually figured that out by now. Can render it perfect in the scanline renderer but its shit anywhere else, useless max normals.
  • poopinmymouth
    Options
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    [ QUOTE ]
    in Max 8 SP2, yes it looks like crap in the viewport.

    [/ QUOTE ]

    Dunno how you're rendering it, I've yet to have any of my stuff handled wrong in max 8 sp2. I only ever use one smoothing group, and I have 90 degree edges often. Looks fine in the viewport.

    poop.gif
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    EXAMPLES PLEASE YOU GUYS smile.gif
  • Uly
    Options
    Offline / Send Message
    Uly polycounter lvl 15
    Here's an example from a semi-recent thingie, MoP.

    viewportvsrender.jpg

    Top image is the realtime shot of a tangeant space normal map.
    Bottom is an insanely poorly lit render. (It was the first time I'd used max.)
  • EarthQuake
    Options
    Offline / Send Message
    Yep, that. I'de be very interested to know if theres a way to actually get the scanline results there in realtime.
  • Joao Sapiro
    Options
    Offline / Send Message
    Joao Sapiro sublime tool
    same here laugh.gif i think that doom 3 engine doesnt have that issue, am i right ?
  • EarthQuake
    Options
    Offline / Send Message
    Doom3 dosent use regular tangent space maps, it uses some "hybrid tangent" or something, Chai wrote some really good info on this entire topic here: http://www.svartberg.com/tutorials/article_d3normalmaps/d3normalmaps.html
  • Uly
    Options
    Offline / Send Message
    Uly polycounter lvl 15
    Thanks for the link, good read.
  • Joshua Stubbles
    Options
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    [ QUOTE ]
    [ QUOTE ]
    in Max 8 SP2, yes it looks like crap in the viewport.

    [/ QUOTE ]

    Dunno how you're rendering it, I've yet to have any of my stuff handled wrong in max 8 sp2. I only ever use one smoothing group, and I have 90 degree edges often. Looks fine in the viewport.

    poop.gif

    [/ QUOTE ]

    I've used Ben Cloward's HLSL viewport scripts & Max's built-in DX9 viewport settings. On sharp angles, it never looks good. Ever.
  • EarthQuake
    Options
    Offline / Send Message
    Getting some real wierd issue here, results are just going to hell. Heres a comparison between max and xnormal.... Also, the 3d viewer hasnt worked for me in the last couple versions, nothing gets rendered there at all, no high, no low.....

    The mesh shows up fine in modo, maya, and max, uvs are all fine. And the lowres is simply a plane, so nothing posible there that could be wrong. And it renders correctly in max....

    xcrazyness.jpg
  • Joao Sapiro
    Options
    Offline / Send Message
    Joao Sapiro sublime tool
    oh damn...does that happen with all normals ?
  • Maddness
    Options
    Offline / Send Message
    Maddness polycounter lvl 11
    so far i've had the same problems with my normal maps through xnormal, where as max and modo do them just fine in the same situation.

    I tend to use xnormal right now to view my textures/normals "in engine" so to speak.
  • Joao Sapiro
    Options
    Offline / Send Message
    Joao Sapiro sublime tool
    how do i save the edited cage in 3d view ? i tottaly forgot :|
  • EarthQuake
    Options
    Offline / Send Message
    This is the first time i've had a problem like this, i've done countless bakes from xnormal that turn out perfectly fine...... You should post some of your examples too maddness, if you're having problems.
  • Maddness
    Options
    Offline / Send Message
    Maddness polycounter lvl 11
    i'll post some up as soon as i get home to do so. they'll be in this post after i edit it.
  • EarthQuake
    Options
    Offline / Send Message
    Ok i found the problem, it dosent read the .obj correctly, i tried .lwo for my highres and it works fine. Now this is great except that .lwo wont save custom normals and modo dosent have any way to export normals like max or maya, so i still cant use it(this model needs to be flat-shaded). It would be great if it read the material files with the .lwo's smoothing settings.

    edit: actually thats wrong, its still a little screwed up when i add in the backing material, but comes out fine with .lwo and only 1 highes object? confusing....

    edit2: oddly enough turning OFF ignore backfaces seems to fix it? Which makes me think its importing the normal direction incorrect....
  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    Ok Earth, RAR received.

    1) Yes, it happens to me too with your files. Using cages and not using them. With the faster raycaster and with the conservative one. With the "smooth normals" option and without it. Yes, some weird thing happens...

    2) I imported all in 3dsmax 9 sp2. Reset XForm+Collapse. Saved both highpoly files as SBM. Then rendered ok in xNormal with 0 rays failed(even with the "discard backface hits" option enabled). Very strange.

    3) I imported all in Maya 8.5. Froze transformations(including normals). Triangulated all. Re-exported. The error persist when you render in xNormal with the "discard backface hits" enabled. Keeping it **enabled**, if you render sepparately the grout.obj and the wall, all is ok! ( crazy, crazy and crazy )

    4) The next test was to use your original OBJ files without the "discard backface hits" option. All rendered well.

    So I bet the problem is some kind of weird bug in the "discard backface hits" option or with the vertex normals importing OBJs. That explains too why Poop got some face errors when rendering the head. But no matters, with the new 3.11.0 your files render ok so apparently will generate the maps well once is released(I think by June)

    I need to investigate this issue more in depth, meanwhile please keep the "discard backfaces hit" unchecked!

    About the lowpoly not displayed in the 3d viewer I suspect is an ATI bug with DX9 ( try to change the default xnormal graphics driver to OpenGL then ). I'm waiting the Radeon 2400XT AGP to come to life to buy an ATI card with play with! On my old NVIDIA and S3 card seems to work.

  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    [ QUOTE ]
    how do i save the edited cage in 3d view ? i tottaly forgot :|

    [/ QUOTE ]

    The "save meshes" button!

    Alternatively you can export the Projection Modifier and meshes from 3dsmax 6/7/8/9 to a .SBM file. Also to use an external cage in OBJ,DAE,XSI,3DS, etc format.
  • EarthQuake
    Options
    Offline / Send Message
    I have a geforce 7600, and the 3d viewer used to work fine for me. I really dont actually use it for anything anymore(use our ingame previewer) but i wanted to just check it to see if the models were even rendering right there.... and it just displays nothing, anyone else have this problem?
  • Wokky
    Options
    Offline / Send Message
    Wokky polycounter lvl 17
    I find that when I start up the 3D viewer, the camera is in an awkward place away from the model and I always have to press that button at the top which re-centres the view on the model. Could be the same thing for you.
  • Joao Sapiro
    Options
    Offline / Send Message
    Joao Sapiro sublime tool
    thanks jogshy !!!
  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    [ QUOTE ]
    I have a geforce 7600, and the 3d viewer used to work fine for me. I really dont actually use it for anything anymore(use our ingame previewer) but i wanted to just check it to see if the models were even rendering right there.... and it just displays nothing, anyone else have this problem?

    [/ QUOTE ]
    Can you see the grid and UI or just the models dissapear? Do you use the OpenGL graphics driver or the DX9? Windows vista? Happens that too running in windowed mode?

    The latest NVIDIA and ATI drivers are a little mess, specially the Vista ones, because they are adapting to the upcoming OpenGL Longs Peak/Mt.Evans and also tweaking the DX10.

    Or perhaps there is some bug in my current implementation, gonna see if I can improve the compatibility between cards.

    Do you see any texture or shader error in the c:\Documents and settings\[Your username]\My documents\xNormal\xNormal_debugLog.txt ?

    [ QUOTE ]

    I find that when I start up the 3D viewer, the camera is in an awkward place away from the model and I always have to press that button at the top which re-centres the view on the model. Could be the same thing for you.


    [/ QUOTE ]
    When you exit the 3d viewer the settings are saved automatically ( that includes the last camera and light positions). If you re-assign the meshes perhaps the old position saved won't fit your new geometry, so could need to press the "auto-center" button.

    Also sure the "show lowpoly models" checkbox is checked and your lowpoly model is marked as "visible" in the list hehe! blush.gif Also caution with normals flipped or backface cull will discard them(but in this case usually you should see "something" in the screen).

    ps: I found the "discard backfaces hit" bug. Now is corrected and the upcoming next version will include this fix.
  • Joao Sapiro
    Options
    Offline / Send Message
    Joao Sapiro sublime tool
    hey jogshy , i have a question :

    In 3ds max, you can get the lowpoly model and with the normal map you can bake ambient oclusion from the highpoly detail , its not as accurate as the highpoly source but its pretty good , and useable when you have to deliver stuff fast ( at least in my case ) , do you think you could implement that option in xnormal ? like you load the lowpoly and the normal map and bake an ambient oclusion based on that.

    sorry for the long winded post, im just sick of max crashing and sucking all my memory.
  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    [ QUOTE ]

    In 3ds max, you can get the lowpoly model and with the normal map you can bake ambient oclusion from the highpoly detail , its not as accurate as the highpoly source but its pretty good , do you think you could implement that option in xnormal ?

    [/ QUOTE ]
    You broke one of the surprises of the 3.11.0! tongue.gif
  • Joao Sapiro
    Options
    Offline / Send Message
    Joao Sapiro sublime tool
    ahahah ! no kidding ??? that would be awesome ! another thing, the cavity mapping utility is sweet, but it still could be polished, i can send you images of what i mean if you want smile.gif

    keep up the amazing work, xnormal is a life saviour !
  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    [ QUOTE ]
    ahahah ! no kidding ??? that would be awesome ! another thing, the cavity mapping utility is sweet, but it still could be polished, i can send you images of what i mean if you want smile.gif

    [/ QUOTE ]
    I'm rewritting the cavity map too ( because the current is not very good.. the algorithm is weak ) tongue.gif Any image is welcome tho!

    I have tons of new things coming for the 3.11.0, but first I wanna solve some bugs and minor features so probably will release a 3.10.6 before, not sure.
  • ironbearxl
    Options
    Offline / Send Message
    ironbearxl polycounter lvl 18
    Nice work as usual Jogshy!
    One sort of bug in the 3d viewer; when I'm in windowed mode, if I ALT-TAB out my cursor remains in the boundary of of the window, not allowing me to go outside of it.
  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    [ QUOTE ]
    Nice work as usual Jogshy!
    One sort of bug in the 3d viewer; when I'm in windowed mode, if I ALT-TAB out my cursor remains in the boundary of of the window, not allowing me to go outside of it.

    [/ QUOTE ]
    Ooooopz, true! I need to tell the program to unlock the mouse rect if it lost the focus.
  • conte
    Options
    Offline / Send Message
    conte polycounter lvl 18
    all programmers are so awesome?
    or only jogshy does?
  • Joao Sapiro
    Options
    Offline / Send Message
    Joao Sapiro sublime tool
    also jogshy, is it possible that when we save in targa format it creates an alpha channel of the normals and leave the grey areas out of the alpha channel ? that would be sweet smile.gif
  • EarthQuake
    Options
    Offline / Send Message
    Right now the alpha is height(for parrallax or whatever).... But it would be nice to have an option for that.
  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    [ QUOTE ]
    also jogshy, is it possible that when we save in targa format it creates an alpha channel of the normals and leave the grey areas out of the alpha channel ? that would be sweet smile.gif

    [/ QUOTE ]
    No entiendo. I don't understand!

    The normals will use 3 channels ( well, could compress it to 2 for tangent space but that will generate some problems). The height map is stored in the alpha( in case the output file format allows to use alpha channels). Need to pack it in that way because i'm absolutely out of texture samplers and registers in SM2.0.
  • EarthQuake
    Options
    Offline / Send Message
    I think he's asking if you could have an option that would let you create a mask of the normals in the alpha channel.

    Say you have a ring shaped highres, and you want to render it onto a single quad so you can use alphatesting in your engine, so you'de need a mask of which parts on the map traced something, and which parts missed. I've just been using photoshop to do this(render twice as large, magic wand selection, create alpha layer, then size down to get AA), but it would be cool if you had an option to create a mask in the alpha channe i guess, as long as it worked with turning the dilation filter off, and was anti-aliased.....
  • jogshy
    Options
    Offline / Send Message
    jogshy polycounter lvl 17
    Something like this?

    maskju3.gif

    Nice, gonna code that too.
  • Joao Sapiro
    Options
    Offline / Send Message
    Joao Sapiro sublime tool
    the more antialised the better laugh.gif
  • EarthQuake
    Options
    Offline / Send Message
    Yeah, something thats antialiased would be best, otherwise i wouldnt really personally have a use for it.
191012141559
Sign In or Register to comment.