Engine System Update #2
Looking back at Update #1 and now looking here at Update #2, I would like to say that I am probably behind schedule. I encountered a couple of challenges that are impeding my speed forward.
Update 2 Goals (goals come from previous update and new goals/requirements are also added that were found along the way):
Vertex color optional challenge in the past. (This is to better visualize the terrain) FAILED. BUGGY
Perlin Noise implemented algorithm. FAILED DID NOT HAVE TIME
Perlin Noise generated terrain. FAILED DID NOT HAVE TIME
Basic Terrain Geo Extraction Class for runtime. FAILED DID NOT HAVE TIME
Reading in most data from Landscape geometry file. SUCCESS
Generating Landscape geometry with lua data. SUCCESS? (Currently is just a sin wave, need to finish vertex coloring to observe better)
Reading in geometry into game. SUCCESS
Took time to figure out how to properly generate the actual piece of terrain. You can see my sin wave based terrain directly below:
It took me longer than anticipated to figure out how to generate the geometry of the terrain. I got it working on the first try but I had to draw out winding orders, index orders, and how I would layout vertexes in memory along with indexes. In terms of how I am actually laying out vertexes in memory, I am basically lining them up row by row as I construct the landscape. My plan is to eventually run each vertex through an algorithm to adjust the y value (basically some height function like perlin noise).
If there is a concern I have about this, it is whether or not laying out vertexes in memory row by row is effective. It’s simple, but I believe it may lead to caching problems?
Scene after generating landscape with sin.
Lua file changes or maybe not:
I ended up adding a “rightHandedWindingIndexes“ boolean to my lua file initally because I figured this might help users configure it for their engine. Thinking about it now however, I realize since everyone has the same requirements in terms of what needs to run on 32 bit vs 64bit. Maybe this option is irrelevant, or maybe I should just make it optional.
Running into problems implementing Vertex Coloring.
Considering it may be important in visualizing the landscape, I need to implement vertex coloring for some possibly basic shading later. Finding what the problem is, is harder than I anticipated. Everything compiles and builds fine, but it doesn’t look like the vertex colors are working.
I finished for the most part what I believed to be the lua file with vertex colors, updating the vertex structure (which to my knowledge should make my binary read file automatically read it in by updating that structure), and updating the corresponding shaders and opengl and d3d code. But the images look weird and it doesn’t look like the colors are changing.
I’m gonna have to really dig into this and recheck every step I did. My images are shown below.
OpenGL Scene after I thought I finished vertex coloring …. It doesn’t look like it’s working.
Direct3D Scene after I thought I finished vertex coloring …. It doesn’t look like it’s working? Color is supposed to be changing.
Questions:
Any idea to why my vertex colors aren’t changing? The above Direct3D image should have different colors but it only has one.
UPDATE: POST SUBMISSION (11/14/2019). I got vertex color working.
Goals for next time. I’m gonna be honest. Gonna be cutting this close due to a lot of the problems I ran into. But I still plan to meet all my goals
Interface for extracting terrain information (vertexes, indexes, and colors).
Actual Perlin Noise Implementation
Working Vertex Colors.