Thinking about some RPG..Android version.

Started by EgonOlsen, December 17, 2011, 11:42:01 PM

Previous topic - Next topic

EgonOlsen

Quote from: K24A3 on January 25, 2012, 09:23:10 AM
It's looking quite good, shadows under the trees would spruce things up nicely.
Yes, but it would be too costly because it needs an additional render pass, a shader that can actually deal with the depth map and an additional texture layer on the terrain that i don't have ATM. I played around with blob-shadows baked into the terrain's texture. It worked ok, but because trees fade out in the distance while the blobs can't made it look strange...

K24A3

I ran into the same problem recently and thought of a way to add partial tree shadows on a sloping terrain by adding planes with a darker grass texture that have the center of the plane pop up through the grass. The planes are all a single 3DS object so you can rotate them based on the surrounding terrain slope.

It looks fine in blender but didn't end up testing it in jPCT since I decided to just use shadow blobs and place the trees on flat parts of the terrain. Not sure if it would introduce clipping or z-buffer issues in OpenGL ES but something to consider nevertheless.

[attachment deleted by admin]

K24A3

Thought I'd give it a crack in jPCT and it didn't turn out too well, but a single plane with the center high looks fine imo. There is no rotation so a good chunk of one side is hidden under the terrain but the jagged edges can barely be seen.

[attachment deleted by admin]

EgonOlsen

Looks fine...it might start to flicker due to zbuffer inaccuracies in the distance though. ATM, i don't want to introduce this additional overhead. The thousands of trees and bushes that i currently process are enough for now, but i'll keep the idea in mind.

K24A3

Yeah I think you have a point with the zbuffer issue, after a while I noticed that at some angles the jaggies can get quite large and considerably noticeable on a tablet. It's a rare occurrence but not really something you want the end user to see. An efficient shader is probably the best solution. I may just create extra polygons at tree locations in my terrain that use a darker grass texture to simulate the shadow.

Thomas.

Quote from: EgonOlsen on January 25, 2012, 01:47:28 PM
Looks fine...it might start to flicker due to zbuffer inaccuracies in the distance though. ATM, i don't want to introduce this additional overhead. The thousands of trees and bushes that i currently process are enough for now, but i'll keep the idea in mind.
You can merge objects, or is there any problem?

K24A3

Quote from: Thomas. on January 25, 2012, 03:39:12 PM
You can merge objects, or is there any problem?

If you merge the one thousand objects into one huge single objects, I doubt it will make much difference since 3D performance seems to depend on how many polygons are rendered in the frame and the amount of pixels these polygons occupy.

jPCT creates vertex buffers that are pumped to the GPU at every frame, the organization of polygons before they are sent to the GPU has little affect to the 3D performance in general.

Well at least that is what I understand, I'm sure Egon can provide a more in-depth explanation.

Thomas.

I mean one tree and something under tree, count of objects will be same.

EgonOlsen

Merging the tree with that "plane" has the problem that the plane will be come transparent too (because the leafs already are). At least that's what would happen in my RPG thing. That already happens to the trunk, but that's not much of an issue. When merging it with the plane, you'll run into order issues between the trunk and the plane. Plus you'll have the same zbuffer issues and it wouldn't work on steep terrain.

About merging thousands of objects into a single one: It always a good idea to reduce the number of draw calls by merging objects. On the other hand, only a few trees are visible at a time so rendering them all as one large objects can hurt performance in this case. Plus it's a memory issue. I can reuse the mesh and the compiled data for each tree, so it's memory footprint to quite small. Merging them all into one objects will make the memory requirements explode, because it would result in a ~200,000 polygon object. So...if you can merge objects that are close together and you have the memory, do it. If not, maybe you shouldn't do it and use cloned instances instead.

EgonOlsen

About the meshes with gaps...here they are: jpct.de/download/tmp/meshes.zip. The gate suffers from a missing roof in the door way and the house from gaps between the first and the second floor.

Thomas.

#55
Here is gate. I hope that all coordinates will be correct, I never used export to OBJ file format. Strange, that your file have 30kB and my 15,6kB :o

EgonOlsen

Quote from: Thomas. on January 25, 2012, 11:27:14 PM
Here you is gate. I hope that all coordinates will be correct, I never used export to OBJ file format. Strange, that your file have 30kB and my 15,6kB :o
Many thanks. It's somehow translated -318 units in z direction, but i can easily fix that. Looks good now and i can finally enable backface culling on it.

fireside

OK.  Looks like I got beat to it.  :)
If you possibly need an animated model you can't find, let me know.  Project looks great. 
click here->Fireside 7 Games<-

Thomas.

#58
Quote from: EgonOlsen on January 26, 2012, 12:02:06 AM
Quote from: Thomas. on January 25, 2012, 11:27:14 PM
Here you is gate. I hope that all coordinates will be correct, I never used export to OBJ file format. Strange, that your file have 30kB and my 15,6kB :o
Many thanks. It's somehow translated -318 units in z direction, but i can easily fix that. Looks good now and i can finally enable backface culling on it.
I see. I did not any translation... If someone do not repair the house until morning, I look at it.

edit: I uploaded new file and hope, that will be ok now. Pivot of original and repaired object was in another place...

EgonOlsen

Quote from: fireside on January 26, 2012, 12:04:55 AM
OK.  Looks like I got beat to it.  :)
If you possibly need an animated model you can't find, let me know.  Project looks great.
Well...if somebody wants to contribute some models, here's what i could use ATM:

  • A bow with keyframe animation for the firing sequence (plus an arrow as extra object). And a hand/arm attached to it so that i looks like in Skyrim or similar games when you wear a bow in first person perspective, just in low polygon. The game won't have a third person view, so the arm can simply end below the screen's lower edge. Example: http://www.tfmx.co.uk/wp-content/uploads/2011/06/skyrim_report/bow_skyrim.jpg
  • A dungeon entry/exit that can be placed on the map. Similar to what Arena and Daggerfall did. Example: http://img3.imagebanana.com/img/6089un1/fall_004.png
  • Elements to create a generic dungeon from, i.e. basic blocks (walls on both sides, wall on one side, no wall, one wall and one doorway, two doorways, just one doorway and no wall,....) that you can chain together to create a dungeon based on a kind of ASCII map without seems between the elements . The simplest form would be flat, rectangular walls, floors and ceilings. I could create that on the fly from an ASCII level just like i did it in Paradroidz and Robombs, but it might look a bit boring for all dungeons. You can't model a cave or mine with flat walls and ceiling very well.