Reputation: 9 Worker
- Active Posts:
- 25 (0.04 per day)
- 19-September 12
- Profile Views:
- Last Active:
- Sep 10 2013 12:19 PM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Who Cares
- Favorite Gaming Platform:
- Who Cares
- Your Car:
- Who Cares
- Dream Kudos:
30 Jul 2013 - 07:14
Posts I've Made
Posted 4 Sep 2013Good morning Magius96,
This is exactly what I was looking for!
Thank you for the work you put into this, I appreciate it.
Wishing you well,
Posted 23 Aug 2013Good morning BBeck,
I was not aware of the "power of two" when it came to texture size, that's certainly something I'll look into.
I've been looking into mip-mapping a bit, and I have to admit, I've been so busy exploring vertex and index buffers that I haven't looked into it beyond a cursory glance. Regardless, from what I gather, I think it's certainly the next step once I have things broken down into manageable chunks.
Concerning that, and what you've mentioned as far as a video series, do you remember whereabouts those videos were stored? Were they on Youtube, or some other site? I can't seem to locate much of anything beyond demonstration videos.
Also, I came across this, which may be of some use to you, I'm not sure.
As far as frustum culling is concerned, I had something like that in mind (if I understand the concept correctly) with breaking up the height maps. Basically, my idea is to break the maps down into more sizable chunks, apply bounding boxes to them, and basically have them draw if they're in view.
My end goal is to apply this not only to the height maps, but billboards, as well, on each chunk, so I can have thick forests and such without a huge amount of lag.
Combined with that, if I can manage all this, I want to give back a bit to this community and make a tutorial on it all.
All in due time, I suppose.
You've certainly given me quite a lot to think about, and I appreciate it. It has expanded my mental horizons a bit, which is, in my opinion, a very good thing.
Now, I feel an update is in order on what I posted about earlier in the week.
I successfully created a full vertex buffer for all four height maps, and even got one of them to all draw correctly to the bounds of the grid (the other three I never worked with at this stage. I took your advice earlier on getting at least one to work, and so felt working with the one would allow me to hammer out the details.)
However, I soon realized that this success was not because of the single vertex buffer.
In order to get one height map to fully draw to the borders of the next map, I had to create more vertices with proper texture coordinates. Otherwise, it would draw, but the textures would be skewed horribly.
Essentially, I created overlapping vertices with different texture coordinates for proper texture mapping, which probably is not the most optimized way of doing things, but it works, and for now, that will have to do.
It seems that one vertex buffer is not really needed for the four height map sections, however it seems like it will certainly be needed once I get back into dividing them up into smaller chunks.
It still would appear I need to define multiple index buffers, though. From my understanding, they do the heavy lifting when it comes to actually drawing things, or at least telling the computer how to draw things.
From what I gather, the important thing, at least when it comes to what I've been doing, is how the texture coordinates are defined. If you're within one map or one section that has its own texture map, then you need just the one vertex buffer to allow the indices to "talk" to all the needed vertices that have the appropriate texture data.
Here's the results of the overlapping vertices, albeit without any height data so you can see the result with a grid.
Number of downloads: 1
To reinstate height data, I had to increase the array I was using for heights, raise the Y value of the position of the overlapping vertices to match what was actually there, and then, for collision purposes, re-calculate the height data of those points.
The result is... Well, it's beyond what I expected, to be honest. It's seamless, matches the grid, and collision works perfectly.
Number of downloads: 3
I would say I'm 95% satisfied with this result, lacking 5% because of the extra vertices I had to do and being uncertain if that is the way to go about it.
As always, I'm open to new and better ways to accomplish this end result, which is something I'll look into after I've worked on making things into the aforementioned chunks.
For now, it will suffice, though, and gives me a good base of working knowledge to operate on.
Wishing you all the best,
Posted 19 Aug 2013To those that may be viewing this and especially to BBeck,
Hopefully this type of post is allowed. As this concerns the original post, I felt the best place to mention this would be here.
I had a major revelation this morning, I've been trying to break the height maps down so I could apply octree-styled culling to them for the past few days.
I've been under the assumption that you need multiple vertex and index buffers to make it work. I finally realized that the indices simply weren't getting access to the vertices they needed to draw correctly. Then it hit me: this makes perfect sense as a vertex buffer is simply allotting a certain amount of vertices, and the indices will only have access to whichever arrays happen to be in that buffer.
I'll add a picture to show this more clearly.
Number of downloads: 5
Now, I suppose you could say the major part of my revelation is as follows. As an aside, this is mainly limited to theory and numbers and, most importantly to me, small-scale observation (largely based on tests such as shown in the above picture.)
My original post was concerning alignment, and what appeared to be missing triangles.
Addressing you, BBeck, I cannot thank you enough, again, for helping me out. I really appreciate it greatly.
As I mentioned previously, I'm always concerned with how I appear online, and the last thing I want to give off is an air of ungratefulness.
I had honestly written off and called this issue done until just a few moments ago when I was telling my friend about this, when it hit me what appears to really be going on.
In my original code, I'm using four separate vertex buffers, four separate index buffers: one for each height map.
Re-aligning the maps, adjusting collision code, and using interpolation to stitch the maps together worked beautifully.
But after this morning, seeing what I've seen, I feel that this is just a patch, and not a fix.
I suppose, getting to the heart of the matter, it appears that there never technically were missing triangles. The indices simply weren't being assigned to the correct array slots. There also seems, based on my observations, like there never was an alignment issue, either.
It all seems to stem back to the amount of vertex buffers I've been using, and not correctly understanding exactly how they work. Coupled with that was a lack of understanding of index buffers and how they operate, as well.
I'm currently working on implementing this with the entire map. As it's on a much larger scale than the small pieces I've been working with (25x25 versus 1000x1000,) I don't know how long the implementation will take (which is partly why I'm posting before having fully implemented it.)
Regardless, once I get it fully implemented, I'll post again on the results, whether for or against this hypothesis.
Wishing you all the best,
Posted 14 Aug 2013Good evening BBeck,
*Breaths a sigh of relief*
It works beautifully!
I can't thank you enough for all your help and all the time you've spent trying to help.
I really appreciate it.
I must address something, though, which is what I originally thought was the problem.
I spent a good deal of time with my friend, the one that's my partner with this project, and we realized something after a few hours: the grid was more than likely off by the exact amount I thought the height maps were off, and that the height maps themselves were drawing all 500 points, whereas I thought they were only drawing 499.
Not only did I position them incorrectly, but I saw a problem that never even existed in the first place.
Today is one of those days where I feel... Less than smart.
Silly assumptions and their consequences.
I've fully integrated the changes you've worked to achieve into the main project, and it all runs beautifully. Again, I can't thank you enough. =)
Wishing you all the best,
Posted 14 Aug 2013Good morning BBeck,
I'm glad to read that you're not offended. I'm always concerned, especially online, with how my words may be perceived.
Now, to your code, thank you very much for providing that, I appreciate it.
After removing all the height information from all vertices (so I could easily check all height maps with the grid,) I can confirm that the changes you made do indeed correctly align them, which is wonderful.
Unfortunately, collision is affected by these changes.
I've altered the project files to include the collision I'm using, as well as a model to test it out.
Basically, at the heart of the issue is collision between a model and the height maps. Trying to get the maps at the right coordinates spawned from that.
Also, with the heights in place, you'll notice that there are gaps in between the height maps, don't worry about that as I already have a solution for that, which is just interpolation between the maps to stitch them up. I would include that, but I tried, albeit briefly, and it would need a bit of work to properly work with the adjustments made (I would spend more time fixing that aspect up, but I don't feel it's of value at this point. If you disagree, though, I'll add that and re-upload.)
Regardless, you should be able to get the idea. Also, collision seems most heavily affected on the height maps to the left of the world axis, something I noticed when I previously tried to re-position the maps.
Updated Project Code
Again, I'm glad you're not offended whatsoever.
Wishing you well,
- Member Title:
- New D.I.C Head
- Age Unknown
- Birthday Unknown
- Years Programming:
- Programming Languages:
- C#, HLSL
H2012 hasn't added any friends yet.