Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (416)
games submitted by our members
Games in WIP (306)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Terrain gen  (Read 891 times)
0 Members and 1 Guest are viewing this topic.
Offline lclc98

Junior Newbie





« Posted 2013-03-04 10:56:08 »

Im coding terrain to work with a heightmap but when i have a image greater then 1024x1024 it seems to cut the fps to 3 fps(From 75). I have been stuck on this for weeks. I have asked on multiple sites and irc with no response. Im using lwjgl, I think i might need a way to stop rendering terrain at a certain distance, but im not sure. Code: http://pastebin.java-gaming.org/c26a695424f
Offline GabrielBailey74

JGO Knight


Medals: 12
Projects: 6


#1 Most selfconscious member. Damn right T_T >:O


« Reply #1 - Posted 2013-03-05 05:11:05 »

I know if the terrain is 1024x1024 the 'patches' (for me) are usually around 64 each.
(Major Lag for me anyways, my computers a dinosaur)

Make sure that the size of the terrain patches are all possible for ^2 (so 8, 16, 32, 64, etc).
Might be why this is occurring, didn't bother to look at the source code yet XD

If it's performance issues.
Try implementing a LOD calculator (Level Of Detail).
I can't find a link for a explication of it so I'll put a brief description of it here Roll Eyes
Quote
Basically it's a 'quality calculator'.
The further the camera is away from the terrain patch the lower 'patches inside patches' that will occur.
It makes a terrain patch that is far from you: render as 1 patch composed of 1 static geometry, instead of rendering as 1 patch composed of many static geometry's (High Texture Quality).

Note: If a LOD specialist comes along and finds this brief description wrong, this is from my own observations XD.

Hope it helps mate Smiley

Offline HeroesGraveDev

JGO Wizard


Medals: 72
Projects: 8


Muahahahahahaha...


« Reply #2 - Posted 2013-03-05 05:19:13 »

Isn't LOD Level of Detail?

Games published by our own members! Check 'em out!
Try the Free Demo of Droid Assault
Offline GabrielBailey74

JGO Knight


Medals: 12
Projects: 6


#1 Most selfconscious member. Damn right T_T >:O


« Reply #3 - Posted 2013-03-05 05:19:56 »

Well.., I'm st***d...!
Yes, Level Of Detail >.....>

EDIT: Corrected.

Offline HeroesGraveDev

JGO Wizard


Medals: 72
Projects: 8


Muahahahahahaha...


« Reply #4 - Posted 2013-03-05 05:21:58 »

A blog post with a bit about LOD

Offline lclc98

Junior Newbie





« Reply #5 - Posted 2013-03-05 08:36:12 »

ok, il look into LOD
Offline HeroesGraveDev

JGO Wizard


Medals: 72
Projects: 8


Muahahahahahaha...


« Reply #6 - Posted 2013-03-05 09:04:48 »

Why not just put a cap on the view distance?

Offline GabrielBailey74

JGO Knight


Medals: 12
Projects: 6


#1 Most selfconscious member. Damn right T_T >:O


« Reply #7 - Posted 2013-03-05 10:11:44 »

Just recently learned this:
Adding fog can prevent such a rendering 'strain' (Less to render right?)

Offline lclc98

Junior Newbie





« Reply #8 - Posted 2013-03-07 09:15:43 »

Fog is making my terrain black
Offline GabrielBailey74

JGO Knight


Medals: 12
Projects: 6


#1 Most selfconscious member. Damn right T_T >:O


« Reply #9 - Posted 2013-03-08 01:12:16 »

Fog is making my terrain black

I don't know how you implemented the fog.

When I implemented fog into my 3D game I was using JMonkeyEngine.
So they had methods to lessen the thickness of the fog, change the color and distance of the fog etc.

Only thing I can think of at the moment is: you have no lights in the 3D scene.
(Why the terrain would be showing up black)

Or the fog is in a state I've never been able to see.
(Doesn't have a thickness level set, doesn't have a starting / ending distance set)

No biggie if you can't get the fog to work mate.
Just something I heard online, I can't back it up myself as I've done no benchmarking on it.

Pages: [1]
  ignore  |  Print  
 
 

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
mrbenebob (9 views)
2013-06-19 14:55:23

BrassApparatus (16 views)
2013-06-19 08:52:37

NegativeZero (20 views)
2013-06-19 03:31:52

NegativeZero (22 views)
2013-06-19 03:24:09

Jesse_Attard (27 views)
2013-06-18 22:03:02

HeroesGraveDev (65 views)
2013-06-15 23:35:23

Vermeer (64 views)
2013-06-14 20:08:06

davedes (65 views)
2013-06-14 16:03:55

alaslipknot (58 views)
2013-06-13 07:56:31

Roquen (80 views)
2013-06-12 04:12:32
Smoothing Algorithm Question
by UprightPath
2013-05-28 02:58:26

Smoothing Algorithm Question
by UprightPath
2013-05-28 02:57:33

Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!