Planetside Software Forums

General => Terragen Discussion => Topic started by: wonderbean on November 18, 2007, 10:14:56 PM

Title: The sky isnt being rendered well in preview mode
Post by: wonderbean on November 18, 2007, 10:14:56 PM
I just downloaded tg2 and in preview mode the sky is not rendering well.  It is a collection of squares at different angles.  Some look like sky but others are just gray... and they stay that way.

Title: Re: The sky isnt being rendered well in preview mode
Post by: rcallicotte on November 18, 2007, 11:01:20 PM
The default atmosphere might be a bit thick for you then.  You can adjust it.

The preview mode is just that, though, and (as I can see from your captured image here) when you are higher up and looking across the distances, you will find that your distant land mass melds more readily with the sky.  This is as it is in real life.
Title: Re: The sky isnt being rendered well in preview mode
Post by: Cyber-Angel on November 18, 2007, 11:57:37 PM
I have the same problem which I think is related to the ATI Graphics Card I have, I cannot see any thing else it could be, then again I might be wrong and it could be some thing else after all this software is still a work in progress.

Its like the sky is all broken up in the 3D Preview instead of been smooth, I am just wondering weather if a graphics card is bellow a certain threshold for on board memory weather that has implication's for the way the Open GL Preview will display, as when you render the scene every thing is how it should be.

It could just be some thing to do with the way that TG2 handles Open GL some thing to look into.

Regards to you.

Cyber-Angel             
Title: Re: The sky isnt being rendered well in preview mode
Post by: Oshyan on November 19, 2007, 02:40:38 AM
The preview is generally supposed to render completely and not show those gray areas. When it doesn't it generally seems to be related to graphics card issues. Older or less capable cards are more likely to have problems. You can try updating your graphics card drivers, but some recent ATI drivers have actually been *worse* with many OpenGL applications (not just TG2), so that may not work that well. I'm not sure whether they've fixed those issues yet. If you have a newer card you can probably count on a future graphics driver or TG2 update making it work better, but for an older card you may just have to work with it that way unfortunately.

- Oshyan
Title: Re: The sky isnt being rendered well in preview mode
Post by: rcallicotte on November 19, 2007, 04:32:18 PM
I guess I didn't realize how off my graphics card is.
Title: Re: The sky isnt being rendered well in preview mode
Post by: bigben on November 20, 2007, 02:43:47 AM
Defnitely graphics card/driver-related... and newer is not necessarily better. My oldest system renders the atmosphere  preview the best.. Must try some of the newer machines at work  ;)
Title: Re: The sky isnt being rendered well in preview mode
Post by: Matt on November 20, 2007, 11:57:47 PM
This tends to happen with different levels of severity on different graphics cards/drivers, but there is a workaround. The clipping planes used by Terragen's OpenGL display can be adjusted using the '[' and ']' keys on your keyboard. After pressing ']' key a few times the sky should render correctly, but this also adjusts the near clipping plane so you may find that the foreground cuts off if you get too close.

Matt
 
Title: Re: The sky isnt being rendered well in preview mode
Post by: Cyber-Angel on November 21, 2007, 01:54:09 AM
Thanks Matt,


I do have a question, would it be possible (Theoretically Specking) to have some kind of automatic process that looks for this issue and corrects it before it is apparent to the user with the work around you suggest been there as a manual backup should the automatic process not work in all situations?

Regards to you.

Cyber-Angel       
Title: Re: The sky isnt being rendered well in preview mode
Post by: wonderbean on November 21, 2007, 11:14:09 PM
Thanks for all the input. 

Is this a problem with Open GL?  Does terragen 2 support directx?
Title: Re: The sky isnt being rendered well in preview mode
Post by: Oshyan on November 21, 2007, 11:19:39 PM
It's an issue with the way TG2 interacts with the OpenGL implementation in your graphics card or driver. Technically it's a limitation on the graphics card side but, as Matt mentioned, there are ways of potentially working around it. It mostly has to do with the large range of scale TG2 works on.

TG2 doesn't support DirectX and is not likely to do so any time soon because it is a cross-platform application (Mac and PC) and DirectX is not available on operating systems besides Windows. Given the availability of a cross-platform graphics solution like OpenGL it would be a bit of a waste to dedicate effort to a proprietary single platform solution that only covers part of our product range.

- Oshyan
Title: Re: The sky isnt being rendered well in preview mode
Post by: Matt on November 22, 2007, 12:56:52 PM
I do have a question, would it be possible (Theoretically Specking) to have some kind of automatic process that looks for this issue and corrects it before it is apparent to the user with the work around you suggest been there as a manual backup should the automatic process not work in all situations?

