D3D to OpenGL

Started by
10 comments, last by TwilightShade 19 years, 6 months ago
Hi folks... first of all, im a noob concerning c(++), opengl, and so on, so plz be explanative ;) Im currently working on wine, an windows layer for unix (not an emulator), especially on the d3d8 implemention. As directx isnt available for unix systems the d3d function calls are simply mapped to opengl calls, eg d3drs_lineantialias is mapped to gl_line_smooth). Of course this isnt always that simple *sigh* ... My current targets are the d3drs_multisampleantialias and the d3drs_multisamplemask function calls. Googling around, i found jittering to be one method which could do that job. Would this be okay or is there a better solution? I thought of deriving it someway from this site. Thx in advance TwilightShade
-"What would you say to the kids of Columbine?"-"I wouldn't say a single word to them. I'd listen to what they had to say. That's what no one did."-Marilyn Manson
Advertisement
hrm... sorry this is more of a bump than anything, but i wouldnt reccomend doing jittering yourself... thats a waste of computation, i dont know what to say to do it... i guess the best way would be simply to learn the gl way, and do it with gl (even if just taht part) since its really using gl the whole time anyways (as truely using d3d and gl at the same time is a BAD idea, and not useful at all, if its even possible)

hope that helps
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Hmm, i guess i described it wrong... there isnt any d3d available at all, so all d3d calls are simply passed to opengl, but sometimes there is no function in opengl which matches the d3d function exactly. BTW, i thought jittering IS part of opengl? (was 100% sure about that... as mentioned earlier, im a damned noob :) ).
Okay, so how is it done the opengl way? How can i blur a full scene like multisampleantialias does?

Thx for the reply
TwilightShade
-"What would you say to the kids of Columbine?"-"I wouldn't say a single word to them. I'd listen to what they had to say. That's what no one did."-Marilyn Manson
Multisampling does _not_ blur the screen. It adds information to the screen.
Are you sure that you are up to the task if you don't even know what multisampling is?
LOL, im totally sure that im NOT, but thats the linux way, learn by doing and at this project every helping hand is needed. So tell me, IS antialiasing bluring or not? I only made a logical conclusion. BTW, i already did 2 such callpassings.
So, after discussing my skills, how can this be done?

Cheers
TwilightShade
-"What would you say to the kids of Columbine?"-"I wouldn't say a single word to them. I'd listen to what they had to say. That's what no one did."-Marilyn Manson
I'd help you out, if I knew jack about 3D stuff.

However, clickies on what the things he's trying to implement..

is this what you're talking about?
Quote:D3DRS_MULTISAMPLEANTIALIAS

BOOL value that determines how individual samples are computed when using a multisample render-target buffer. When set to TRUE, the multiple samples are computed so that full-scene antialiasing is performed by sampling at different sample positions for each multiple sample. When set to FALSE, the multiple samples are all written with the same sample value, sampled at the pixel center, which allows non-antialiased rendering to a multisample buffer. This render state has no effect when rendering to a single sample buffer. The default value is TRUE.

D3DRS_MULTISAMPLEMASK

Each bit in this mask, starting at the least significant bit (LSB), controls modification of one of the samples in a multisample render target. Thus, for an 8-sample render target, the low byte contains the eight write enables for each of the eight samples. This render state has no effect when rendering to a single sample buffer. The default value is 0xFFFFFFFF.

This render state enables use of a multisample buffer as an accumulation buffer, doing multipass rendering of geometry where each pass updates a subset of samples.

If there are n multisamples and k enabled samples, the resulting intensity of the rendered image should be k/n. Each component RGB of every pixel is factored by k/n.
Wow, you are a newbie and yet you are actually working on Wine, and adding D3D functionality.
You truly have my respect [smile].

I must say I dont really know what that function does but seems like there is plenty of Open GL Multisampling at google to check out.

if it has something to do with motion blur effects, then perhaps the Motion Blur example at game tutorials might help you too.

[edit] just found the ARB_multisample extension.
Yes, it is.

Well, when reading this (read it before) the first thing coming to my mind is jittering as the image is sampled several times, each time with some little difference in position, isnt it?
So, concluding from this, the multisampleantialias function would set the jittering value and the multisamplemask would control which value is aplied to which sample?
-"What would you say to the kids of Columbine?"-"I wouldn't say a single word to them. I'd listen to what they had to say. That's what no one did."-Marilyn Manson
@Kwizatz
Thx =) but i dont earn any congratulatories yet, my patches arent commited (and wont be until the wined3d lib is finished) yet! (dont want to be theatralic, even if it sounds so......... :/ )

Thx for your help, i think this is going to help a little :) (wondering why i didnt found this yet... :/ ) Motionblur belongs to somewhere else i think, but thx anyway!

BTW, the whole stuff isnt _that_ hard (you just need to understand what a call is good for ^^), just have a look at some scripts, etc (not necesseraly wine) and try to understand them!

Cheers
TwilightShade
-"What would you say to the kids of Columbine?"-"I wouldn't say a single word to them. I'd listen to what they had to say. That's what no one did."-Marilyn Manson
Well, best of luck!, and as a Wine user myself, thanks for your efford [smile]

This topic is closed to new replies.

Advertisement