I’ve soon changed the system. I had to spend a lot of time figuring out why the LRUCache didn’t work, despite me implementing it correctly. As it turns out, it was the stupid never to be used again Point2i objects messing with it (they can’t tell if they’re equal to one another), so it’s VectorXf from this point.
Never go outside the reservation ppl.
i’ve decided against the LRU cache after some testing. Its not flexible enough with variable-sized grids and countdown clocks on expired pages etc. I’m reverting parts of it.
The engine is now running smoothly on a HashMap, and I can finally start with the grass/trees.
Not gonna go to beta yet, however, because I want to poke around some with the fade transitioning, but I can’t do that until I have the trees to use as subjects. I’m gonna use something called “stippling” as a standard fading method (both for grass and fading between tree models/impostors), and I want to try it out.
But its done now… its veeery light and works well. And it’s fast. And 100% collections based. Had to make a small class “Cell” to use as keys because the before-mentioned Point2i crapped out on me.
Sorry if anyone has been interested but only getting to see comments and stuff, lots of graphics and progress coming up soon
Time to relax with some well-deserved DAOC (yep, it’s still out there).
EDIT: no, servers are down…
Yay graphics ^^ I have LOVED seeing the progress on this project! Can’t wait until it’s out!
-NomNom
Fade transitions work now, and the geometry batch system is done. Just doing some billboarding stuff now. Gonna put up a vid in a few days
Finally fixed the contributions build, the updates should go to the update center again now.
Btw, I saw theres no javadoc for the library, that would obviously be quite cool You can set a zip file with javadoc (if you use the SDK, you can create javadoc using the project menu) that will automatically be used when users import the library to their projects.
@normen
Hi, great. I will update the repo in a few days then, probably. The stuff i put there already will be replaced in the coming days when i got fade transitioning fully functional. I’ll include the source and javadoc etc.
@ everyone
Trees are looking good now. Batches are built correctly, impostor geometry is built correctly and impostors are perfectly aligned with the trees etc. Fading works, but needs to be better synced. Some tweaking left.
When that is fixed I will update the repository files with the new paging engine version, and make a new short video capture i think. I woun’t add the trees tho until i have tested it some more, added more features, finished the shader pack etc.
updated the thread.
@androlo
Hey bro, not to be rude, but may I ask you, could you put a description into your plugin listing? At least a URL to this topic, so that way we know what is that plugin =] I had to create a thread to know that the plugin is from this great work, that can really help people!
@shirkit
Hello. Ok sorry, I am going to do that this next update, but the paging engine currently in the repo is very outdated, not even beta yet. I am putting beta version there now this week, and will include description, make javadoc etc.
Keep in mind its just the paging engine tho, thus far, not the actual tree/grassloaders. Grassloader will be added in some time. Then trees.
updated thread, made short video
Great work, @androlo ! I just thought that I would let you know that you turned my absolutely horrible day into an okay day. Thank you so much!
-NomNom
Nice work! But about the point sprites, arent they always facing the camera like particle effects? So if you are at some altitude the point sprite tree will be lying flat on the ground and the smooth transition will look odd as the actual tree mesh is pointing up to the sky. Perhaps best to just use a normal billboard quad pointing up like the tree? However the billboards rotation calculation could be shared since they all only need to face the same plane as the camera and not necessary towards the camera location (the offset differences is too little to be noticeable i think for distant imposters).
@androlo
Thanks =] Try to put into your release proccess to update the Plugin, don’t let it die
@shirkit said:
Thanks =] Try to put into your release proccess to update the Plugin, don't let it die :/
You can just download the jar and add it to your projects libraries. What the plugin does is providing the jar in a convenient "library" wrapper that also can reference javadoc etc. which gets automatically updated in all your projects when the plugin gets updated.
Aaaa Didn’t knew, I thought there was a lpus like something in the Scene Composer or whatever =]
@shirkit said:
Aaaa Didn't knew, I thought there was a lpus like something in the Scene Composer or whatever =]
Hopefully there will be :D ;)
@johncl said:
Nice work! But about the point sprites, arent they always facing the camera like particle effects? So if you are at some altitude the point sprite tree will be lying flat on the ground and the smooth transition will look odd as the actual tree mesh is pointing up to the sky. Perhaps best to just use a normal billboard quad pointing up like the tree? However the billboards rotation calculation could be shared since they all only need to face the same plane as the camera and not necessary towards the camera location (the offset differences is too little to be noticeable i think for distant imposters).
Thank you for the input. Good stuff.
I actually never thought of that point sprite stuff because I am only rotating around the y-axis now like you describe, but you're right - from what I know they always face the screen, and there is no way of turning that off.
I am working on the grass now, but I’ve thought about the impostor generation. I have an idea of how to go about it now. The process of capturing the model onto a texture (from different angles) is already available in the original paged geometry lib, but it needs to be modified a little. But here’s the general process, as i picture it.
- Attach the model to a node
- Make a camera, direct it towards the model (get perspective correct, make sure background becomes transparent etc.), and prepare it for rendering to a texture.
- Change the shader to only use the color map on the model. No lighting.
- Rotate the camera around the model and render it onto a texture from a few set angles.
- Switch to a shader that reads the distance from the camera at each vertex, and renders the pixels in black and white, where the color value depends on the distance.
- Repeat step 3.
- Normalize the values to some degree.
- Switch to a shader that displays the normal maps on the model, nothing else, to generate a preliminary bumpmap.
- Repeat step 3.
The generated displacement map will have to act as a “faux mesh” when correcting the bumpmap. To get an approximation of the mesh normal at a given texel, compare the displacement value of that texel to the values of the texels right next to it. Check that the texel values are somewhat continuous to ensure they are actually next to one another on the mesh etc. You get the idea.
This should make the light reflect of the impostor in a way that resembles the model fairly well. A similar process could be used for specular light too, of course, with the specular map drawn onto the model.
Shadowmaps will be harder. Gonna look around for some ideas while finishing the grass.
This doesn’t really have to be a super-effective process since the impostor textures can be saved and then re-used, the only important thing would be the quality of the impostor images.