Simple Paged Terrain [v2.00 Released! Page 21]

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany
x 1

Post by xadhoom »

Sounds like a good plan. But don´t rush it.
I´ve learned that (small) bugs, bad usability and inconsitent documentation can fail a whole project. Even though it is a great tool...

And btw. you really should rest between your hard coding days...
:wink:
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Here's a better video showing how brushing works, as well as how it handles elevation displays.

http://vimeo.com/1388327

I just need to finish the file-format loader and some settings stuff, then build some more shaders/materials and I should be good for a first release.

Edit: Oh, and all those striations are there because I need to re-add bi-linear interpolation on the brushes. I'll also have some filters like blur and such.

Edit 2: Something that had fallen off the list and has been added now: You can easily set the LOD bias at run-time, so if there's too much geometry being displayed up-close, you can adjust the bias to help your framerate.
SSERG
Kobold
Posts: 25
Joined: Wed Mar 26, 2008 10:14 pm

Post by SSERG »

Incredible ...

the color from the Brush/Decal change at different high ??

realy good !!!

How have make the follw with the mouse ?? or better with what an Gui ??

at moment i have no time.. but i work on the texture .. i will change it with Brush too... but i need more Time :cry:
My Children need me too :lol:

perhaps i work @ night more :twisted:
User avatar
ajs15822
OGRE Expert User
OGRE Expert User
Posts: 570
Joined: Mon Jan 02, 2006 2:05 am
Location: Texas
x 2

Post by ajs15822 »

holy cow poop, that is really cool! The elevation display and brush decal is really intuitive. :shock:
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

I've got it so the brush can edit textures now as well, but I just need to build a bunch of materials to support them.

The cursor shouldn't actually be visible there (it disappears when brushing), but FRAPS refused to ignore it, even with the No Cursor option enabled. The cursor is also offset from where it really is because of the way the coordinates are calculated differently than screen-position (since it's based on the form's current cursor).

And, yes, the color is using a simple gradient I whipped up that changes under the brush based on elevation, with dark blue at 0 and red at the top.


There are other features there that I'm not really able to show off very well yet, but it's getting there.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66

Post by sinbad »

That's nice, great work.

How's this for another idea though - take a 2 texture with simple horizontal lines and height markers on it in the middle. Then, project this onto the terrain based on the height and the camera direction (flattened to be in the terrain plane), and then alpha blend it based on the terrain normal (fade out at shallow angles, to prevent streaking of the lines too far). That should give you an ordinance survey contour-map kind of look. You could take it one step further and instead of projecting a 2D texture you could use a cube map (only the sides are useful of course) so that you could look at it from the top too. It just wouldn't deal with very slowly changing heights very well, you'd need to generate the contours in a pixel shader to do that.

Just a random idea in case you felt like playing with it :)
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Huh, that's actually fairly clever. I was originally going to go with a sliced grid (like in those SciFi war-rooms) and place that where it was getting edited, but I suddenly thought of elevation maps and went the gradient direction.

Currently I'm just sliding a decal texture around in the shader - the projected texture stuff was coming out wrong, even without shaders (I lost nearly a whole day of coding trying to figure out why my deformation math was wrong only to find that the projection wasn't working right :( ).

I'll probably stick with this method for now, but I can't see why I couldn't integrate your method at a later date.
mysterycoder
Google Summer of Code Student
Google Summer of Code Student
Posts: 169
Joined: Sat Dec 03, 2005 2:04 am
x 6

Post by mysterycoder »

I'm trying to get SPT to work with Shoggoth using the latest svn version of SPT on Ubuntu 8.04. Aside from one or two minor changes, it compiles fine.

In my application, I used the createSPT function from example to construct the terrain.

When I start the application I get the error:

Code: Select all

22:35:43: Can't assign material 1 - Default to SubEntity of SPT_SkyBox_Tex_Ent because this Material does not exist. Have you forgotten to define it in a .material script?
22:35:44: WARNING: material SPT_Highlands has no supportable Techniques and will be blank.
The error isn't very descriptive so I assigned the terrain the "SPT_Low" material, which is the material that "SPT_Highlands" is derived from.