Perhaps. I have thought about adjusting the clipping planes according to the closest object/surface to the camera. If I do that, the sky would still disappear whenever there is an object/surface close to the camera. It can make it so that the far clipping plane stays far enough to always capture the sky, but then there can be other problems with the depth buffer.

Matt
Title: Re: The sky isnt being rendered well in preview mode
Post by: Cyber-Angel on November 22, 2007, 02:14:16 PM
Matt,

I am sure in time a solution to this issue can be found, which should also fix the camera ending up inside the terrain issue unless it is planed to have collision detection (Found in flight simulation games to prevent a players aircraft from flying though objects such as maintains) I look froward to seeing what you come up with.

Maybe a deterministic solution could be used so that the view frustum is linked to the clipping planes or some thing, unless there is a reason not to.

Cyber-Angel         
Title: Re: The sky isnt being rendered well in preview mode
Post by: Matt on November 22, 2007, 03:22:33 PM
Hi CA,

Preventing the camera from going beneath the terrain is a completely separate issue. The OpenGL drawing problems come from limitations in the video card or drivers and the solutions involve changing the way things are drawn.

Not sure what you mean about linking the view frustum to the clipping planes. I have to choose clipping planes that capture as much of the scene as possible without making them so far apart that the video card can't render it properly. Another possibility is to not draw the background sphere so far away, but I'd have to make the renderer intelligent enough to know when it can start moving polygons around and when it needs to leave them where they are for proper depth occlusion. If all video cards had better depth buffer resolution I wouldn't even have to think about doing something as complex as that...

Matt
Title: Re: The sky isnt being rendered well in preview mode
Post by: Cyber-Angel on November 22, 2007, 11:53:40 PM
Another idea is if the renderer new where the viewer (Called Render Camera) was in 3D space and could call (I think thats the term) information about camera position relative to the horizon (The renderer could interrogate the Render Camera Dialog for information on current position and rotation of the camera: ) plus current Field of View information (Also called from the Render Camera Dialog), the last thing the render (Or maybe the first) looks at is the current resolution 2000 X 3000 say, these three peaces of information tell the renderer how much sky can be seen by the observer and where it is in 3D space.

Then you'd take that information and look to see the current sky state in the 3d preview and look for gaps caused by the clipping plane issue and then use the method you'd described.

Just some ideas that came to me last night (Australian Time).

I hope these things I describe would not be nightmares, only trying to help  :)

Regards to you.

Cyber-Angel     
Title: Re: The sky isnt being rendered well in preview mode
Post by: Matt on November 24, 2007, 12:52:42 PM
Hi CA,

Yes, that's the easy bit ;)  I can do that. As I said, the problem is in doing that without making the foreground disappear. The video card capabilities make it impossible to render such a large range of distances without artifacts. I make the user choose where the clipping planes are because I don't know whether you want to see the sky or the foreground in such situations.

Matt
Title: Re: The sky isnt being rendered well in preview mode
Post by: Cyber-Angel on November 24, 2007, 01:24:10 PM
I think it would be case dependent, but as a general rule the foreground and sky should be visible (By Default) to see the sky for the point of view of clouds, sun position and its interaction with the terrain, and the terrain (Foreground included) for seeing surfacing, displacement and the like. I can envisage times where you might want  to considerate on the terrain or the sky separately (To allow refinement of problem areas, or for certain production needs) the ability to focus on these areas (Via clipping planes or other methods) should given a properly designed renderer to free up system resources and considerate on those areas, weather this is in the 3d Preview or  on the image at render-time, its about allowing flexibility of work-flow to meet the needs of the artist.

Regards to you.

Cyber-Angel               
Title: Re: The sky isnt being rendered well in preview mode
Post by: Matt on November 24, 2007, 01:32:39 PM
Yes, of course. It should always try to show *both* in the default view. That is why we are having this discussion - the problem is that it is difficult to show both.

Matt
Title: Re: The sky isnt being rendered well in preview mode
Post by: Cyber-Angel on November 24, 2007, 02:04:07 PM
This to me sounds like an incremental problem that will take time to solve but I really don't think it is so insurmountable as to be impossible, what in your view are the areas of difficulty has you see them so that I may better understand the issue/s from a developmental perspective?

