Sign in to follow this  
rhumbaflappy

LWM and meshes

Recommended Posts

Hello,If you see the attached image you can see that the additionnal mesh is always cut by the the old shoreline.I have created landclasses (desert) in order to see what happens.Desert LWM areas in ocean appears, immediatly near de coast and in ocean where it was before no land lanclasses.I have done various tests but without results.Do you know the way to 'expand' the mesh ?Thanks for your answerChristian

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Christian.We've had a few posts concerning this problem. The sad answer is: there is no way to 'unflatten' mesh after an LWM has flattened it.The effects cannot be undone. There are basically 2 choices:1) Remove or rename or replace the BGL that causes the flattening. ( a lot of work to replace, and poses some problems for distibuted scenery, as that's not what many simmers are willing to do ).2) Re-mesh the area with the use of LWM invisible flattens. ( This method is a little crude, and imprecise ). Search this forum for 're-mesh', 'remesh' and 'knnygar' ( author ), for some posts.Neither I or anyone else has found a cure for this within LWM coding.I'm about 95% certain it does not exist, and once the datastream has absorbed the flattening of the mesh, it 'forgets' the original mesh verticies.Dick

Share this post


Link to post
Share on other sites

Hi there,May be this is rubish but I just had a thought that there is one thing that we might be able to control. Order of the stream processing.If we change the default filename or name the new LWM bgl file such that it is processed first (obviously the new bgl must go on the same folder as the default bgl or the scenery needs to be installed on higher priority) then it might be possible to go around this problem. This was just a thought but never tried the idea!What I am not sure is whether the mesh is flattened by both bgls or just the last one (or first one). If this is the case then the suggestion is actually rubish!! ;)Cheersjmf

Share this post


Link to post
Share on other sites

Hello,Thanks for your answer and sorry for my ignorance of previous messages.It seems that FS handles coasts in a special way.In my area, thera are some lakes that are not at the right place. I suppose I will encoutered the same problem in replacing/removing them.I have done also some LWM tests with imbricated polygons.The scene you can see is only made of polygons (Two are polygons with 2 points);The altitude of the different surfaces of water in the craters is not the same.Tests have also to be done with VTP.Christian

Share this post


Link to post
Share on other sites

Hi Christian.Note how the remeshing assumes an LOD of 13. It presents a mesh with a highly oversampled/blocky look. It's a little hard to control, but there yet may be a way to control it. Very tedious to code by hand, so automating it somehow, with an 'interpolating' formula, may work better.I don't know the effect on framerates of remeshing large areas.FS2000/CFS2 had a more varied set of flattens, using what I know of as AREA16N SCASM commands. I don't know offhand if that coding still works in FS2002. I do remember that coding to be very CPU intensive, and reduces framerates quite a bit. Those codes had sloping mesh-altering commands, as well as regular flattening.Dick

Share this post


Link to post
Share on other sites

