[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Thoughts on Stencil not working on NVidia

Thoughts on Stencil not working on NVidia

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Thoughts on Stencil not working on NVidia

Postby Baker » Thu Apr 09, 2015 11:13 pm

The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Thoughts on Stencil not working on NVidia

Postby Spike » Fri Apr 10, 2015 12:03 am

if glGetIntegerv(GL_STENCIL_BITS) is returning 0, then you messed up your context creation.
commonly your depth+stencil buffers are a single buffer 24.8.
of course, gl treats them separately which results in some fun...
some hardware actually supports 32bit depth buffers!...
but of course, depth+stencil buffer then means that this then means that you have 0bit stencil buffers.

so make sure you're actually requesting a stencil buffer at context creation.

that's my guess.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Thoughts on Stencil not working on NVidia

Postby Baker » Fri Apr 10, 2015 12:28 am

The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Thoughts on Stencil not working on NVidia

Postby mh » Fri Apr 10, 2015 12:11 pm

Modern hardware should be able to support 32-bit depth with stencil in it's own buffer, so it would probably also depend on which NV it was failing on.

In truth 24/8 is the format that's most likely to work on everything, so it's the safest default.

Another way of drawing sky is, IIRC, to draw all the sky polys with colormask 0 and depthmask 1, then draw a sky box or sphere with z-fail, depthrange 1,1 and depthmask 0, then draw everything else, which will ensure that sky is only where it should be. Z-fail is not particularly hardware-friendly though, but this way doesn't require stencil at all.

The best way is of course to just draw the sky polys in-place with a shader.
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: Thoughts on Stencil not working on NVidia

Postby Baker » Fri Apr 10, 2015 9:08 pm

I have the ability to draw mirrors, so I can't control when in the rendering it will draw the sky. At least not for the mirror.

And for fairness purposes, since I can't control when I draw the sky for the mirror, I made it so the sky gets drawn a bit later and should Z-fail to catch things like this problem without any rendering issues only cropping up when mirrors are visible (I mean, what uses mirrors? Nothing currently, hehe. :D So if I want the feature to work, I want the general usage of non-mirrors to fail so the mirrors feature can be trusted. )

There is the chance that I'm not zfailing the sky on NVidia somehow.

Because on bugged screenshots, the sky is stomping foreground brushes/surfaces.

I will find out what is doing this. Perhaps I may solve in the next 2 days. I mostly need to have the hardware available because every Windows and Mac I have is either ATI or Intel.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Thoughts on Stencil not working on NVidia

Postby ericw » Sat Apr 11, 2015 6:38 am

I have two laptops with NVidia (9400m, 650GT) I can offer for testing if you need it.

With the Dec 24 OSX build, sky looks fine, but if I set r_oldwater to 0, liquids are rendered solid white. Not sure if that is related or a different issue.
ericw
 
Posts: 92
Joined: Sat Jan 18, 2014 2:11 am

Re: Thoughts on Stencil not working on NVidia

Postby Baker » Sat Apr 11, 2015 6:54 am

The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Thoughts on Stencil not working on NVidia

Postby ericw » Tue May 19, 2015 7:22 pm

This was solved, right? Was it due to not clearing the stencil buffer at the start of sky drawing, or interference from the shadow code?
ericw
 
Posts: 92
Joined: Sat Jan 18, 2014 2:11 am

Re: Thoughts on Stencil not working on NVidia

Postby Baker » Wed May 20, 2015 1:00 am

The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Thoughts on Stencil not working on NVidia

Postby ericw » Wed May 20, 2015 2:22 am

ericw
 
Posts: 92
Joined: Sat Jan 18, 2014 2:11 am


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 2 guests