Gamestudio Links
Zorro Links
Newest Posts
FXCM demo test failed
by qin. 01/13/26 13:53
Camera always moves upwards?
by NeoDumont. 01/12/26 09:39
Alpaca Plugin v1.5.2 Release
by kzhao. 01/11/26 13:42
Alpaca Plugin v1.4.0
by kzhao. 01/11/26 13:38
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 5,207 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
promfast, joe_kane, Namitha_NN, Syndrela, agasior
19190 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
high view resolutions failing on F5 #319208
04/13/10 02:45
04/13/10 02:45
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
G'day!

I'm using the latest private beta 7.84 (Pro) on Windows 7, but I have no reason to believe this wasn't happening in the public beta either -- I've only just started this project today.

This afternoon I adapted the shader workshop's shadowdemo to use CSM, and encountered an issue with bmap_zbuffer or video_switch. Basically, when I change resolution, any view that had a large render target gets its resolution reduced.

I went back to the original shadowdemo.c to reproduce the problem without all the other changes I made:

In order to increase the resolution of the shadows I changed "bmap = "#1024x1024x14;" in the viewDepth definition to "bmap = "#2048x2048x14;".

In between the 2nd and 3rd lines in main() I added:
Code:
bmap_zbuffer(bmap_createblack(2048, 2048, 32));
viewDepth.size_x = 2048;
viewDepth.size_y = 2048;



Now when I run the demo the shadows look a lot more crisp, indicating that it works. Move the camera relatively close to the shadow so that you can see the aliasing of the shadow, and then hit F5 to change the resolution -- the aliasing becomes significantly worse, as if the shadow map is now a much lower resolution.

I added
Code:
DEBUG_VAR(bmap_width(viewDepth.bmap), 100);
DEBUG_VAR(viewDepth.size_x, 130);

to see which one changes when I change the resolution, but neither one does.

I searched the forum, and couldn't find anything about this.

Thanks,

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: high view resolutions failing on F5 [Re: JibbSmart] #319224
04/13/10 11:54
04/13/10 11:54
Joined: Jul 2000
Posts: 28,051
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,051
Frankfurt
I am pretty sure that you need to call bmap_zbuffer _after_ setting the video resolution. That means you call it always after F5, not before, otherwise the zbuffer size is reset to the selected resolution. But I'll look into this to make 100% sure.

Re: high view resolutions failing on F5 [Re: jcl] #319259
04/13/10 15:35
04/13/10 15:35
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Ah yes, I forgot to mention that I'd tried that.
Move this:
Code:
bmap_zbuffer(bmap_createblack(2048, 2048, 32));
viewDepth.size_x = 2048;
viewDepth.size_y = 2048;

into the while loop (not the most efficient solution, but should suit this purpose) and the problem is still there.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: high view resolutions failing on F5 [Re: JibbSmart] #319343
04/14/10 11:49
04/14/10 11:49
Joined: Jul 2000
Posts: 28,051
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,051
Frankfurt
Ok, I found the reason of the problem. Calling bmap_zbuffer in the loop didn't solve it because the values were always the same, so the engine didn't change its z buffer.

There are workarounds, but they are awkward. I'll change this for the upcoming update so that the engine creates a new z buffer automatically. Calling bmap_zbuffer or manually setting the view size won't be necessary anymore in that case.

Re: high view resolutions failing on F5 [Re: jcl] #319365
04/14/10 15:08
04/14/10 15:08
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Thanks jcl.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!

Moderated by  jcl, Nems, Spirit, Tobias 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1