• Content count

  • Joined

  • Last visited

Community Reputation

670 Good

About JavaCoolDude

  • Rank
  1. Can't read stencil values in a shader

    It turns out ps_4_0 is just fine what happened though was when I switched to ps_5_0 I also started declaring my texture resource as Texture2D<uint4> instead of Texture2D<uint> and since the stencil value is stored in the y (green) component of the texture according to the DXGI_FORMAT_X24_TYPELESS_G8_UINT format, I was originally discarding it. Sigh!
  2. Can't read stencil values in a shader

    ps_4_0 dcl_resource_texture2d (uint,uint,uint,uint) t6 dcl_input_ps linear v1.xy dcl_output o0.xyzw dcl_temps 1 ftoi r0.xy, v1.xyxx mov, l(0,0,0,0) ld r0.xyzw, r0.xyzw, t6.xyzw utof, r0.yyyy mov o0.w, l(1.000000) ret vs ps_5_0 dcl_globalFlags refactoringAllowed dcl_resource_texture2d (uint,uint,uint,uint) t6 dcl_input_ps linear v1.xy dcl_output o0.xyzw dcl_temps 1 ftoi r0.xy, v1.xyxx mov, l(0,0,0,0) ld_indexable(texture2d)(uint,uint,uint,uint) r0.y, r0.xyzw, t6.xyzw utof, r0.yyyy mov o0.w, l(1.000000) ret
  3. Can't read stencil values in a shader

    What do you know, I just switched from ps 4.0 profile when compiling my shader to 5.0 and everything works as I would expect. Sigh!
  4. Hi, I am running out of ideas on why my stencil values aren't showing up in a test shader I wrote. I am using Windows 7 and a Radeon 5870. Setup code: // create texture D3D11_TEXTURE2D_DESC desc; desc.Width = width; desc.Height = height; desc.MipLevels = 1; desc.ArraySize = 1; desc.Format = DXGI_FORMAT_R24G8_TYPELESS; desc.SampleDesc.Count = 1; desc.SampleDesc.Quality = 0; desc.Usage = D3D11_USAGE_DEFAULT; desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_DEPTH_STENCIL; desc.CPUAccessFlags = 0; desc.MiscFlags = 0; HRESULT hr = d3d->CreateTexture2D( &desc, NULL, &m_DsTexture.m_Texture); D3D11_DEPTH_STENCIL_VIEW_DESC dsvd; dsvd.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; dsvd.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; dsvd.Flags = 0; dsvd.Texture2D.MipSlice = 0; VERIFY_HR( d3d->CreateDepthStencilView( m_DsTexture.m_Texture,// pResource &dsvd, // pDesc &m_DsWriteView )); // ppRTView // Create the shader resource view D3D11_SHADER_RESOURCE_VIEW_DESC descSRV; descSRV.Format = DXGI_FORMAT_X24_TYPELESS_G8_UINT; descSRV.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; descSRV.Texture2D.MipLevels = 1; descSRV.Texture2D.MostDetailedMip = 0; VERIFY_HR( d3d->CreateShaderResourceView( m_DsTexture.m_Texture, &descSRV, &m_DsTexture.m_View ) ); Shader code: Texture2D<uint> g_StencilTexture : MAKE_TEXTURE_REG( TEX_UNIT_BASE ); float4 PS_Stencil_Test(in PS_Tex0 input ) : SV_TARGET { // m_Tex0 contains unnormalized UV coordinates float4 sample = g_StencilTexture.Load(int3(input.m_Tex0.xy, 0)); return float4( !=, 1.0); } I did try clearing the stencil values to 0xFF hoping to obtain a white color output but still no luck! I modified the code and I got it to show depth just fine but stencil is failing me badly. Abdul
  5. Second vote for FreeType; I used the library a few days ago and create a platform-independant text rendering class that produces high-quality text at extremly high-frame rates =-) It was also fun playing around with procedural italic, bold, italic-bold, shadowing, outlining etc =-) Two thumbs up for FT from me.
  6. Since I wrote that demo for NVIDIA, let me answer your question: Your video card basically lacks support for vertex and fragment (pixel) shaders which happen to be required for the demo to run. Can you please post the content of the log file here? Thanks =-)
  7. Update

    Happy one year anniversary man, it's crazy looking back at how time flies by; I remember getting into NVIDIA at the same time you were leaving, I can't believe it has been a whole freakin year =-/
  8. OpenGL SXML GUI

    <TextureRectangle x = "71" y = "57" z = "159" w = "0" /> The x y z and w represent the boundaries of rectangular region on the texture sheet. (x, y) ______ | | | | ------ (z, w) If any of those values exceeds 1.0, it will be divided by the texture's edge size. For instance <TextureRectangle x = "71" y = "57" z = "159" w = "0" /> given a power of two texture of size 256 by 256 is identical to <TextureRectangle x = "0.27734375" y = "0.22265625" z = "0.62109375" w = "0" />
  9. Heap & Smoke

    The blast from the gun looks like it distorted the graphics behind it as if it was some heat haze effect :P
  10. OpenGL SXML GUI

    Sorry for the delay in responding; I am truly busy at work =-/ I will try and answer all of your questions tonight, promise =-)
  11. OpenGL SXML GUI

    Quote:Original post by frankmail007 JCD, thanks for your reply. I managed to compile it under mingw32 and I rewrite your sample with wxWidgets. It works fine except some minor issue for window resize. I modified a bit in MathUtils.cpp which seems use __asm which I don't know how mingw32 supports it. And I also modify some source code in your tool directory so glee,tinyxml and glpng will be compiled seperately. And finally I create a Codeblocks project to compile your SXML GUI as a library. By the way, can I use your library in a comercial software? Good job =-) Of course you can use it in a commercial software. =-)
  12. OpenGL SXML GUI

    You can set the position through XML via the Position tag: <Position x = "10" y = "10"/> Or if you wish to do so during runtime, you may use the GUIRectangle member function setPosition, just remember to set the update flag to true through the function forceUpdate. void mouseClicked(int button, int state, int x, int y) { button = (button == GLUT_LEFT_BUTTON ) ? MB_BUTTON1 : (button == GLUT_RIGHT_BUTTON) ? MB_BUTTON2 : MB_BUTTON3; MouseEvent event = MouseEvent(MB_BUTTON1, x, y, guiFrame.getHeight() - y); guiFrame.checkMouseEvents(event, (state == GLUT_DOWN) ? ME_CLICKED: ME_RELEASED); GUIRectangle *recPtr = guiFrame.getWidgetByCallbackString("Color Sliders Group"); if(recPtr) { recPtr->setPosition(x, y); recPtr->forceUpdate(true); } }
  13. OpenGL SXML GUI

    You know I have been meaning to include the licensing terms into the package for the longest time but I guess I am too lazy to do it :'( Anyway, it's the zlib license which could be found here.
  15. OpenGL SXML GUI

    Since I am the author of the said GUI package, let me answer some of your questions ^_^ 1-I have never tried compiling anything under MINGW32 but I know for fact that my sources files compile successfully under both Linux (g++) and Windows (Visual Studio). 2-SXML Engine was my first attempt at creating a rendering engine and it does indeed include SXML GUI, however I would recommend sticking with the stand alone GUI package rather then digging deep into the Engine because of comlpexity issues. You can grab the latest source files here.. Enjoy =-) PS: For further details look over here.