Author Topic: Of transparencies and rendering (advanced)  (Read 424 times)

Legacy_s e n

  • Hero Member
  • *****
  • Posts: 654
  • Karma: +0/-0
Of transparencies and rendering (advanced)
« on: April 28, 2011, 01:10:47 pm »


               PRELUDE

1-Im cooking something new starting from nwn2 city interior tileset, and since its flavour starts to b tasty, i decided to add a few spices in the pot. i remembered the awesomeness of gaonengs skyboxed windows hak to extend castle interior, so i gave it a try and decided to add something very similar to this new tileset; i decided to use a single tile containing the skyboxes (in every needed rotation: 0, 90, 180 and 270 deegrees), all walled (i mean its a wall tile, so black seen from above, duplicated for every window crosser variation in the set file): that way allows me to add as many skybox variants as i want changing that single wall tile containing the skyboxes instead of creatingvariations for all the window tiles. (also, i HAD to do that since nwmax hasnt a disable vert snap to nearest int value when exporting, and that would cause my geometries imported from nwn2 to create glitches on roofs and walls, anyway, i am happy enough with mdl suite).

2-
once i got this working, i decided to completely remove the faces of the mesh that is the window itself (the glasses and their outer frame) and create a placeable window to place, so i can get different versions of the same placeable, and i can have it animated (open close animations). following gaoneng sytle, i used 2 meshes and textures to create a-the semi-opaque glass (no alpha on the tga, just controlled with opacity settings in max and b-the inner frame of the window (alpha layer. with no grey values, just black OR white). after a few issues with animations for reasons too long to explain, especially bacause remain mysterious to me, i got the placeable work!

3-
now, i remembered the cool light shafts that codi 1st then worm and others used to get some "solid" light to come out of thier windows so i said... thats what i need! let me rip off that tile from wOrm haunted interior and see if i can do the same! quickly done, my shaft is working, BUT, then i decided to link it to animloop 1 you know for having the option to enable just when you want! this means you need to link the mesh under the tile's a node, and set the basic animation to have it on/off. since i wanted to add daynight animations that controls the flow of self illumination and darkening it a bit at night, i went for a move along z axis animation so when disablet it just hides undeer the floor (instead of animating the texture opacity).

4-
and now the issue that gives the name of the topic:
i safely got the shaft working, all was rendering good, in every perspective, i could (and i stll can, but let me explain) see the skybox, the opened or closed placeable window and the shaft, all the transparencies and opacities and alpha stuff and animations working great! UNTILl i decided to add a tile with 2 windows: this means i had to duplicate the light shaft, easy! i did it, and tried. now, under certain perspectives with the window opened, or almost under every perspective (be it in game or in the toolset) with windows closed, the shaft causes the window portion that intersecates with the mesh, to NOT render. this is the issue, and i have no solution. i tried to move the shafts pivots, i tried to merge the shafts in a single mesh, withut effort.


FINAL CONSIDERATION

i think, though i will need to test extensively this thing, that the issue is caused by perspective overlap (collision) of normals of objects under the a node; this causes everything that should be rendered "through", to disappear. adding other animloops with static windows caused the same kind of issue.


CONCLUSION

if you want to share your experience, if you want to test my tiles (be it with a hak and mod i provide you or opening those tiles and other models in max) to see if there is something wrong, or its just a limit of aurora engien... plz do it and reply just under here!



':wizard:'
               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Of transparencies and rendering (advanced)
« Reply #1 on: April 28, 2011, 02:28:19 pm »


               Try detaching and then reattaching the a dummy to the model.

Geometry is usually rendered in the order it is provided in the model file, which is usually going to be order you attach objects to the aurorabase in max - though I'm pretty sure it considers node tree structures if there are any. Actually, the a dummy should always render last, but if it isn't doing then I'd certainly move it to the end of the model by re-attaching just to be safe.
               
               

               
            

Legacy_s e n

  • Hero Member
  • *****
  • Posts: 654
  • Karma: +0/-0
Of transparencies and rendering (advanced)
« Reply #2 on: April 28, 2011, 08:57:59 pm »


               Hi Six, I tried but it didnt work '<img'>
here is a ss showing the issue

img861.imageshack.us/img861/7457/trissue.jpg

you see the rendering is depending on perspective, thats what makes me thing of colliding normals under the same a node
               
               

               
            

Legacy_Zwerkules

  • Hero Member
  • *****
  • Posts: 1997
  • Karma: +0/-0
Of transparencies and rendering (advanced)
« Reply #3 on: April 28, 2011, 09:43:21 pm »


               I've seen something like this before in tiles that used a texture with an alpha to place some shadow over a mesh, like the doorways that get darker the further inside the building you get. I don't know why, but sometimes this happens and sometimes it doesn't, but if the 'transparencyhint' isn't set correctly, the shadow is rendered without an alpha channel and the underlying texture becomes comepletely transparent.
Check the transparencyhint of the light shafts and if it is 0 change it to something else and see if that helps.
               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Of transparencies and rendering (advanced)
« Reply #4 on: April 29, 2011, 03:03:07 am »


               Ah, I didn't realize you were talking about a placeable rendering behind. In that case, try using an a dummy on the placeable as well. Zwerkules might be onto something too - I do know, however, that linking to an anim dummy sends non-creature object rendering to hell. Although if you didn't link the light shaft to the a dummy, creatures would be cut off when entering its beam, so it's a lose-lose situation.

An alternative solution would be to just make two versions of each tile - one with window open, one with window shut.
               
               

               


                     Modifié par _six, 29 avril 2011 - 02:03 .
                     
                  


            

Legacy_s e n

  • Hero Member
  • *****
  • Posts: 654
  • Karma: +0/-0
Of transparencies and rendering (advanced)
« Reply #5 on: April 29, 2011, 11:40:20 am »


               atm everything is under a dummy, be it placeable or tiles
the strange thing, is that my setup for a single window (so single shaft) works more than well. no issues till i clone the mesh. once i cloned the shaft, the issue comes, be it 2 shafts under the anim node, or a merged mesh (with chilli) for the 2 shafts. now i think ill try convert the tile to aurabase to see if works what Zwerkules suggests; another thing i am going to try is redimension one of the 2 shafts to something very very tiny (like 1 cm3 of volume) so i can get the confirm it is perspective intersection/collision of faces under the same node, what is causing the issue, though even if it is that, i dont get the reason why the sky is rendering but the window not :--
               
               

               
            

Legacy_s e n

  • Hero Member
  • *****
  • Posts: 654
  • Karma: +0/-0
Of transparencies and rendering (advanced)
« Reply #6 on: April 29, 2011, 12:22:20 pm »


               report, transparency hint doesnt solve, moving along the faces changes the perspective where it doesnt render (that makes me think its face related, though i think it doesnt consider the z axis, just the xy (as if it extrudes its z positions to infinite, not sure if verts or normals, probably normals)
               
               

               
            

Legacy_s e n

  • Hero Member
  • *****
  • Posts: 654
  • Karma: +0/-0
Of transparencies and rendering (advanced)
« Reply #7 on: April 29, 2011, 02:41:38 pm »


               it seems i almost solved this! i changed the classifications of the placeable to character, as well as the tile containing skyboxes. now, rendering is ok aside the shaft doesnt render through windows (i think if i set all the tiles of the window crosser to character i will get also that rendering, i'll try later
               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Of transparencies and rendering (advanced)
« Reply #8 on: April 29, 2011, 03:03:47 pm »


               I noticed that you stated you "cloned" the shaft... did you clone it as a copy or an instance?  A complete copy should work as it renames it, but an instance will not work since the engine only see's the first one, the cloned/instance is a duplicate and gets all of it's cues from the main one.  So that might explain why it is having issues.
               
               

               
            

Legacy_s e n

  • Hero Member
  • *****
  • Posts: 654
  • Karma: +0/-0
Of transparencies and rendering (advanced)
« Reply #9 on: April 29, 2011, 03:56:08 pm »


               cloned as copy, i learnt that sad instance lesson on my skin when working over one of my 1st projects, i think i deleted teh root mesh and everyhting got deleted, i saved and lost all instanced clone meshes  (at those times i didnt even know max creates auto backups lol)
               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Of transparencies and rendering (advanced)
« Reply #10 on: April 29, 2011, 04:18:16 pm »


               

Bannor Bloodfist wrote...

I noticed that you stated you "cloned" the shaft... did you clone it as a copy or an instance?  A complete copy should work as it renames it, but an instance will not work since the engine only see's the first one, the cloned/instance is a duplicate and gets all of it's cues from the main one.

To avoid any confusion for anyone, the NWN model format doesn't actually support instancing of geometry anyway - NWMax only actually exports the first instance of objects found in max. It would certainly be possible to rewrite it to handle instances and their transforms when exporting, not that I'm offering ':whistle:' Just thought I'd clarify that the engine doesn't so much have a problem with instancing, so much as that your model files will never even contain instances.

Though an instance can be made unique with, unsurprisngly, the Make Unique option '<img'>
               
               

               


                     Modifié par _six, 29 avril 2011 - 03:20 .