I just got to this problem myself. :-(Just a while ago I finnished the code to create detailed shorelines. I had expected that once I had done another VTP bgl to exclude the default lines their flattening function would disappear as well. Silly me.I thought then thatSo I thought that I could place some LWM flattening to get rid of the effect of the old shorelines, but with lower priority than the mesh scenery I

Share this post


Link to post
Share on other sites

Hi Juan.If you look up posts by 'knnygar' ( over the last year ), he has trod the path you are on, as well.The flattening is a funtion of the default LWMs, and I beleive there is no way to undo it, as I have already explained. Re-meshing with LWMs is about the only option left if you are aiming for distribution of the scenery.We might be able to devise clever Macros to help with the remeshing:;ReMeshMacros.IncReMesh8x8 Macro X, Y, Height, Fraction; ReMesh8x8 is an x, y grid of 8x8 to raise or lower elevations in an LOD13 Area. ; Each Macro call counts 4 polygons. BYTE 2 SWORD Height ; // Whole elevation value in meters BYTE Fraction ; // Fractional elevation value in 1/128 meters BYTE ( X * 32 ) + 0 ; BYTE ( Y * 32 ) + 0 ; BYTE ( X * 32 ) + 31 ; BYTE ( Y * 32 ) + 31 ; BYTE 2 SWORD Height ; // Whole elevation value in meters BYTE Fraction ; // Fractional elevation value in 1/128 meters BYTE ( X * 32 ) + 0 ; BYTE ( Y * 32 ) + 31 ; BYTE ( X * 32 ) + 31 ; BYTE ( Y * 32 ) + 0 ; BYTE 2 SWORD Height ; // Whole elevation value in meters BYTE Fraction ; // Fractional elevation value in 1/128 meters BYTE ( X * 32 ) + 16 ; BYTE ( Y * 32 ) + 0 ; BYTE ( X * 32 ) + 16 ; BYTE ( Y * 32 ) + 16 ; BYTE 2 SWORD Height ; // Whole elevation value in meters BYTE Fraction ; // Fractional elevation value in 1/128 meters BYTE ( X * 32 ) + 0 ; BYTE ( Y * 32 ) + 16 ; BYTE ( X * 32 ) + 31 ; BYTE ( Y * 32 ) + 16 ;EndMThen...include TDFMacros.incinclude TDFHeaders.incinclude ReMeshMacros.inc; ReWorked Coast N31* 29.44' E26* 30.85'BGLHeader 32, 30, 28, 25, LWMHeader, TerrainHeaderStart LWMHeader label word LWMFileHeader 513, LWMIndexStart, LWMStart, LWMEndLWMStart label worddatamark_0 label word LWMDataAreaFill1x1 0, 1, 1, 18, 13 LWMDataAreaDrawPolygonsEx 7, 2, 1, 18, 13, 249 ReMesh8x8 0, 0, 5, 0 ReMesh8x8 0, 1, 10, 0 ReMesh8x8 0, 2, 5, 0 ReMesh8x8 0, 3, 5, 0 ReMesh8x8 1, 0, 5, 0 ReMesh8x8 1, 1, 10, 0 ReMesh8x8 1, 2, 10, 0 ReMesh8x8 1, 3, 10, 0 ReMesh8x8 2, 0, 5, 0 ReMesh8x8 2, 1, 10, 0 ReMesh8x8 2, 2, 25, 0 ReMesh8x8 2, 3, 25, 0 ReMesh8x8 3, 0, 5, 0 ReMesh8x8 3, 1, 10, 0 ReMesh8x8 3, 2, 25, 0 ReMesh8x8 3, 3, 25, 0 ReMesh8x8 4, 0, 5, 0 ReMesh8x8 4, 1, 10, 0 ReMesh8x8 4, 2, 25, 0 ReMesh8x8 4, 3, 25, 0 ReMesh8x8 5, 0, 5, 0 ReMesh8x8 5, 1, 10, 0 ReMesh8x8 5, 2, 25, 0 ReMesh8x8 5, 3, 25, 0 ReMesh8x8 6, 0, 5, 0 ReMesh8x8 6, 1, 10, 0 ReMesh8x8 6, 2, 25, 0 ReMesh8x8 6, 3, 25, 0 ReMesh8x8 7, 0, 5, 0 ReMesh8x8 7, 1, 10, 0 ReMesh8x8 7, 2, 25, 0 ReMesh8x8 7, 3, 25, 0 ReMesh8x8 0, 4, 5, 0 ReMesh8x8 0, 5, 5, 0 ReMesh8x8 0, 6, 5, 0 ReMesh8x8 0, 7, 5, 0 ReMesh8x8 1, 4, 10, 0 ReMesh8x8 1, 5, 10, 0 ReMesh8x8 1, 6, 10, 0 ReMesh8x8 1, 7, 10, 0 ReMesh8x8 2, 4, 25, 0 ReMesh8x8 2, 5, 25, 0 ReMesh8x8 2, 6, 25, 0 ReMesh8x8 2, 7, 25, 0 ReMesh8x8 3, 4, 25, 0 ReMesh8x8 3, 5, 25, 0 ReMesh8x8 3, 6, 25, 0 ReMesh8x8 3, 7, 25, 0 ReMesh8x8 4, 4, 25, 0 ReMesh8x8 4, 5, 25, 0 ReMesh8x8 4, 6, 25, 0 ReMesh8x8 4, 7, 25, 0 ReMesh8x8 5, 4, 25, 0 ReMesh8x8 5, 5, 25, 0 ReMesh8x8 5, 6, 25, 0 ReMesh8x8 5, 7, 25, 0 ReMesh8x8 6, 4, 25, 0 ReMesh8x8 6, 5, 25, 0 ReMesh8x8 6, 6, 25, 0 ReMesh8x8 6, 7, 25, 0 ReMesh8x8 7, 4, 25, 0 ReMesh8x8 7, 5, 25, 0 ReMesh8x8 7, 6, 25, 0 ReMesh8x8 7, 7, 25, 0datamark_1 label word Cell_440_166 EQU LWMCellID 0, 0, 3, 440, 166 LWMIndexStart label word LWMIndexHeader 1, LWMIndexData LWMIndexData label word LWMIndexEntry Cell_440_166, LWMStart, datamark_0, datamark_1LWMEnd label wordThis is where Macros are of a great help in that they can be customized and save a great deal of coding. ( Remeshing will be pretty tedious ).Dick

Share this post


Link to post
Share on other sites

Hi, Dick.This time I had done my homework and was already aware of your remeshing macros. :-) I fact, I added some myself to flatten a whole cell. Then I realized it wasn't very useful. :-(With regards to tedious coding, I'm not worried about that, as long as it is possible to automate at all and the results are satisfactory. And I'm not very sure it can all be automated, other than by discarding native meshes all together and placing the whole elevation model (I mean, _all_) with LWM remeshes.That is because if I were to rebuild flattened areas only, first I would need to know what those areas are. That information is only available in the original hyp*.bgl file, and as far as I'm aware there are no dissasamblers for BGL yet. And that's even supposing I go to the trouble of reformatting an asm file into a shape file that mapinfo can read.It's all a whole lot of trouble, unfortunately. I wonder how commercial sceneries has dealt with this problem, if there is any at all that has even tried.Kind regards,Juan.

