Basic Terrain Generator

Everything related to 3D programming
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Basic Terrain Generator

Post by Samuel »

Mythros wrote: I was never any good at 2D unfortunately... :/
Well, you can't get good at something unless you work hard and keep trying to better yourself.

Just try your hardest to learn the process and math behind it.
It will be easier for you to learn the triangulation with just X and Y.
Then once you have that down adding Z shouldn't be all that difficult.
Mythros
Enthusiast
Enthusiast
Posts: 306
Joined: Mon Aug 19, 2013 3:28 pm

Re: Basic Terrain Generator

Post by Mythros »

I learn differently than other people. I have autism. I have to see it visually in order to learn. If I see a 3D triangulation formula, I can manipulate it to work to my liking & then post it for other people to learn as well.
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 171
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Re: Basic Terrain Generator

Post by zxretrosoft »

So even... :-)
Now, I have a trivial problem. But I can not fix it.
Everything (at least it seems) is set correctly. On another PC it works. But I have a new laptop and I can not run Shaders. Still environment without Shaders.

Otherwise, other elements it loads correctly (heightmap ...), so the path is probably correct.

Source code is Terrain Generator HLSL.

Image
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Basic Terrain Generator

Post by Samuel »

What operating system is your new laptop?

The original shader was written in HLSL (DirectX shader) which means it will only work on Windows.
If your new laptop has a Mac or Linux operating system then the shader needs to be converted to GLSL (OpenGL Shader Language).
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 171
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Re: Basic Terrain Generator

Post by zxretrosoft »

Samuel wrote:What operating system is your new laptop?

The original shader was written in HLSL (DirectX shader) which means it will only work on Windows.
If your new laptop has a Mac or Linux operating system then the shader needs to be converted to GLSL (OpenGL Shader Language).
Hi Samuel, I have Windows 8, Direct X 11.
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Basic Terrain Generator

Post by Samuel »

Maybe there is an error being reported in your Ogre log. When you get the chance could you post it?
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 171
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Re: Basic Terrain Generator

Post by zxretrosoft »

OK, Samuel, this is my Ogre.txt:

Code: Select all