I have not encountered this problem with clipping planes before in what I have read on them, it would be interesting to do some research and find out weather other software during its development encountered such problems and how they where fixed (If such data is in the public domain), but I would not know the search criteria for such an enterprise has I have stated in other posts I am not a programmer and do not calm to be one.

As Sherlock Holmes said "Once you have eliminated the improbable, what ever remains how ever unlikely must be the truth"   

One question comes to mind is the implementation of Open-GL used for the display of the 3d Preview Pixel Accurate and if not would making it as such help deal with the Clipping Plane rendering issue (Providing this is feasible)?

Regards to you.

Cyber-Angel       
Title: Re: The sky isnt being rendered well in preview mode
Post by: rcallicotte on November 25, 2007, 01:22:45 AM
I'm a lot more interested in the basic functionality being accomplished by year's end (or thereabout) rather than nitpicking about the preview mode.

Title: Re: The sky isnt being rendered well in preview mode
Post by: Oshyan on November 25, 2007, 02:33:42 AM
Most other software doesn't run into this because it doesn't deal with the huge ranges of scale that TG2 does. The background sphere that the sky renders against is large enough to encompass the default planet by a good margin, and the default planet is Earth-sized, so you can imagine it's pretty large and far away in terms of meters. TG2 has accuracy down to millimiters I believe, and I'm not sure if it scales that with distance, so depicting things on large scale with that kind of accuracy can be out of the range of capability of some graphics cards and/or drivers. The simple fact is many other graphics applications just don't require depicting that wide a range of scale and hence the accuracy of the depth buffer doesn't necessarily have to be as high. As graphics cards evolve more and more emphasis is being placed on precision and accuracy as well as rendering large ranges of scale, so this problem will be increasingly rare I think. Already it occurs on a minority of systems, so I don't really think it's worth spending time creating special case functionality to address given the small group of affected users and the existence of an effective workaround. It should be documented as a known problem with some configurations and a solution provided and then left at that.

- Oshyan
Title: Re: The sky isnt being rendered well in preview mode
Post by: Cyber-Angel on November 25, 2007, 03:22:19 AM
I just did some looking into depth buffers, could it be that what is going on with the far clipping plane is an example of Z Fighting and I came across the Wikipedia article http://en.wikipedia.org/wiki/Z-fighting on the subject and it mentions several workarounds to try and resolve the problem, these are:

Higher resolution depth buffer by using a W-Buffer:

Using a Stencil Buffer:

Post transformation screen space Z-buffer offset:

And Invariant Vertex Transformation.

Like I said these things take time to resolve and solutions to them found and implemented, only trying to help.  :)

Regards to you.

Cyber-Angel

End of Line.   


   
Title: Re: The sky isnt being rendered well in preview mode
Post by: Oshyan on November 25, 2007, 03:56:13 AM
The simple root of the problem is that not all graphics cards have the same fundamental capabilities. Some have less accurate z-buffers, some don't have w-buffer support at all, etc. No matter what solution we used, as long as we're relying on graphics card hardware to implement it we'll be limited by what's available on the user's system. If we don't use graphics card hardware then we rely on software, which would probably be a lot slower and not supported on all systems (e.g. Windows Vista).

This is really no different than what games have to deal with, although it's far simpler, and although there is always someone complaining that the latest game (say Crysis) doesn't work on their 5 year old system, there is really just no way to support everything fully without glitches. I think you'll find that other similar 3D applications that use graphics card display functions for viewport rendering (read: the vast majority of them) have similar or often much worse problems with less-than-outstanding graphics cards. In fact many of the higher-end graphics programs like 3DS Max and Maya have specific lists of cards that are supported and they often recommend purchasing special graphics cards that can be $1000 or more for best performance and viewport accuracy. I think TG2's problems in viewport rendering are fairly minor by comparison. ;)

- Oshyan
Title: Re: The sky isnt being rendered well in preview mode
Post by: Cyber-Angel on November 25, 2007, 05:20:57 AM
Such is life what is needed is standard for graphics cards (Not likely any time soon) for feature set commonality among cards, what software would do in a ideal world is automatically look for and use features if present (Some software looks automatically for and uses Transform & Lighting if present, by way of example). How ever such universality is not on any ones horizon soon.

All the best with what ever solution (Even if not perfect) can be found to this small problem, what fun community based software development is! I also think that this conversation can go no further at this juncture unless further useful data can be provided; it has severed its purpose of providing a sounding board for idea's weather they prove useful or no is not for any one to rightly say at this time, a case of Que Sera, Sera I would say.     

Regards to you.

Cyber-Angel

 End of Line