Share this post


Link to post
Share on other sites

Hi Juan.It should be possible to remesh an entire area.If every point is somehow used in the LOD13 Area, that's 65,536 mesh points ( verticies ) per Area. I'm going to assume that's quite a framerate hit. So there are some issues between what is possible, and what is practical.If you use a 2x2 point poly, then you're at LOD12, with 16,384 polys per LOD13 Area. 4x4 polys are LOD11....You can set any LOD level you like ( up to 13 ), but ultimately, it will look blocky and 'oversampled' the further from LOD13 you stray... 8x8 polys actually seem to be pushing the limits of what looks OK.Both knnygar and myself have used 2 point lines rather than polys, with some success, so that is another possibility, as you've seen. The Macro I gave as an example is actually a cross pattern of lines.I really hope you can find a good automated solution, as it is really required here. One problem you'll run into, with a wholesale mesh replacement, is where to end the remeshing, and how will it blend into the default ( and addon ) mesh? The only way to find out is to try it, as no one else has, yet. The program, TDFViewer, from the SDKs is actually able to read the mesh. By hand, someone could get the default elevations to restore the coast elevations from that program ( VERY tedious ). This shows that it's possible to recover the data from the mesh BGLs, but, as Christian Stock has noted, MS has chosen to hide the compression algorythm from us, so we cannot convert the mesh back to elevation data. They can do it... we can't. If we could, then a program could be devised to convert the mesh elevations to LWM code, and the LWM re-mesh would blend perfectly to the default mesh.--------------This problem is a harsh limitation for those designers who, like Chris Wilkes, are creating large photoreal sceneries, and are faced with the prospect of HUGE re-meshing coding to get the sceneries 'just right'... and why release a beautiful photoreal, if the coasts are smooshed to sealevel at the wrong places? It's a severe limitation of the terrain engine, that we cannot exclude 'flattening'.--------------As far as commercial projects? There are none using LWM or VTP polygons, just as there are no design tools for this, except what we have made ourselves ( other than BGLC ).Dick