20:39:43: Creating resource group General
20:39:43: Creating resource group Internal
20:39:43: Creating resource group Autodetect
20:39:43: SceneManagerFactory for type 'DefaultSceneManager' registered.
20:39:43: Registering ResourceManager for type Material
20:39:43: Registering ResourceManager for type Mesh
20:39:43: Registering ResourceManager for type Skeleton
20:39:43: MovableObjectFactory for type 'ParticleSystem' registered.
20:39:43: OverlayElementFactory for type Panel registered.
20:39:43: OverlayElementFactory for type BorderPanel registered.
20:39:43: OverlayElementFactory for type TextArea registered.
20:39:43: Registering ResourceManager for type Font
20:39:43: ArchiveFactory for archive type FileSystem registered.
20:39:43: ArchiveFactory for archive type Zip registered.
20:39:43: ArchiveFactory for archive type EmbeddedZip registered.
20:39:43: DDS codec registering
20:39:43: FreeImage version: 3.10.0
20:39:43: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
20:39:43: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,koa,iff,lbm,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,dds,gif,g3,sgi,j2k,j2c,jp2
20:39:43: PVRTC codec registering
20:39:43: Registering ResourceManager for type HighLevelGpuProgram
20:39:43: Registering ResourceManager for type Compositor
20:39:43: MovableObjectFactory for type 'Entity' registered.
20:39:43: MovableObjectFactory for type 'Light' registered.
20:39:43: MovableObjectFactory for type 'BillboardSet' registered.
20:39:43: MovableObjectFactory for type 'ManualObject' registered.
20:39:43: MovableObjectFactory for type 'BillboardChain' registered.
20:39:43: MovableObjectFactory for type 'RibbonTrail' registered.
20:39:43: *-*-* OGRE Initialising
20:39:43: *-*-* Version 1.8.2 (Byatis)
20:39:43: D3D9 : Direct3D9 Rendering Subsystem created.
20:39:43: D3D9: Driver Detection Starts
20:39:43: D3D9: Driver Detection Ends
20:39:43: Particle Emitter Type 'Point' registered
20:39:43: Particle Emitter Type 'Box' registered
20:39:43: Particle Emitter Type 'Ellipsoid' registered
20:39:43: Particle Emitter Type 'Cylinder' registered
20:39:43: Particle Emitter Type 'Ring' registered
20:39:43: Particle Emitter Type 'HollowEllipsoid' registered
20:39:43: Particle Affector Type 'LinearForce' registered
20:39:43: Particle Affector Type 'ColourFader' registered
20:39:43: Particle Affector Type 'ColourFader2' registered
20:39:43: Particle Affector Type 'ColourImage' registered
20:39:43: Particle Affector Type 'ColourInterpolator' registered
20:39:43: Particle Affector Type 'Scaler' registered
20:39:43: Particle Affector Type 'Rotator' registered
20:39:43: Particle Affector Type 'DirectionRandomiser' registered
20:39:43: Particle Affector Type 'DeflectorPlane' registered
20:39:43: PCZone Factory Type 'ZoneType_Default' registered
20:39:43: CPU Identifier & Features
20:39:43: -------------------------
20:39:43:  *   CPU ID: GenuineIntel: Intel(R) Celeron(R) CPU  N2840  @ 2.16GHz
20:39:43:  *      SSE: yes
20:39:43:  *     SSE2: yes
20:39:43:  *     SSE3: yes
20:39:43:  *      MMX: yes
20:39:43:  *   MMXEXT: yes
20:39:43:  *    3DNOW: no
20:39:43:  * 3DNOWEXT: no
20:39:43:  *     CMOV: yes
20:39:43:  *      TSC: yes
20:39:43:  *      FPU: yes
20:39:43:  *      PRO: yes
20:39:43:  *       HT: no
20:39:43: -------------------------
20:39:43: D3D9 : Subsystem Initialising
20:39:43: Registering ResourceManager for type Texture
20:39:43: Registering ResourceManager for type GpuProgram
20:39:43: ***************************************
20:39:43: *** D3D9 : Subsystem Initialised OK ***
20:39:43: ***************************************
20:39:43: SceneManagerFactory for type 'OctreeSceneManager' registered.
20:39:43: SceneManagerFactory for type 'BspSceneManager' registered.
20:39:43: Registering ResourceManager for type BspLevel
20:39:44: D3D9RenderSystem::_createRenderWindow "PureBasic Ogre", 1366x768 windowed  miscParams: FSAA=0 displayFrequency=0 externalWindowHandle=66432 vsync=true 
20:39:44: D3D9 : Created D3D9 Rendering Window 'PureBasic Ogre' : 1366x768, 32bpp
20:39:44: D3D9: Vertex texture format supported - PF_L8
20:39:44: D3D9: Vertex texture format supported - PF_L16
20:39:44: D3D9: Vertex texture format supported - PF_A8
20:39:44: D3D9: Vertex texture format supported - PF_A4L4
20:39:44: D3D9: Vertex texture format supported - PF_BYTE_LA
20:39:44: D3D9: Vertex texture format supported - PF_R5G6B5
20:39:44: D3D9: Vertex texture format supported - PF_B5G6R5
20:39:44: D3D9: Vertex texture format supported - PF_A4R4G4B4
20:39:44: D3D9: Vertex texture format supported - PF_A1R5G5B5
20:39:44: D3D9: Vertex texture format supported - PF_A8R8G8B8
20:39:44: D3D9: Vertex texture format supported - PF_B8G8R8A8
20:39:44: D3D9: Vertex texture format supported - PF_A2R10G10B10
20:39:44: D3D9: Vertex texture format supported - PF_A2B10G10R10
20:39:44: D3D9: Vertex texture format supported - PF_DXT1
20:39:44: D3D9: Vertex texture format supported - PF_DXT2
20:39:44: D3D9: Vertex texture format supported - PF_DXT3
20:39:44: D3D9: Vertex texture format supported - PF_DXT4
20:39:44: D3D9: Vertex texture format supported - PF_DXT5
20:39:44: D3D9: Vertex texture format supported - PF_FLOAT16_RGB
20:39:44: D3D9: Vertex texture format supported - PF_FLOAT16_RGBA
20:39:44: D3D9: Vertex texture format supported - PF_FLOAT32_RGB
20:39:44: D3D9: Vertex texture format supported - PF_FLOAT32_RGBA
20:39:44: D3D9: Vertex texture format supported - PF_X8R8G8B8
20:39:44: D3D9: Vertex texture format supported - PF_R8G8B8A8
20:39:44: D3D9: Vertex texture format supported - PF_DEPTH
20:39:44: D3D9: Vertex texture format supported - PF_SHORT_RGBA
20:39:44: D3D9: Vertex texture format supported - PF_FLOAT16_R
20:39:44: D3D9: Vertex texture format supported - PF_FLOAT32_R
20:39:44: D3D9: Vertex texture format supported - PF_SHORT_GR
20:39:44: D3D9: Vertex texture format supported - PF_FLOAT16_GR
20:39:44: D3D9: Vertex texture format supported - PF_FLOAT32_GR
20:39:44: D3D9: Vertex texture format supported - PF_SHORT_RGB
20:39:44: D3D9: Vertex texture format supported - PF_PVRTC_RGB2
20:39:44: D3D9: Vertex texture format supported - PF_PVRTC_RGBA2
20:39:44: D3D9: Vertex texture format supported - PF_PVRTC_RGB4
20:39:44: D3D9: Vertex texture format supported - PF_PVRTC_RGBA4
20:39:44: D3D9: Vertex texture format supported - PF_R8
20:39:44: D3D9: Vertex texture format supported - PF_RG8
20:39:44: RenderSystem capabilities
20:39:44: -------------------------
20:39:44: RenderSystem Name: Direct3D9 Rendering Subsystem
20:39:44: GPU Vendor: intel
20:39:44: Device Name: Monitor-1-Intel(R) HD Graphics
20:39:44: Driver Version: 10.18.10.3925
20:39:44:  * Fixed function pipeline: yes
20:39:44:  * Hardware generation of mipmaps: yes
20:39:44:  * Texture blending: yes
20:39:44:  * Anisotropic texture filtering: yes
20:39:44:  * Dot product texture operation: yes
20:39:44:  * Cube mapping: yes
20:39:44:  * Hardware stencil buffer: yes
20:39:44:    - Stencil depth: 8
20:39:44:    - Two sided stencil support: yes
20:39:44:    - Wrap stencil values: yes
20:39:44:  * Hardware vertex / index buffers: yes
20:39:44:  * Vertex programs: yes
20:39:44:  * Number of floating-point constants for vertex programs: 256
20:39:44:  * Number of integer constants for vertex programs: 16
20:39:44:  * Number of boolean constants for vertex programs: 16
20:39:44:  * Fragment programs: yes
20:39:44:  * Number of floating-point constants for fragment programs: 224
20:39:44:  * Number of integer constants for fragment programs: 16
20:39:44:  * Number of boolean constants for fragment programs: 16
20:39:44:  * Geometry programs: no
20:39:44:  * Number of floating-point constants for geometry programs: 0
20:39:44:  * Number of integer constants for geometry programs: 0
20:39:44:  * Number of boolean constants for geometry programs: 0
20:39:44:  * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 ps_2_a ps_2_b ps_2_x ps_3_0 vs_1_1 vs_2_0 vs_2_a vs_2_x vs_3_0
20:39:44:  * Texture Compression: yes
20:39:44:    - DXT: yes
20:39:44:    - VTC: no
20:39:44:    - PVRTC: no
20:39:44:  * Scissor Rectangle: yes
20:39:44:  * Hardware Occlusion Query: yes
20:39:44:  * User clip planes: yes
20:39:44:  * VET_UBYTE4 vertex element type: yes
20:39:44:  * Infinite far plane projection: yes
20:39:44:  * Hardware render-to-texture: yes
20:39:44:  * Floating point textures: yes
20:39:44:  * Non-power-of-two textures: yes
20:39:44:  * Volume textures: yes
20:39:44:  * Multiple Render Targets: 4
20:39:44:    - With different bit depths: yes
20:39:44:  * Point Sprites: yes
20:39:44:  * Extended point parameters: yes
20:39:44:  * Max Point Size: 256
20:39:44:  * Vertex texture fetch: yes
20:39:44:  * Number of world matrices: 0
20:39:44:  * Number of texture units: 8
20:39:44:  * Stencil buffer depth: 8
20:39:44:  * Number of vertex blend matrices: 0
20:39:44:    - Max vertex textures: 4
20:39:44:    - Vertex textures shared: no
20:39:44:  * Render to Vertex Buffer : no
20:39:44:  * DirectX per stage constants: yes
20:39:44: DefaultWorkQueue('Root') initialising on thread main.
20:39:44: Particle Renderer Type 'billboard' registered
20:39:44: Added resource location 'Textures\' of type 'FileSystem' to resource group 'General'
20:39:44: Added resource location 'Height Maps\' of type 'FileSystem' to resource group 'General'
20:39:44: Added resource location 'Scripts\' of type 'FileSystem' to resource group 'General'
20:39:44: Added resource location 'Shaders\' of type 'FileSystem' to resource group 'General'
20:39:44: Parsing scripts for resource group Autodetect
20:39:44: Finished parsing scripts for resource group Autodetect
20:39:44: Creating resources for group Autodetect
20:39:44: All done
20:39:44: Parsing scripts for resource group General
20:39:44: Parsing script Gradient.MATERIAL
20:39:44: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader gradientVP in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
20:39:44: High-level program gradientVP encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader gradientVP in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
20:39:44: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at OgreGpuProgramParams.cpp (line 1441)
20:39:44: Compiler error: invalid parameters in Gradient.MATERIAL(9): setting of constant failed
20:39:44: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader gradientFP in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
20:39:44: High-level program gradientFP encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader gradientFP in D3D9HLSLProgram::loadFromSource at OgreD3D9HLSLProgram.cpp (line 281)
20:39:44: Finished parsing scripts for resource group General
20:39:44: Creating resources for group General
20:39:44: All done
20:39:44: Parsing scripts for resource group Internal
20:39:44: Finished parsing scripts for resource group Internal
20:39:44: Creating resources for group Internal
20:39:44: All done
20:39:44: Can't assign material none to SubEntity of E5 because this Material does not exist. Have you forgotten to define it in a .material script?
20:39:44: WARNING: material Gradient has no supportable Techniques and will be blank. Explanation: 
Pass 0: Vertex program gradientVP cannot be used - compile error.
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Basic Terrain Generator