Now the error that I get is:

Code: Select all

22:53:52: Can't assign material 1 - Default to SubEntity of SPT_SkyBox_Tex_Ent because this Material does not exist. Have you forgotten to define it in a .material script?
22:53:53: OGRE EXCEPTION(7:InternalErrorException): Cannot load GL vertex program SPT2_Low_VS.  Line -1:
line 38, column 24:  warning: EXT_vertex_weighting and ARB_vertex_blend not supported.  Using generic vertex attribute 1.
 in SPT2_Low_VS at OgreGLGpuProgram.cpp (line 219)
22:53:53: Gpu program SPT2_Low_VS encountered an error during loading and is thus not supported.
I have a GeForce 8800 GTS 512mb so it seemed strange that I would be missing OpenGL extensions.
I looked up the error and found a post on the NVidia Developer Forums relating to it. Apparently EXT_vertex_weighting and ARB_vertex_blend are not supported on newer cards.

I am not very good with shaders.
Does anybody with more knowledge have an idea about how to fix this?

Thank you for your help.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Ya, I'm working this out - I'm pretty much positive that this has to do with the way the new material compiler works, which I haven't had time to test. I think someone I was working with did get the errors to cease on Shoggoth, but it was still acting strange.

I've been sticking with 1.4.9 until the smoke blows over with Shoggoth, then I'll take more time with it.


Edit: Doh, I'm a butthead - I read the post too fast; it looked just like an error someone else got that I was helping, so I didn't see the error.

I wasn't aware about that issue, so I'll have to take a look (I have a GeForce 7900 GS, so I can't test the new stuff).
mysterycoder
Google Summer of Code Student
Google Summer of Code Student
Posts: 169
Joined: Sat Dec 03, 2005 2:04 am
x 6

Post by mysterycoder »

I'll downgrade to Eihort to see if my problem is related to Shoggoth.
mysterycoder
Google Summer of Code Student
Google Summer of Code Student
Posts: 169
Joined: Sat Dec 03, 2005 2:04 am
x 6

Post by mysterycoder »

I've downgraded to Eihort and it works fine.

What was the issue the other fellow was having with Shoggoth? I know you don't want to spend a lot of time troubleshooting Shoggoth, but it would be really helpful to have all of the available info.

I'm going to recompile Shoggoth with the new compiler material disabled to verify that there is indeed a problem with it.

Thanks for your help :D
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

If memory serves, it was just the way the "import" command was used at the top of the material. I have no problem trying to support Shoggoth (I've been doing my best to get Linux to play nice with SPT as much as possible and I'm Ubuntu-stupid), I just have limited time. Last time I went to compile Shoggoth it exploded, but I think that's because I tried to enable threading. When I get a chance to, I'll fire Shoggoth up with a clean copy and see what's going on.

I'm trying my hardest to get this editor finished, so I have to skip some things in my schedule.
mysterycoder
Google Summer of Code Student
Google Summer of Code Student
Posts: 169
Joined: Sat Dec 03, 2005 2:04 am
x 6

Post by mysterycoder »

Cool, thanks for the info. :)
I re-compiled Shoggoth without the new compiler and the demo runs great.
I'm going to re-re-compile it with the new material compiler and look into the material changes. :wink:
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

mysterycoder wrote:Cool, thanks for the info. :)
I re-compiled Shoggoth without the new compiler and the demo runs great.
I'm going to re-re-compile it with the new material compiler and look into the material changes. :wink:
Much appreciated. Basically, to get it working, I think you just need to add an "import * from SPT2_Mat.material" at the top of SPT_Highlands.material and it should comply.
mysterycoder
Google Summer of Code Student
Google Summer of Code Student
Posts: 169
Joined: Sat Dec 03, 2005 2:04 am
x 6

Post by mysterycoder »

With your help I've gotten a bit farter.

I added

Code: Select all

import BasicObject from "BasicObject.material"
to the top of "ScatteredOgre.material" and added

Code: Select all

import SPT2_Low from "SPT2_Mat.material"
to the top of "SPT2_Highlands.material".

