Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, alibaba, Quad), 761 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
VIEW*: int format[4]; // target formats #422222
05/05/13 12:38
05/05/13 12:38
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Hi,

when no view->bmap is assigned, you automatically create a target bitmap in the size of the screen. So there is an engine-automatism, that re-creates view targets on screen resolution change. --- How about adding an array of four integers, which tells you the format of the user desired four target bitmaps?

So, if (view->format)[0] is != 0 and e.g. == 16, you take this value and create a floating point target instead, while view->bmap will be automatically created. The same for e.g. (view->format)[1], which is e.g. == 122 and leads to an automatically created view->target1 bitmap (2x16bit FP).

Because it is always a big mess to deal with this, this would be a great enhancement for developers who like to create complex shader chains smile What do you think?

Re: VIEW*: int format[4]; // target formats [Re: HeelX] #422241
05/06/13 09:27
05/06/13 09:27
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
If you need a particular target format, why not create it with bmap_create in sufficient size so that you don't need to recreate it when the resolution changes? This seems to me the logical way, rather than adding an array of formats to the view struct.

Re: VIEW*: int format[4]; // target formats [Re: jcl] #422273
05/06/13 19:11
05/06/13 19:11
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
A sufficient size so that I don't need to recreate it when the resolution changes would be the largest possible screen resolution... I don't think that this is a good approach smile

The idea with the target format array stems from the fact that you already recreate one 888(8?) target for views if the view->bmap is not set. So, for me it would be the next logical step to let the user give hints what format should be used by the engine. So, if the VIEW struct had a view->format attribute and view->format is != 0, this format would be used for the to-be-created render target (and stored in view->bmap). So if you just want to render the depth, it would be nice I we could set view->format to e.g. 12 or so. If view->format is != 0 and the resolution changes, the engine would then auto-deallocate view->bmap and recreate it with the given format (all pointers to view->bmap will become invalid then).

The next logical step would be then to extent this thinking to the remaining targets. That is, if the engine already auto-creates one (1) target, it would be nice, if the engine could do that in one step already for more than one target. That is why I suggested to use a format-array. It would be very easy to use and requires not so much changes in the engine code, I suppose.

Plus, all cumbersome approaches for auto-detecting resolution changes and complicated render-target recreation would vanish because the targets are changed engine-wise. I think this is a great idea smile

Re: VIEW*: int format[4]; // target formats [Re: HeelX] #422296
05/07/13 10:00
05/07/13 10:00
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Well, we think otherwise laugh.

The engine can not know the purpose of a view target and if, when, and how it must change its size. There are many different ways for view targets, and all must be handled specifically. That's why you have a script language. If you need a bitmap, create it. If you need to change its size, change it.

The engine does not create or resize bitmaps by itself. It only uses some fixed internal render targets for the screen buffers and the view chain. Creating and handling any specific view targets is up to the user. A "automatic" that resizes view targets behind the user's back, just for saving a few lines of code, would produce more problems than it would solve.


Moderated by  aztec, Spirit 

Gamestudio download | chip programmers | 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