Post by Samuel »

Looks like this is the main problem.
Ogre log wrote: 20:39:44: Compiler error: invalid parameters in Gradient.MATERIAL(9): setting of constant failed
I have a quick question for you. Have you edited the script or shader files at all?
If they are the original files then it's a little bit puzzling as to why this error is popping up.



I wonder if anyone else with Windows 8 could take the time to test my original example?
I don't have a computer with Windows 8 available to me at the moment, and it would make things a little easier if we could narrow this down to an OS issue.
The download link is in my first post and the file to be tested is Terrain Generator HLSL.pb. Many thanks!
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 171
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Re: Basic Terrain Generator

Post by zxretrosoft »

Have you edited the script or shader files at all?
If they are the original files then it's a little bit puzzling as to why this error is popping up.
Yes, all original and complete.

I have 2 computers. One desktop PC, with Windows 8. I have files in the Documents folder. Everything works.
Second PC (notebook), Windows 8 too. The same process, the same folder. And does not work.

If it's not any restrictions? It is one of the cheapest laptops on the market
http://www.czc.cz/hp-stream-13-c000nc-m ... 64/produkt
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Basic Terrain Generator

Post by Samuel »

The only thing I can see that might be an issue is the Intel Celeron N2480 processor with built in graphics. Intel has a terrible track record when it comes to supporting graphics. So, I wouldn't be surprised if that's the problem.