With these two changes to the materials, the application now starts. The blue sky sphere is present as well as the ogres on the ground. Everything is functional except the terrain remains black.

Image


This is the log:

Code: Select all

20:56:57: Mesh: Loading cube.mesh.
20:56:57: Can't assign material 1 - Default to SubEntity of SPT_SkyBox_Tex_Ent because this Material does not exist. Have you forgotten to define it in a .material script?
20:56:57: WARNING: Texture instance 'SPT_SkyBox_Tex' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
20:56:57: WARNING: Texture instance 'SPT_SkyBox_Tex' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
20:56:57: Creating viewport on target 'rtt/142931432/SPT_Lightmap_RTT', rendering from camera 'SPT_Lightmap_Camera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
20:56:57: Viewport for camera 'SPT_Lightmap_Camera', actual dimensions L: 0 T: 0 W: 2048 H: 2048
20:56:57: WARNING: Texture instance 'SPT_Heightmap_Tex' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
20:56:58: Mesh: Loading ogrehead.mesh.
20:56:58: Texture: WeirdEye.png: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
20:56:58: Texture: GreenSkin.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
20:56:58: Texture: spheremap.png: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
20:56:58: Texture: Dirt.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
20:56:58: *** Initializing OIS ***
20:56:58: WARNING: Texture instance 'SPT_Lightmap_RTT' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
20:56:58: WARNING: Texture instance 'SPT_Ext_Tex' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
20:56:58: WARNING: Texture instance 'SPT_Lightmap_RTT' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
20:56:58: Texture: Highlands_Coverage.jpg: Loading 1 faces(PF_R8G8B8,2048x2048x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,2048x2048x1.
20:56:58: Texture: Highlands_Splat.dds: Loading 1 faces(PF_DXT5,2048x2048x1) with 11 custom mipmaps from Image. Internal format is PF_DXT5,2048x2048x1.
20:56:58: Texture: herbe_3.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
20:56:58: Texture: herbe_5.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
20:56:58: Texture: sand_025.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
20:56:58: Texture: detail_splat1.png: Loading 1 faces(PF_R8G8B8,512x512x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
20:56:58: Texture: Detail3.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
20:56:58: WARNING: Texture instance 'SPT_Ext_Tex' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
20:56:58: OGRE EXCEPTION(7:InternalErrorException): Cannot load GL vertex program SPT2_Low_VS.  Line -1:
line 38, column 24:  warning: EXT_vertex_weighting and ARB_vertex_blend not supported.  Using generic vertex attribute 1.
 in SPT2_Low_VS at OgreGLGpuProgram.cpp (line 219)
20:56:58: Gpu program SPT2_Low_VS encountered an error during loading and is thus not supported.
20:56:58: Texture: brush0.png: Loading 1 faces(PF_R8G8B8,64x64x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,64x64x1.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Can you post SPT2_Low.program that you have? I'm in the middle of an enormous SVN commit and I think mine is a bit different than the old SVN version.

If not, just try some more profiles, like vp30 or vp40.

Also check to see whether or not the Ogre DemoTerrain works or not.
mysterycoder
Google Summer of Code Student
Google Summer of Code Student
Posts: 169
Joined: Sat Dec 03, 2005 2:04 am
x 6

Post by mysterycoder »

SPT2_Low.program:

Code: Select all

vertex_program SPT2_Low_VS cg
{
	source SPT2_Low.source
	entry_point vs_main
	profiles vs_2_0 arbvp1

	default_params
	{
		param_named_auto matWorldViewProj worldviewproj_matrix
		param_named_auto matWorld world_matrix
		param_named_auto vViewPosition camera_position 0
		param_named_auto morphFactor custom 77
		//param_named_auto parentUVOffset custom 99
	}
}


fragment_program SPT2_Low_PS cg
{
	source SPT2_Low.source
	entry_point ps_main
	profiles ps_2_0 arbfp1
	compile_arguments -DUSE_SCATTERING
}
SPT2_Low.source:

Code: Select all

void vs_main( 
		float4 Pos : POSITION,
		float2 Tex	: TEXCOORD0,
		float2 Tex2 : TEXCOORD1,
		float delta : BLENDWEIGHT,

		out float4 oPos : POSITION,
		out float2 oTex : TEXCOORD0,
		out float4 oSplat12 : TEXCOORD1,
		out float4 oSplat34 : TEXCOORD2,
		out float2 oDetail : TEXCOORD3,
		out float4 oDepth   : TEXCOORD4,

		uniform float4x4 matWorldViewProj,
		uniform float4x4 matWorld,
		uniform float4 vViewPosition,
		uniform float4 vSplatScales,
		uniform float4 vDetailScales,
		uniform float morphFactor,
		uniform float fMaxDistance
		 )
{

	
	Pos.y += delta * morphFactor;


	oPos = mul( matWorldViewProj, Pos);
	float3 vWorldPos = mul(matWorld, Pos).xyz;
	//oNormal = Norm;

	//float3 EyeDir = vViewPosition.xyz - vWorldPos;
	float3 EyeDir = vWorldPos - vViewPosition.xyz;
	//EyeDir.z *= -1;
	float Depth = length(EyeDir);
   
	oDepth.xyz = EyeDir / Depth;
	oDepth.w = Depth / (fMaxDistance * 2.0f);


	oTex = Tex;

	oSplat12.xy = vWorldPos.xz / vSplatScales.x;
	oSplat12.zw = vWorldPos.xz / vSplatScales.y;
	oSplat34.xy = vWorldPos.xz / vSplatScales.z;
	oSplat34.zw = vWorldPos.xz / vSplatScales.w;
	

	oDetail = Tex * vDetailScales.x;
}

void ps_main( 
		float2 texCoord : TEXCOORD0,
		float4 Splat12 : TEXCOORD1,
		float4 Splat34 : TEXCOORD2,
		float2 Detail : TEXCOORD3,
		float4 Depth   : TEXCOORD4,

		out float4 oColor : COLOR0,

		uniform sampler2D texLightmap,
		uniform sampler2D texCoverage,
		uniform sampler2D texSplat,
		uniform sampler2D texSplat1,
		uniform sampler2D texSplat2,
		uniform sampler2D texSplat3,
		uniform sampler2D texSplat4,
		uniform sampler2D texDetail1,
		uniform samplerCUBE texSkyBox,
		uniform sampler1D texExtinction

		 )
{

   float4 fLight = tex2D(texLightmap, texCoord);

   float4 vCoverageColor = tex2D(texCoverage, texCoord);
   
    
   float4 vSplatColor = tex2D(texSplat, texCoord);
   vSplatColor /= vSplatColor.x + vSplatColor.y + vSplatColor.z + vSplatColor.w;
   float4 vSplat1 = tex2D(texSplat1, Splat12.xy) * vSplatColor.x;
   float4 vSplat2 = tex2D(texSplat2, Splat12.zw) * vSplatColor.y;
   float4 vSplat3 = tex2D(texSplat3, Splat34.xy) * vSplatColor.z;
   float4 vSplat4 = tex2D(texSplat4, Splat34.zw) * vSplatColor.w;
   
 
   oColor = vSplat1 + vSplat2 + vSplat3 + vSplat4;


   float fDetail = tex2D(texDetail1, Detail).x;

   oColor *= fDetail;
            
   oColor.xyz *= vCoverageColor.xyz * 0.9f;
   
   oColor *= (fLight.w * 2.0 + 0.5);

#ifdef USE_SCATTERING  
   float3 SkyColor = texCUBE(texSkyBox, Depth.xyz).xyz;
   float ExtinctionVal = tex1D(texExtinction, saturate(Depth.w)).x;
 
   oColor.xyz = lerp(SkyColor, oColor.xyz , ExtinctionVal);
#endif
}
I tried both profiles with the same results.

The Ogre DemoTerrain works fine.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Thanks - I'll have some people I know test some updates when I have time to do a play-by-play.


In the mean-time, here's an updated video of how everything's coming along. Unfortunately, this is on Viddler, so the quality isn't nearly as good as Vimeo (Which won't accept videos like this come Sept 1st, so I need to find someone new anyways).

http://www.viddler.com/explore/HexiDave/videos/10/

The noise editor that I kept clicking off-screen looks like this:
Image

Progress is good - uploaded 230 new files to SVN earlier and updated everything (although, I talked to my linux buddies and I need to do some house-keeping for those damn Ogre::ushort's again). I'll also get makefiles and Code::Blocks workspaces soon to match.
mysterycoder
Google Summer of Code Student
Google Summer of Code Student
Posts: 169
Joined: Sat Dec 03, 2005 2:04 am
x 6

Post by mysterycoder »

I re-constructed the shader piece by piece and found that the atmospheric scattering causes the black terrain. The program can't find the SkyBox texture alias. I should have it fixed by the end of the day. :)
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Groovy. I have a new set of materials/shaders being built and coming along nicely and I just got my material editor working for the most part (still some stuff to do), but you can edit shader and texture values at this point and that was the hard part (prototyping the weird stuff like file loading from a PropertyGrid).
User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany
x 1

Post by xadhoom »

Its maybe a bit off topic but did you read the papers of Hoppe?

http://research.microsoft.com/~hoppe/

Besides the terrain processing part there is the paper "Parallel controllable texture synthesis" where he also shows an example on
how to edit heightmaps using his synthesis approach. Maybe there are "better" approaches in the meantime but the video is very impressive
(besides the other really cool stuff ).

:wink:
User avatar
aguru
Goblin
Posts: 236
Joined: Tue Feb 26, 2008 5:48 pm
x 3

Post by aguru »

HexiDave I fixed up Code::Blocks Projects for Linux. If you think they would be of help to other users I could zip them up and send them over.

[edit] Its only for the lib and demo projects obviously.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Aguru: Sure, I'd appreciate it.


For those wondering why I haven't produced anything interesting the past few days, it's because Visual Studio hates all life. It broke my designer form... or so I thought. Turns out, copying/pasting the project code and all the other stuff into a new project is enough to make it happy again. Either way, I lost about 2 days to a completely worthless Visual Studio bug (how'd you like to be greeted by "Catastrophic Error" and nothing else in the designer, but the program compilers and works perfectly fine?).

Otherwise, I have this to report:

http://www.fileden.com/files/2007/5/28/ ... ditor1.jpg

I can load and edit materials and shaders quite completely. I can also create packages of ready-made setups for SPT with all your internal settings that can be loaded into SPT with a simple load command.

Texture editing works, but I was in the middle of building a set of easy-access form windows when all hell broke loose with Visual Studio, so I'm behind schedule with that.



To those of you having speed issues, here's some news: I have options now to help the amount of geometry lessen near the camera. Along with that, I have less resource consuming shaders/materials working now. They'll work on a wider range of hardware and be easier to load and work with.
User avatar
aguru
Goblin
Posts: 236
Joined: Tue Feb 26, 2008 5:48 pm
x 3

Post by aguru »

Looking forward to those speed improvements... but frankly on a 8800gt, even in 1920x1200, things are quite fast already. :)

Basic Code::Blocks project files and workspace, just extract it into trunk: http://rapidshare.com/files/132827833/s ... x.zip.html

Also, in GPULigtmapper.cpp, I had to change three occurances of ushort into Ogre::ushort.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Post by HexiDave »

Ya, I know about the ushort thing - that's coming. I had SPT compiled and running on Ubuntu, but I'm not too confident in all my stuff being setup properly, so I appreciate the help. I hadn't actually known why people were having issues with the ushort thing in the past, only to be told that Linux likes to use ushort normally. Oh well, easily remedied.


I'm sort of back on track now, but every time I create a new form in my project, it breaks it. Visual Studio creates several copies in it's auto-creation code of each control (i.e. the declarations are duplicated) and then, if I have the audacity of cleaning up it's error, it goes ahead and irreversibly breaks that form. No matter what I do, it eventually kills it again. I can't figure it out as my system is quite clean and I'm having trouble finding any real reference on it. I'll have to take a different route for the interface, rather than popping up new windows =/ I'll probably be stuck just making more tabs in the editor section. The only other option is stupid: creating extra assemblies just for forms.