Jump to content

  • Log In with Google      Sign In   
  • Create Account

AlanWu

Member Since 03 Dec 2012
Offline Last Active Aug 15 2015 02:09 AM

Topics I've Started

Using OpenGL/DirectX to build GUI

19 June 2015 - 05:11 AM

Hey guys, I think using OpenGL/DirectX to build GUI is a very good idea because it has hardware acceleration and advanced graphical features, which can produce a dynamic and awesome-looking GUI. However I can't find many GUI engines that are based on OpenGL/DirectX. I searched about the disadvantage of using OpenGL/DirectX to build GUI and the two disadvantages I found is: The GUI that are based on OpenGL/DirectX bypass a lot of abstract layers and access graphics card directly, which can cause issues when trying to screenshot the GUI (or windows made by the GUI) by GDI. Also, usually a window is made up of a lot of child windows, e.g. button, edit box, etc. The GUI that are based on OpenGL/DirectX don't have any child windows so the layer is invisible to outside(other programs).

I think the screenshot problem can be solved by cooperate GDI into the GUI engine (probably use GUI to draw the buffer?). For not having any child windows, I personally think it has no problem and is an advantage since you don't want other program to analyze your GUI easily.

What do you guys think? Thanks!


Is OpenGL enough or should I also support DirectX?

18 June 2015 - 02:23 AM

I am planning to make a game engine. My target platforms are: android, ios, windows, mac, lunix.

OpenGL should be enough for all of my target platforms but is there anything I need to be aware? (Because I see some game engines support both DirectX and OpenGL while supporting only those platforms I mentioned above)

Thanks!


Computer Graphics: Question about viewing frustum

03 May 2014 - 05:58 PM

A viewing frustum is the region in the modeled world that you can see at different distances away from your eye. In other words, it tells what direction a light ray comes in will contribute the image.

Question:

Does it mean that if a light travels at a direction that doesn't fit the viewing frustum, the light won't contribute to the image? Will the light refract at the viewport of the viewing frustum just like light refracts at the surface of our eyes?

 

Thank you very much!


DirectX: Questions about Alpha blending !Help !

01 January 2014 - 04:39 AM

I have already post a topic in Game Programming plate and I don't think I can repeat a same topic. But I really need some help!!

Come here and help me!

http://www.gamedev.net/topic/651770-directx-questions-about-alpha-blending-help/

 Thank you very much!


DirectX: Questions about Alpha blending !Help !

01 January 2014 - 04:30 AM

Device->SetRenderState(D3DRS_ALPHABLENDENABLE, true);  //Open alpha blending
Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);  //Source factor
Device->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);  //Destination factor
Device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); //blending parameter 1
Device->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE); //blending parameter 2
Device->SetTextureStageState(0, D3DTSS_ALPHAARG0, D3DTA_CONSTANT); //blending parameter 3
Device->SetTextureStageState(0, D3DTSS_ALPHAOP,D3DTOP_MODULATE);  //parameter 1 times blending parameter 2
 
Question:
1. The factor D3DBLEND_SRCALPHA is (as, as, as, as). I don't understand why isn't it (rs, gs, bs, as). What does it mean by (as, as, as, as)? Does it use alpha value to displace other colors' values? I don't think it does. So what does it mean?
2. The factor D3DBLEND_SRCALPHA is (as, as, as, as). Does it blend any color channel or it just blend alpha channel?
3. What is separate blending?
4. Can I set my own blending factor for D3DRS_DESTBLEND and D3DRS_SRCBLEND?
5. I don't understand the calculation about D3DTOP_MODULATE. MSDN said arg1 multiply arg2 but how? My texture(D3DTA_TEXTURE) has a 255 value of alpha and the alpha in vertex(D3DTA_DIFFUSE) has a value of 255. How does it multiply to get 255 (cause the result is opaque)? Also, how do they multiply 64 by 255 to get 64? Any full calculation?
6. I want to multiply arg1, arg2 and arg3 together. I want to blend the alpha of my texture with the vertex alpha and the constant alpha. Can I do that?
 
Help!!!!
Also, thank you !!!!!!

PARTNERS