Supported hardware question

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

DaniJ
Posts: 130
Joined: Sat Oct 08, 2005 19:22

Re: Supported hardware question

Post by DaniJ »

Graf Zahl wrote:...I did some further tests with much more simplified data and shaders. It doesn't crash anymore but it exhibits some really odd behavior which looks like a driver bug....

4. Swap lines 12 and 13 in the shader (vec4 light =... and vec4 texel =...) and run again.

No matter what I do, I either get the texture data or the texture buffer data, but never both at the same time.
Are you doing this in a subroutine called from your shader main? If so, does the same occur if you inline that subroutine into main?

This does sound a bit odd but I must admit to only having limited working experience with shaders.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Supported hardware question

Post by Graf Zahl »

Actually, this is really just a very simple test shader. All it contains is this:

Code: Select all

#version 120
#extension GL_EXT_gpu_shader4 : enable
uniform samplerBuffer lightRGB;
uniform sampler2D tex;


void main()
{
	int index = int(clamp(gl_TexCoord[0].s, 0, 32.0));
*	vec4 light = texelFetchBuffer(lightRGB, index);
*	vec4 texel = texture2D(tex, gl_TexCoord[0].st);

	gl_FragColor = texel*2.0 + light/20.0;
}

The 2 lines marked with a * are the ones I am talking about. If I switch them around I get a different result. To be precise it's always only the data from the second call. If I add further sampler calls it's always the last one that gets displayed.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Supported hardware question

Post by Gez »

I tested it, after commenting out the EnableLight calls. The new code works for me, no bug, no crash, no different outcome depending on line order in main.fp. Also, no discernible difference when playing between old and new code.

Vista 32, Nvidia GeForce 9600m GT with those drivers and modded inf.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Supported hardware question

Post by Graf Zahl »

Damn. Can you make a screenshot of E1M1 right at the start? I'd like to see at least if it does what it should do.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Supported hardware question

Post by Gez »

Here are two screenshots, one with dynlights on and one with dynlights off. Based on r524.
Attachments
Screenshot_Doom_20091005_133138.png
Screenshot_Doom_20091005_133138.png (298.52 KiB) Viewed 1287 times
Screenshot_Doom_20091005_133022.png
Screenshot_Doom_20091005_133022.png (294.14 KiB) Viewed 1287 times
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Supported hardware question

Post by Graf Zahl »

In both the test shader is clearly not being used at all. Most importantly, if it is active you wouldn't see any dynamic lights.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Supported hardware question

Post by Graf Zahl »

I ditched the texture buffer approach because no matter what I tried, it didn't work. I found an alternative that seems to work fine.

Performance wise it's sometimes better and sometimes worse than the old method but the lighting looks a lot cleaner when done with shaders. Apparently the old light texture is not particularly good.

The best thing though is that the new method is capable of having final light levels that are greater than 1.0 which in many cases makes the lights look a lot better.

Essentially I have implemented most of the stuff I planned for the new renderer. It's really too bad that nothing of this proved to be a performance boost. I have stopped trying now. There's no point in optimizing the rendering code. Each cycle I manage to shave off the engine has to wait at the end of each frame so it's just shifting the time to another place and that's not worth investing work in.

So all that's left is clean up and add some options to GLDEFS to configure the new dynamic lighting method for different textures.
User avatar
StrikerMan780
Posts: 21
Joined: Fri Nov 23, 2007 10:11
Location: Somewhere in Cyberspace

Re: Supported hardware question

Post by StrikerMan780 »

GuntherDW wrote:Also, RT lighting would be somewhat hard to do in the DooM engine, which is utilising sector lighting and all.
I know I am gonna get shot by saying this, knowing they are two entirely different games, and engines altogether with only minor things in common... But, the Eduke32 devs managed to pull off RT Lighting (well, a mix between RT and Sector Light) in a game that uses Sector Lighting, via their new Polymer Renderer, which I do believe is purely shader-based, and runs on OpenGL 2.0. Looks quite awesome as well.

http://www.youtube.com/watch?v=z9nVuf6O ... r_embedded (Video)
Spoiler: Shot of Polymer
Last edited by StrikerMan780 on Sun Oct 11, 2009 21:35, edited 1 time in total.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Supported hardware question

Post by Graf Zahl »

Of course it can be done, with the appropriate time and effort. But that's not my goal - both for lack of interest and time.
User avatar
StrikerMan780
Posts: 21
Joined: Fri Nov 23, 2007 10:11
Location: Somewhere in Cyberspace

Re: Supported hardware question

Post by StrikerMan780 »

I am aware, and I respect that. I just figured I would mention that though.
Locked

Return to “GZDoom”