Crystal Space
Welcome, Guest. Please login or register.
September 19, 2014, 11:13:56 pm

Login with username, password and session length
Search:     Advanced search
9018 Posts in 2051 Topics by 8482 Members
Latest Member: Tracybuchanan
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Weird visual artifact when more than one portal to a sector are visibles.
« previous next »
Pages: [1] Print
Author Topic: Weird visual artifact when more than one portal to a sector are visibles.  (Read 3946 times)
dominic
Newbie
*
Posts: 25


View Profile
« on: August 24, 2005, 02:44:21 pm »

Hello,
    I have been creating a small test map.  However, I noticed some bug.  When two portals are pointing to the same sector, and both portals are visible in the screen, a weird visual artifact sometimes appear "on" the portal, depending on your position.  I have tried using no clipping, software clipping, hardware clipping and stencil clipping, but the result is always the same, except with stencil clipping, where the artifact is always uniform.
Included, is a screenshot showing the artifact.  There is another portal to the sector between the two "houses", it is located at the height of the roofs and stretch from the front to the back of the houses.  There is no artifact visible on this second portal in the included screenshot, but it can be visible from other positions.
If you know how to solve this, please tell me.

Thanks for your help

* portalartifact.png (90.04 KB - downloaded 223 times.)
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: August 24, 2005, 02:51:36 pm »

Hello,
    I have been creating a small test map.  However, I noticed some bug.  When two portals are pointing to the same sector, and both portals are visible in the screen, a weird visual artifact sometimes appear "on" the portal, depending on your position.  I have tried using no clipping, software clipping, hardware clipping and stencil clipping, but the result is always the same, except with stencil clipping, where the artifact is always uniform.
Included, is a screenshot showing the artifact.  There is another portal to the sector between the two "houses", it is located at the height of the roofs and stretch from the front to the back of the houses.  There is no artifact visible on this second portal in the included screenshot, but it can be visible from other positions.
If you know how to solve this, please tell me.

Thanks for your help

It would help if I could see the world file for this. Will be easier for me to find out how to solve this.

Note that you shouldn't exagerate with portals. Seems that in this simple case this level shouldn't have portals at all.

Greetings,
Logged
dominic
Newbie
*
Posts: 25


View Profile
« Reply #2 on: August 24, 2005, 03:59:39 pm »

It would help if I could see the world file for this. Will be easier for me to find out how to solve this.

Note that you shouldn't exagerate with portals. Seems that in this simple case this level shouldn't have portals at all.

Greetings,
There are no map files to be shown, it's a procedural map.  I know portals should be use with moderations, but I guess much more detailed maps that would need more portals would show the same issues.
The roofs of the all the houses is one big sector going from the roofs to the upper limit.  The camera is in this sector in the screen shot.  There is one big sector in front of the houses from the ground to the height of the houses.  There is another similar sector in the back of the houses.  Finally, there is a sector between each houses from the ground to the eight of the roofs and from the back of the houses to the front.  This sector repartition was an attempt to use the houses as "occluders".  I know it's useless with this level of details, but on a "real" map it would probably help.
Also, I can't allow a sector to be in part or in whole inside an other sector in my game.  I want to create 100% destructible environments.  So the exerior can't be one big sector and the interior of the houses separeted in more sectors.  If that was the case, a hole pierced on both side of the house would probably cause problems.  If the camera was in the exterior sector and looking through the holes on both side of the house, it would see a portal that points from inside of the house to the exterior sector, causing the exterior sector to be drawn twice.  That would probably cause similar graphical glitches.

Thanks

--== Edited ==--
I just made a little test.  It does not matter wheter the two portals pointing to the same sector destination are inside the same source sector or not.
« Last Edit: August 24, 2005, 04:10:35 pm by dominic » Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #3 on: August 24, 2005, 04:57:41 pm »

Hmm... I need something to reproduce this. Do you have reproducable code I can insert in simple1 for example?

Greetings,
Logged
dominic
Newbie
*
Posts: 25


View Profile
« Reply #4 on: August 25, 2005, 01:30:24 am »

Here is the code I use.  I warn you, it's incomplete, ugly, and has lots of "holes" in the geometry.  I hope I changed all the variables names correctly to make it fit in simple1.  I also found something out, it seems to be a clipping problem.  Some portals do not clip when you view them from some positions.  It's easy to see if you go over the roofs.  If you comment one of the portals in between the houses, you will be able to see it very clearly.
Whatever I set Video.OpenGL.ClipRequired, Video.OpenGL.ClipOuter and Video.OpenGL.ClipOptional to, it happens.  (by the way, how do you tell the engine what is the "type" of a portal ?  I have been looking all over the API for that.)  It does not seem to happen in software rendering mode (it happens in software clipping mode under OpenGL).


