It is currently Sat Nov 27, 2021 2:54 pm


ALS 12/5/21 update - imposter scale

For every thing to do with shaders.
  • Author
  • Message

Jameswh

  • Posts: 16
  • Joined: Sat Aug 23, 2014 10:15 pm

ALS 12/5/21 update - imposter scale

PostFri May 21, 2021 6:17 pm

Hi
So I have looked and looked and I do not see where the imposter model is created, I can see there is one loaded in, there are 6 limbs of 12k listed verts all at 0,0,0 , followed by 6k list of faces, then 12k normals but then oddly another 6k list of faces - the exact same list i think!?? the beginnings and ends match... this is followed by 12k uv coords and finally the fvf data. In the includes/source files I don't seem to be able to find how to scale individual imposters per batch or find where the planes are generated, I am probably being dumb - udt/arrays using pointers tend to throw me off because even though ordinary words should help to make things clearer/easier to follow I tend to forget things as I follow them because i need relatively large text on my screen which is low res and not exactly a big screen, so I don't get a lot of the text on the screen in one go, I spend more time scrolling than anything else(this is due to health issue, my sight gets poorer as the day goes on due to extreme fatigue).

The reason I want to scale imposters per batch is because for some reason when I set up dated palm tree's, they turn out at about 2/3 of the size so the transition is extremely obvious and out of place - the pine example is fine though and I was able to get maple sorted out but the lighting/shadows make it stand out when the transition takes place, still playing around with it though, altering the plane height makes it look 10x better but it is still quite an obvious transition. The transform function for imposters actually affects the lower lod scales which I don't want.

The performance on this by the way is sweet. My machine only struggles with the transitions when I use too high a poly count or scale up too big though the latter is likely the transparency cost as I get low fps on higher scales(ok obvious), but then transitions kill the fps. Not that it is an issue of course, I am using a dual core APU, 750 gtx, so it is to be expected, but that aside I have seen some great performance so far.

So if anyone knows how to sort my issue out directly/point me in the right direction, or a workaround, then I would love to hear about it :) (I have thought about not using imposters and creating my own through an extra lod level, but I would much rather use Evolved's solution).

Cheers
User avatar

EVOLVED

Site Admin

  • Posts: 49
  • Joined: Wed Mar 05, 2014 7:52 am

Re: ALS 12/5/21 update - imposter scale

PostThu May 27, 2021 12:42 pm

Ive had a look into this, and replaced the spruce with some palm trees on the ALS tree demo but they seem to be scaled correctly. If your still having issues you may need to modify the code and add a scale vector to the scale matrix at line 351.

Code: Select all
scale matrix4 Matrix(1),AL_Object(iObjectAL).AtualSize.x,AL_Object(iObjectAL).AtualSize.y,AL_Object(iObjectAL).AtualSize.z

Jameswh

  • Posts: 16
  • Joined: Sat Aug 23, 2014 10:15 pm

Re: ALS 12/5/21 update - imposter scale

PostSat May 29, 2021 11:11 pm

Thanks for the reply :) Indeed everything looks normal with the new download, so either it is some setting in the export, textures maybe or the fact that I added a second and third tree variety.

I was using a fresh 4000*4000 terrain. Also when I tried adding the date palm alongside the spruce, the spruce was translucent and flickering. The solution was to resave the spruce dbo's using a model viewer created in DBP by AndrewT https://forum.thegamecreators.com/thread/124936#top.(You have to load it in then delete the original file in windows or rename it before saving as dbo). This was before I noticed you have a model viewer in the old Mapscape. I had wondered where the grass and spruce model came from lol!

So I am unable to deal with this right at this moment in time, my machine is otherwise busy atm but by the end of tomorrow I hope to test my exports as-is, in place of your exports of date palm but using your textures. If that seems fine then I will switch out to the textures I was using...shouldn't be any difference but you never know I guess. If all is okay then I will look at adding in the spruce, I will try with saving everything with the model viewers, first yours then AndrewT's if needs be and then see where I am at, before posting back here with results.

I have always managed to get decent results with vegetation in ALS but with these later versions I cannot express enough how delighted I am with the performance and draw distance.

Jameswh

  • Posts: 16
  • Joined: Sat Aug 23, 2014 10:15 pm

Re: ALS 12/5/21 update - imposter scale