According to Ogre the shader requires at least an ATI Radeon 9600 or nVidia GeForce FX 5 series graphic card to run.
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 171
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Re: Basic Terrain Generator

Post by zxretrosoft »

Samuel wrote:The only thing I can see that might be an issue is the Intel Celeron N2480 processor with built in graphics. Intel has a terrible track record when it comes to supporting graphics. So, I wouldn't be surprised if that's the problem.

According to Ogre the shader requires at least an ATI Radeon 9600 or nVidia GeForce FX 5 series graphic card to run.
This is bad news for me :(

In that case, I return the laptop back to the store. Damn!

Thank you again Samuel;-)
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Basic Terrain Generator

Post by Samuel »

You could try updating the graphic drivers on your laptop. I have heard of people having success using Intel graphics with Ogre, but the results were generally poor compared to the ATI and Nvidia cards.
https://downloadcenter.intel.com/Search ... eron+N2840
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 171
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Re: Basic Terrain Generator

Post by zxretrosoft »

Thanks, but it did not help :( I have to look for another notebook. But in the Czech Republic are 13 "laptops with only Intel chip :|
http://www.czc.cz/notebooky/produkty#q- ... indows%208

Terrain Generator HLSL is for me at this time important and I need to expand:-)

EDIT:
Well, notebook is back in the shop. They returned me the money and I will choose a better one...
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: Basic Terrain Generator

Post by Samuel »

zxretrosoft wrote:I have to look for another notebook. But in the Czech Republic are 13 "laptops with only Intel chip :|
It's OK to get a laptop with an Intel processor, but just try to find one that comes with a non integrated AMD or Nvidia graphic card as well.
User avatar
zxretrosoft
Enthusiast
Enthusiast
Posts: 171
Joined: Wed May 15, 2013 8:26 am
Location: Czech Republic, Prague
Contact:

Re: Basic Terrain Generator

Post by zxretrosoft »

Well, I tried this notebook

http://www.czc.cz/hp-probook-430-g2-cer ... 73/produkt

and nothing... The same error.

This HP is relatively expensive, 13990 CZK (= 570 USD), but with graphic card Intel HD Graphics.
try to find one that comes with a non integrated AMD or Nvidia graphic card as well
Unfortunately, I have not found a notebook with AMD or Nvidia graphic card. Here, all are Intel :(
Post Reply