* brokenPortalsExemple.txt (28.21 KB - downloaded 165 times.)
« Last Edit: August 25, 2005, 01:33:33 am by dominic » Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #5 on: August 25, 2005, 07:09:52 am »

Here is the code I use.  I warn you, it's incomplete, ugly, and has lots of "holes" in the geometry.  I hope I changed all the variables names correctly to make it fit in simple1.  I also found something out, it seems to be a clipping problem.  Some portals do not clip when you view them from some positions.  It's easy to see if you go over the roofs.  If you comment one of the portals in between the houses, you will be able to see it very clearly.
Whatever I set Video.OpenGL.ClipRequired, Video.OpenGL.ClipOuter and Video.OpenGL.ClipOptional to, it happens.  (by the way, how do you tell the engine what is the "type" of a portal ?  I have been looking all over the API for that.)  It does not seem to happen in software rendering mode (it happens in software clipping mode under OpenGL).



Ah you are still using Old Renderer! That explains it. That's a known bug. It is recommended you move to the new renderer or preferably even to the CVS version of CS. The bug is fixed there.

Greetings,
Logged
dominic
Newbie
*
Posts: 25


View Profile
« Reply #6 on: August 25, 2005, 01:27:53 pm »

Is there a way to know what renderer CS was compiled with ?  I have compiled it with Gentoo's Portage.
Will these artifacts still happen with no clipping mode or is there a mecanism to prevent polygons from being rendered twice ?

Thanks
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #7 on: August 25, 2005, 02:31:02 pm »

Is there a way to know what renderer CS was compiled with ?  I have compiled it with Gentoo's Portage.
Will these artifacts still happen with no clipping mode or is there a mecanism to prevent polygons from being rendered twice ?

Thanks

I have no idea what gentoo's portage did but I strongly recommend to upgrade to the CVS version of CS. The CVS of CS is a lot more stable then 0.98 now.

Greetings,
Logged
dominic
Newbie
*
Posts: 25


View Profile
« Reply #8 on: August 25, 2005, 03:01:08 pm »

I have no idea what gentoo's portage did but I strongly recommend to upgrade to the CVS version of CS. The CVS of CS is a lot more stable then 0.98 now.

Greetings,
Ok thanks.  I usually don't use unstable versions, but if you tell me it's more stable than 0.98, I will give it a try.  Does the CVS version compiles with the new renderer by default ?
Also, by the way, how do you tell CS what is the type of a portal, I just can't find it in the doc, I even did a "search for files" for files containing outer or cliprequired of floating on the API doc.

thanks
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #9 on: August 25, 2005, 03:04:21 pm »

I have no idea what gentoo's portage did but I strongly recommend to upgrade to the CVS version of CS. The CVS of CS is a lot more stable then 0.98 now.

Greetings,
Ok thanks.  I usually don't use unstable versions, but if you tell me it's more stable than 0.98, I will give it a try.  Does the CVS version compiles with the new renderer by default ?
Also, by the way, how do you tell CS what is the type of a portal, I just can't find it in the doc, I even did a "search for files" for files containing outer or cliprequired of floating on the API doc.

thanks

The old renderer is removed from the CVS version. So there is only the new renderer.

What do you mean by 'type' of portal? There is only one type.

Greetings,
Logged
dominic
Newbie
*
Posts: 25


View Profile
« Reply #10 on: August 25, 2005, 03:08:02 pm »

In opengl.cfg, there are mentions of three types of portals, depending on the type of clipping required :  Video.OpenGL.ClipRequired, Video.OpenGL.ClipOuter and Video.OpenGL.ClipOptional.

thanks
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #11 on: August 25, 2005, 03:20:42 pm »

In opengl.cfg, there are mentions of three types of portals, depending on the type of clipping required :  Video.OpenGL.ClipRequired, Video.OpenGL.ClipOuter and Video.OpenGL.ClipOptional.

thanks

That's only for old renderer. It is no longer relevant with new renderer. Don't worry about it.

Greetings,
Logged
dominic
Newbie
*
Posts: 25


View Profile
« Reply #12 on: August 26, 2005, 01:24:11 am »

I tried the CVS.  Now the artifacts on portals are completly gone and there is a noticeable increase in performance, around 20 % (!).  I could notice trough some of the holes in my unfinished world geometry that sometimes clipping is not performed, but it doesn't seem to cause any problems anymore.

Thanks a lot.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 6.226 seconds with 14 queries.