PostMon May 31, 2021 12:22 am

So I switched date palm models and textures out in the demo for the ones I used - everything looked correct, so that is the models/textures ruled out. I also tinkered some of the values in my code to match yours but to no avail.

As there isn't much of my day left(takes several minutes for code compile and run on my hardware) I decided to not look at the whole model viewer save thing I previously mentioned and just took a quick look at the code you mentioned instead...line 351 in the new upload is line 341 in the 12/5 version, a quick check of file size and the older is indeed smaller than the newer(25.8kb vs 26.4kb), I haven't changed the source but double checked with the zip contents of both 12/5 and 27/5 versions original downloads and can see I was not mistaken.

In light of that what I am going to do instead is start over with the newer version, stick to the original demo terrain and add in the spruce, then see where I am at, otherwise things are going to get confusing as the sources aren't the same. This I will try and do tomorrow, I had my 1st Covid jab around a week ago and am not feeling 100% - so am hoping tomorrow I will feel more up to it, right now I am struggling to concentrate due to this distraction combined with previously mentioned health issues with regards to how any normal day for me progresses.

Thank you for taking the time to look at this, stay safe, cheers :)

Jameswh

  • Posts: 16
  • Joined: Sat Aug 23, 2014 10:15 pm

Re: ALS 12/5/21 update - imposter scale

PostThu Jun 03, 2021 12:59 am

Okay so I did a start over...bad news is the reflections are gone again exactly as described in the other thread I created relating to 2 updates ago - extreme artifacts especially at night due to the reflection image moving with camera and not rotating or fitting the way it should be. The only line I changed was the Terrain_Setup(1080,1080) to match my screen height. (My new desktop res being 1280*1080). :(

So of course I have also now got the palms on their own to work with correct scale for impostors on the 4000*4000 map I had brought across from prev creation(with this update that reflections are broke in). Haven't bothered to check if this remains the case once adding in spruce and maple as previously described. I suspect it would(I will check tomorrow jsut out of curiosity) but that water at my end looks really bad - bad enough to render it unusable. I would say you may have picked up the project from 2 previous updates ago by mistake perhaps and then checked out the imposter scale issue I am posting about on that version instead of the update mentioned in title of this thread? Or perhaps even just the odd source file from different update by mistake instead? At least that's how things "appear" to be in the results I see(obviously may not be case and it just now got broken with your update to fix impostor scale - I had actually read your reply as though all you altered where settings and media but I guess could also interpret it as though you made an update and don't see any issues?).

Jameswh

  • Posts: 16
  • Joined: Sat Aug 23, 2014 10:15 pm

Re: ALS 12/5/21 update - imposter scale

PostThu Jun 24, 2021 8:45 pm

My apologies for not posting sooner, I have had some health issues to deal with.

So as per my other thread, the code I was using originally was from a february version with working reflections in the water(not trees in unaltered DL code). In that project I loaded my version of the date palm from TreeIT, the spruce from the project media and my version of the maple from TreeIT...the spruce was textured weirdly but using that model program I mentioned earlier I resaved the spruce and all was well except the palms imposters had their own shared loss of scale by about 1/3.
Since then I have tried new download 27/5/21, as I mentioned replacing your date palm with my own showed no odd scaling issues of imposters, however I then just copied my code over from 2/2/21 version for just the palm and spruce(ie no maple) and up popped the same issue of imposters odd scaling by 1/3, tried it with other versions from May and same thing...I haven't checked the new upload just yet - i have some testing I promised weeks ago to do for Ortu.
I worked out why my line 341 was line 351 for this version, I happened to have had the original project open from February - it is the only logical explanation. I proper mixed myself up their so i apologise for this too as I am at fualt and hope it hasn't affected anyone looking into it. I have also took the advice of adding a scalar and now that works fine in the 2/2/21 version, most likely will be the case with the 27/5/21 version - I was gonna try but then I spotted the new DL for June so I will look at that instead and then see where I am at(once I have tested for Ortu and a couple other things I am behind on need to be done to get back on track first).
The only projects I have the original dl's for are 2/2, 3/5, 12/5, 17/5 & 27/5, only the 2/2 has a working water/ocean reflection on my end. To be clear(because I am not always clear) the scale issue persists in said versions - will try the new version asap.

Return to Shaders