• Content count

  • Joined

  • Last visited

Community Reputation

240 Neutral

About fread

  • Rank
  1. hi guys I'm looking for best free SVN server, but private so guests cannot view the code. something like "dropbox" but for SVN and more free space (at least 5GB+) anyone knows such sites? thanks in advance
  2. thank you guys, i managed to fix it, but when rendering cubemap with shaders (texCube stuff) the corners of my skybox are "cut off". They are black, while the rest of cubemap is drawn valid. What's wrong?
  3. Hiho I have six 512x512 RGBA images loaded in memory. I want to create a DirectX9 cubemap Here's my code: why is it failing? IDirect3DCubeTexture9 *tex; HRESULT hr = pDev->CreateCubeTexture(512, 1, D3DUSAGE_WRITEONLY, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &tex, 0); if(FAILED(hr)) {         // i think im ggetting error here           // ERRROR output } for(int i = 0; i < 6; i++) { LPDIRECT3DSURFACE9 face; hr = tex->GetCubeMapSurface(_D3DCUBEMAP_FACES(D3DCUBEMAP_FACE_POSITIVE_X+i), 0, &face); if(FAILED(hr)) {         // ERRROR output } D3DLOCKED_RECT rect; hr = face->LockRect(&rect, 0, 0); if (FAILED(hr)) {           // ERRROR output } CopyRGBAPixelsTo(i,rect.pBits); hr = face->UnlockRect(); if (FAILED(hr)) {           // ERRROR output } }
  4. Okay guys, I'm almost ready with the implementation of this technique, but I have one problem. How to setup the projection (ortho) and view (??) matrix of directional light for a given scene bounds? let's say my scene mins are (-100, 0, -100) and maxs are (100,50,100). How should I setup the light matrices? I've already done spot and point shadow mapping, but the directional one is still bothering me ;s thanks for any tips!
  5. Hi guys i've been wondering how to do source engine - like shadows in opengl? I mean, they are always showing a single shadow map style shadow for each character, even if there several lights in the scene. How are they creating it? I've tried to limit my character shadow only to nearest light, but it's "jumping" in a very annoying way. Are they using some kind of interpolation? how do they determine the light/shadow view pos/projection? anyone have any ideas? thanks in advance
  6. hi guys, I need to fake a skydome behaviour in GLSL. I have viewer position (obviously), vertex position, etc, and a single skydome texture (NOT a cubemap, single 2D texture) How can I calculate texcoord so my polygons looks like sky? thanks in advance,
  7. Drastic performance loss

    I guess that integer image coordinates are not supported by GPU and they are convertex to floats on the way
  8. I'm having similiar troubles as you. I think the topic is covered in GPU gems, but that's not much.
  9. hi guys, I'm looking for fast matrix4x4 per Vec4/vec3 multiply. It might be an SSE code or something like this. Would this bring a big speedup to my C++ code? Can anyone help me? Thanks in advance.
  10. It happens only if I enable a shadow mapping.   And I read that: buffer object = frame buffer. currently maped = frame buffer bound for writing This ain't right?   So what is wrong, then? Why is cubemap sampler read giving me invalid operation error and strange shadows? If I comment out cubemap reading in lighting shader everything is OK. Any ideas?   EDIT: To put it straight, take a look:   this code causes this error: float ShadowMapValue = texture(Sampler_ShadowCubeMap,Vec3ShadowDir).x; and this code works OK: float ShadowMapValue = 1.0; //////////*texture(Sampler_ShadowCubeMap,Vec3ShadowDir).x;*/ so something must be related to "texture" function call and Shadow CubeMap sampling
  11. Thank you for pointing this stuff, but my shadows still aren't working. I think I cleared error flag before glDrawElements, I am calling glGetError very often. Anyway, here is the entire log of my OpenGL calls, starting from unbinding the FBO (after I have drawn six views to it), and ending with gl error.   Please take a look:     EDIT: just note that my old code with the same shadow map cubemap code but for old openGL (without compatilibity mode) is working on the same PC...
  12. my code is pretty big and it worked in old gl mode. Then I ported code to GL 3,0 and I'm getting this error every glDrawElements call within the light pass. The scene is partially shadow correctly, and partially occluded in black. The depth values in cubemap are correct (I've tested them with glDebugger).   Here is my cubemap stuff: void CreateShadowMapCubeDepthFBO() { // Create the FBO glGenFramebuffers(1, &m_fbo); // Create the depth buffer glGenTextures(1, &m_depth); glBindTexture(GL_TEXTURE_CUBE_MAP, m_depth); for (int i = 0 ; i < 6 ; i++) { glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_DEPTH_COMPONENT32, size, size, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); } glBindTexture(GL_TEXTURE_CUBE_MAP, 0); glBindFramebuffer(GL_FRAMEBUFFER, m_fbo); for (int i = 0 ; i < 6 ; i++) { glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_CUBE_MAP_POSITIVE_X+i, m_depth, 0); } GLenum Status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (Status != GL_FRAMEBUFFER_COMPLETE) { // print stuff } glBindFramebuffer(GL_FRAMEBUFFER, 0); } void BindFBOCubeMapFace(int index) { glBindFramebuffer(GL_FRAMEBUFFER, m_fbo); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_CUBE_MAP_POSITIVE_X+index, m_depth, 0); } void StopUsingFBO() { for (u32 i = 0 ; i < 6 ; i++) { glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_CUBE_MAP_POSITIVE_X+i, 0, 0); } glBindFramebuffer(GL_FRAMEBUFFER, 0); }
  13. What? How? I didn't use it! I guess you must be right, now I'm gonna try...       i've tried that way, but it doesnt work: for (int i = 0 ; i < 6 ; i++) { glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_CUBE_MAP_POSITIVE_X+i, 0, 0); }
  14. Hi guys. I'm getting GL_INVALID_OPERATION when my depth cubemap is sampled in lighting shader. What's wrong? specs says that I didn't unbind the framebuffer before using it's texture, but I'm 100% sure that I did. Isnt "glBindFramebuffer(GL_FRAMEBUFFER, 0);" enough? I'd appreciate any help
  15. hello guys, I have drawn my scene to FBO and now I'm doing simple two pass blur (Horizontal And Vertical). Now I want to do the depth blur effect, but I do need a depth values in fragment shader. How can I access them? I am sending my screen texture (from FBO) to shader, is it possible with depth as well? I'll be thankfull for any tips :)