Share this post


Link to post
Share on other sites

Only marginally on topic, but is there a way to tell FS to install more scenery, rather than cache it from the CD that doesn't imply uninstalling FS first? Didn't find anything searching here, nor in in the MS KB, and I can't disable the hyp*.bgl files because they are cached. :-(Thanks,Juan.

Share this post


Link to post
Share on other sites

Please disregard. I think I may have found it: uncompress the cab in the SCENEDB directory and edit the scenery.cfg file accordingly. I'll try this evening. Cheers. Juan.

Share this post


Link to post
Share on other sites

Hi Juan.I've always used a full install, so that the CD isn't required... then simply deleting the scenery folder's associated 'scenery.dat' file will force the sim to rescan the folder for included files. That makes deleting or renaming file extensions easy.I'm going to spend the remainder of the day playing with various re-meshing schemes, and see if I can make any definite conclusions.Dick

Share this post


Link to post
Share on other sites

Hi all.I wanted to display a picture that shows the "oversampled" look that can plague remeshing.This remesh was made by tiny 2 point lines ( length diagonally of 2 LOD13 points ). These lines were spaced at intervals of 16 points... dividing an LOD13 Area into a 16x16 grid ( approximately 75 meters x 75 meters per cell ).Note how the tiny line has a large influence on the surrounding area... actually meshing the whole 16x16 area. I think this is about it's limit with the terrain engine. The heights are expressed as this code: ReMeshRow0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ReMeshRow1 0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0 ReMeshRow2 0,5,16,16,16,16,16,16,16,16,16,16,16,16,5,0 ReMeshRow3 0,5,16,32,32,32,32,32,32,32,32,32,32,16,5,0 ReMeshRow4 0,5,16,32,48,48,48,48,48,48,48,48,32,16,5,0 ReMeshRow5 0,5,16,32,48,64,64,64,64,64,64,48,32,16,5,0 ReMeshRow6 0,5,16,32,48,64,80,80,80,80,64,48,32,16,5,0 ReMeshRow7 0,5,16,32,48,64,80,88,88,80,64,48,32,16,5,0 ReMeshRow8 0,5,16,32,48,64,80,88,88,80,64,48,32,16,5,0 ReMeshRow9 0,5,16,32,48,64,80,80,80,80,64,48,32,16,5,0 ReMeshRow10 0,5,16,32,48,64,64,64,64,64,64,48,32,16,5,0 ReMeshRow11 0,5,16,32,48,48,48,48,48,48,48,48,32,16,5,0 ReMeshRow12 0,5,16,32,32,32,32,32,32,32,32,32,32,16,5,0 ReMeshRow13 0,5,16,16,16,16,16,16,16,16,16,16,16,16,5,0 ReMeshRow14 0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0 ReMeshRow15 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0...and the heights are in meters, with no fractional height. This produces a "stepped" pyramid. Note the meshing from 0-5 meters is pretty acceptable. The step from 5-16, less acceptable, and the 16 meter steps are then quite pronounced. I rounded the top with an 8 meter step. The whole scene has pronounced stepping because it is symetrical, but the "blockiness" is still a factor if we vary the height.I'm supposing a rule here:The steeper the slope, the greater the need for closer horizontal spacing. ( We need more intermediate points to fight the "stepping" ). There may be a formula to be discovered to cover this.Also:Tiny 2-point lines, of 2 LOD13 Point lengths, are sufficient to remesh much larger areas.So, the tiny lines need to be spaced more for height considerations, than for area.I've attached the macros and the BGLC code as TXT files to this post.Dick

Share this post


Link to post
Share on other sites

Hello,Thanks for your comments.I believe that the only possible statement to un-flatten what has been flattened by FS is LWMDataAreaFill; I have tried various values of flags in this instruction, but nothing works.Thanks again, I think that now, with your help, I have learnt and understood what is LWM.Christian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this