gamecreator Posted May 5, 2016 Share Posted May 5, 2016 In the editor the vegetation seems to display fine. However, when I play in a C++ project, there are "straight" lines of vegetation where the rendering stops. Vegetation does not render roughly when x>100, x<-104, z>95 or z<-107. This is true for both the default trees and bushes (and I assume grass but I did not test that). However, the physics collision for is still there and I bump into invisible trees as I walk with the controller. This is on standard Leadwerks and I just tested it with an updated and rebuilt project with an update I got a few minutes ago. First screenshot is from the editor (showing a flat box I put in for reference. The second and third shots are from in-game with the same box showing in the top-right and then standing on top of in the third. The fourth is where there should be visible trees on the right. Link to comment Share on other sites More sharing options...
Josh Posted May 5, 2016 Share Posted May 5, 2016 Please post your map file. 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...
gamecreator Posted May 5, 2016 Author Share Posted May 5, 2016 Attached world.zip Link to comment Share on other sites More sharing options...
Josh Posted May 5, 2016 Share Posted May 5, 2016 Those trees don't load when I open the map. This is what I see. 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...
gamecreator Posted May 5, 2016 Author Share Posted May 5, 2016 I copied the Trees folder over to a TreesLeadwerks folder so that I won't get them confused with trees I want to import (TreesPure3D). I suspect you would need to do the same. Attached is the load log from the editor, if it helps. Looking at the log, I did just notice that the tree still pulls materials and textures from the old folder. Shouldn't it be loading it from the current folder first? Probably not related but still a bit strange. I wonder what happens if I delete that old folder... Edit: removing the old folder had Leadwerks checking the current folder, which works. But the vegetation still didn't show up outside of the boundaries. HDEditorLoadLog.txt Link to comment Share on other sites More sharing options...
gamecreator Posted May 7, 2016 Author Share Posted May 7, 2016 I've PM-ed you the entire project. Link to comment Share on other sites More sharing options...
gamecreator Posted May 10, 2016 Author Share Posted May 10, 2016 I cleared the code and made a simple moving camera but used the same map and all vegetation was now visible. So it's something in the code that somehow makes the outer vegetation invisible. Couldn't guess what could do that but maybe I'll start pasting code back little by little. If parenting a camera to a pivot could make Shadmar's shaders not work, maybe I'm doing something else Leadwerks doesn't like. Edit: This has something to do with the pivot and/or the controller being near the "edge." I added controls that control just the camera, independent of the pivot/controller. if(window->KeyDown(Key::I)) camera->Move(0, 0, 2.9*Time::GetSpeed(), false); if(window->KeyDown(Key::K)) camera->Move(0, 0, -2.9*Time::GetSpeed(), false); if(window->KeyDown(Key::L)) camera->Move(2.9*Time::GetSpeed(), 0, 0, false); if(window->KeyDown(Key::J)) camera->Move(-2.9*Time::GetSpeed(), 0, 0, false); if(window->KeyDown(Key::Up)) pitch+=0.9*Time::GetSpeed(); if(window->KeyDown(Key::Down)) pitch-=0.9*Time::GetSpeed(); if(window->KeyDown(Key::Right)) yaw+=0.9*Time::GetSpeed(); if(window->KeyDown(Key::Left)) yaw-=0.9*Time::GetSpeed(); camera->SetRotation(pitch, yaw, roll, true); If I bring the character close to the edge, the vegetation doesn't render no matter what. If I take the character/pivot away but bring the camera back, the vegetation does render - all in the same run. Super strange. I was going to redo the camera to not rely on the parenting-to-the-character trick anyway so I think/hope that will solve it. Link to comment Share on other sites More sharing options...
Josh Posted June 6, 2016 Share Posted June 6, 2016 I suspect there's some part in my code maybe that is using the camera's local space. However, I checked Vegetation.cpp and could not find any problems. 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...
gamecreator Posted June 6, 2016 Author Share Posted June 6, 2016 Thanks for checking. I haven't had this problem since I started using an independent (non-child) camera. Link to comment Share on other sites More sharing options...
Josh Posted June 6, 2016 Share Posted June 6, 2016 Great, I was able to reproduce this problem by parenting the camera to a pivot. Should be easy to solve now. 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...
Josh Posted June 6, 2016 Share Posted June 6, 2016 Fixed! Thanks for your help! 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...
Recommended Posts