Guest Red Ocktober Posted February 17, 2013 Share Posted February 17, 2013 after looking at the latest image from the upcoming Leadwerks 3 editor of a lightmapped scene, and also because of the limited capabilities of the machine i'm currently forced to use ( my main dev machines are down and out for the count and i'm using an antique system with a gefore 6200 era video card), i decided to see if i could do some lightmapping in Leadwerks 2.5 in hopes that i could find a way to get a scene up and running that wouldn't drag my system's performance down to that of a slide show... point lights are great in LW, they provide really decent lighting and shadows, but they also inflict a noticeable performance hit when they are used in even the simplest of scenes... especially if more than one point light is used ... paradoxically, point lights appear to degrade performance at a higher degree than the use of complex geometry... using lightmaps seemed as if it would provide a means of circumventing this while providing an alternative way of getting some similar lighting and shadowing effects... so, i decided to try out a lil quick and dirty experiment using only the low cost tools i already had available... no texture baking, no complex logic... below is the results of the first experiment... the textured cube was lightmapped in Giles, exported as two .x files (.x and the .x_lmap) and then merged together in UU3D and exported as a Leadwerks .gmf... next, two .mat files were written up to correspond to the two mat file entries in the model viewer, one each for each mesh merged in UU3D... the .mat file for the lightmapped mesh part was inspired by something i did a ways back (the Mercury space capsule with the transparent placard) on the idea that i could get a lightmap effect by using the identical meshes spit of by Giles and making a mask out of the lightmap image used by the lightmap mesh it produced, and setting the blend to alpha, similarly to how i did the flag and United States placards on the spacecraft model... the circular light (simulating a flashlight pointing at the cube), and the lighting on the top of the cube (simulating an omni light abive the cube), are entirely the results of the lightmap... no Leadwerks lighting contributed to the effect... the terrain in the screenshot is lit normally by the single directional light (subdued and darkened)... these initial results turned out better than i expected... not great, but definitely something worth pursuing... and this almost doubled the frame rate on the antiquated system i'm currently using when compared to the same scene with a single point light... --Mike Quote Link to comment Share on other sites More sharing options...
Flexman Posted February 17, 2013 Share Posted February 17, 2013 Can't see the screenshot for some reason? Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
shadmar Posted February 17, 2013 Share Posted February 17, 2013 Maybe it's so bright that it maches the background Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted February 17, 2013 Share Posted February 17, 2013 this new fangled hi tech cloud stuff... i must be getting too old to understand how to use it... or maybe it was due to the fact that i was up all night on this d@mned computer how 'bout now... is it visible? --Mike Quote Link to comment Share on other sites More sharing options...
gamecreator Posted February 17, 2013 Share Posted February 17, 2013 Not for me. Where are you uploading the image to? Maybe try http://tinypic.com/? Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted February 17, 2013 Share Posted February 17, 2013 ok... so much for skydrive (at least until i figure out how to use it)... how's it look now... --Mike Quote Link to comment Share on other sites More sharing options...
gamecreator Posted February 18, 2013 Share Posted February 18, 2013 Last one worked! Interesting... Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted February 20, 2013 Share Posted February 20, 2013 more lightmapping experiments with a mesh i had from done in 3DRAD... same technique as above... again, i'm degrading the abilities of Leadwerks to see how stuff runs on low end systems (like the one i'm relegated to for the forseeable future)... the subject machine for these is a Dell Optiplex something or the other with a GeForce 6200... Dungeon scene with no lights... (atmosphere in scene though not needed) 17 fps in editor... 19 fps in lua app... Dungeon Scene with 1 point light... just one point light... brought the same exact scene down to 5 to 6 fps in editor... about same in lua project... Though it looks a lot better than the scene with no lights, the performance hit is significant on low end systems, with just a single point light in the scene... it appears that a single point light will degrade performance more than that the addition of more complex geometry... Dungeon Scene with no lights, atmosphere added with contrast, brightness, and saturation turned up... adding an atmosphere doesn't seem to cause any performance hit at all... so there it is... for those targeting low end... i guess L3 will perform even better since a lot of L2 capabilities haven't been included... --Mike 2 Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted February 20, 2013 Share Posted February 20, 2013 i dont get how you were able to blend 2 materials. can you reiterate how you did that? very cool stuff. Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted February 20, 2013 Share Posted February 20, 2013 from Giles, you get 2 meshes if you export as .x files... i loaded them both into UU3D (loaded the .x merged the .x_lmap)... saved as .gmf which saves the hierarchy... when loaded into model viewer you can see the different sub meshes and .mat file entries... just write up the material files to correspond... the .mat file for the lightmapped sub mesh typically would look like this... texture0="abstract::Lightmap01.dds" blend=alpha depthmask=0 zsort=1 overlay=1 this blends the lightmap output image (masked transparent image) with the textures below... hope that helps... like i said, it's a quick and dirty approach --Mike Quote Link to comment Share on other sites More sharing options...
paramecij Posted February 20, 2013 Share Posted February 20, 2013 What do you mean when you say "saved from UU3D to gmf using hierarchy and sub meshes" ? ... You mean you actually get two meshes inside the .gmf from UU3D, not just one mesh with 2 surfaces each having it's own .mat ??? I was under the impression sub-meshes were not possible with UU3Ds gmf exporter.. Have you considered making a second uv channel for the baked lightmap texture in giles (i'm assuming that's what it's for) and using one of the leadwerks *_gi shaders ? - edit: Just trying out Giles, somehow all my .obj's came in flat as paper, is this normal or am I doing something wrong? Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted February 20, 2013 Share Posted February 20, 2013 i didn't say that i "saved from UU3D to gmf using hierarchy and sub meshes"... i didn't change any settings in UU3D... i simply loaded the x. mesh (that Giles output), then loaded the lightmap .x mesh (that Giles also output), then saved as .gmf... (no bones and anims) that's it... before you save from UU3D, ya gotta make sure the material names match the mesh group names in UU3D... (no extensions and no spaces in the names)... these names will be what you see in the model viewer when the hierarchy is exploded... (ie Surface 1-> Material->algaebricks.mat) they're what i used to name the .mat files (one each for each separate texture) when i created em... here's the files (for the first lightmap experiment above... the cube): https://docs.google....dit?usp=sharing download, and unzip the folder to your Leawerks/models folder, then open up the Leadwerks editor and add a tmix2 object to the scene... the files are as follows: trimix.x and trimix_lmap.x -- output from Giles load each one into UU3D (merge the second one) and look at the groups and materials box... make sure the material names match the mesh group names... no extensions and no spaces in the names... tmix.gmf -- saved from UU3D as .gmf i hope this helps show what i'm doing here... --Mike Quote Link to comment Share on other sites More sharing options...
macklebee Posted February 21, 2013 Share Posted February 21, 2013 ah... ok i think what was confusing for people was that you said: saved as .gmf which saves the hierarchy... when loaded into model vieweryou can see the different sub meshes and .mat file entries... In actuality, UU3D just makes it one mesh with two separate surfaces and the lightmap surface material uses 'zsort' to place it on top. Still looks nice and in this case it might be better to only be 1 mesh. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
paramecij Posted February 21, 2013 Share Posted February 21, 2013 Yes, as macklebee pointed out, that statement was the cause of confusion... by sub meshes I pictured something like this: Otherwise I get what you are doing.. except that i'm unable to properly import my stuff in giles,... as of yet.. Quote Link to comment Share on other sites More sharing options...
flachdrache Posted February 21, 2013 Share Posted February 21, 2013 Well, i think you could actually extract a second lightmap for dynamically switching them e.g. if a lightning strikes or the classic "lightstyles" e.g. wave + flickering lights - however, doing the light setup in the lightmapper, exporting the light positions used (for pointlights in le, doing specular highlights) and generally organizing / sorting parts of a model from a level and its lightmaps ... seams to be a tedious and quit annoying workflow imho. Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted February 21, 2013 Share Posted February 21, 2013 yes... surfaces! not sub meshes! sorry for the confusion.... --Mike Quote Link to comment Share on other sites More sharing options...
Josh Posted February 21, 2013 Share Posted February 21, 2013 This will still have the overhead of the deferred renderer...why do it? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted February 21, 2013 Share Posted February 21, 2013 because you put it in there... and i don't know how to disable it... because... the scenes you see above run at 20 + fps without any lights... and 5 to 6 fps when a single point light is added... 23.8 fps from a lua interpreted app run from script editor... with an atmosphere added... because of the hardware i'm stuck with at the moment every frame per sec counts... because the deferred renderer amy still come in handy in given situations... but mainly because Leadwerks 3 is still a sugar plum, dancing in my head... maybe after xmas in February, and i get to play around with 3's built in lightmapper, i'll be able to abandon all this... --Mike Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted February 21, 2013 Share Posted February 21, 2013 maybe after xmas in February, and i get to play around with 3's built in lightmapper, i'll be able to abandon all this... --Mike I have been horsing around with sdl and the likes trying to figure out how this stuff works. Here is to hoping for abandonment. Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted February 21, 2013 Share Posted February 21, 2013 yeah to that Chris... in the meantime... here's another shot of no lights (with atmosphere) running at an astounding 28+ fps from a BlitzMax executable... --Mike Quote Link to comment Share on other sites More sharing options...
shadmar Posted February 22, 2013 Share Posted February 22, 2013 Looks great mike :-) PS. You can also use 2 uv channels for this to prevent using several meshes, I posted a shader for this somewhere in here for Roland. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted February 22, 2013 Share Posted February 22, 2013 that's what i was looking for!!!! hey shad... any plans for a low performance version of your ocean shader for LW3? --Mike Quote Link to comment Share on other sites More sharing options...
shadmar Posted February 22, 2013 Share Posted February 22, 2013 http://www.leadwerks...ons/#entry44550 About oceans in LE3 would probably be without depth and just a wavy surface mesh. Will have a look when released. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted February 22, 2013 Share Posted February 22, 2013 thx for the linky... looking at it now... yeah, that sounds like it should be good enough for ocean 3... i mean seeing as everything else graphics related appears to have been degraded... thanks again Shad... --Mike Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.