Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 18 Nov 2005
Offline Last Active Yesterday, 10:15 PM

#5214878 Mipmaps with multiple texture arrays

Posted by dpadam450 on 05 March 2015 - 08:52 PM

Sounds like a potential state issue. What happens if you apply the same texture array to both objects? Have you tried rendering them as object 1 , then 2  and then 2,1 as well to see if it is always the second object, or if it is always that one specific object that won't work?

#5214816 Mipmaps with multiple texture arrays

Posted by dpadam450 on 05 March 2015 - 02:22 PM

So you have 2 separate objects. 2 texture arrays, and what appears to be only mipLevel 0 appearing on one, and any other further away smaller mips come out as black?


Have you tried changing the black object to not use a texture array and verify it is mip mapping correctly? Did you try calling glGetError() at any point? I recently had some issues with my texture array code and mip map generation and it caused the images to be all black. I can't remember the issue but I think you need to have your glTexParemeteri() setup for mipmapping before uploading your mip maps.

#5213995 GGX image based lighting - mipmap artefacts

Posted by dpadam450 on 02 March 2015 - 12:50 PM

You posted a bunch of random stuff and basically said "nothing I have works". Which is why I can't spend an hour decoding what is wrong. These issue have nothing to do with image based lighting really, just regular graphics/shaders.


Mip-Mapping: Have you tried manually sending mip map level , 0,1,2,3,4,5,6, etc instead of computing them as is just to make sure your mip-maps look ok? If so then a simple mathmateical linear scale factor of roughness in range 0 to 1, multiplied by the number of mip levels should work. If your skybox is your reflection map then the jump from level 3 to 4 obviously looks wrong.


White spots:? Debug your shaders. I'm sure you can figure out where they are coming from.


Specular: Your specular textures have a strange edge effect (though I didn't see a specific comment on this.) I assume that is the reflection amount calculated using a fresnel type shader? That specular output should be "reflectance" from what I can tell.


Throwing 10 images and all your shaders and saying "why does everything look bad", is not the way to solve a problem.  If this is supposed to be the standard left to right roughness/reflection and you are expecting shiny on the left and rough on the right, then it shouldn't be hard to pick apart these steps one by one and solve each problem 1 by 1.

#5212397 Designing a graphics programming portfolio

Posted by dpadam450 on 23 February 2015 - 12:11 AM

If you don't have any of the things on your list already, this could take a while to get to.

I wouldn't really count these as really anything. They are basics of the steps needed to learn, but those alone I wouldn't consider as anything on a resume. It shouldn't take you very long to get these things done. They are more complicated if you are writing all of the mesh loading and extracting tangent map data, and splitting vertices etc.


-Mesh Loading

-Gouraud Shading

-Phong Shading


-Texture Mapping


-Normal Mapping

-Cube Mapping


The thing with graphics programming or any game programming on a resume is more about presenting a fully workable system. If you want to do something with graphics, animate a bunch of characters in a busy city and have them with an avoidance system and make some shaders on some cars etc. Seeing something like this as opposed to a wall with tessellation applied or a demo of a single character animated in your code, is a big difference. Plan to build something that has a purpose. Find some free models, like from turbosquid or elsewhere and come up with an idea for a scene. If you have ever seen the nvidia demos when they release new graphics cards, they have small scenes with characters animated and some other background stuff going on.

#5208990 Bus Bandwidth

Posted by dpadam450 on 05 February 2015 - 11:00 PM

So I took my code into work which we have Nvidia 970's and my framerate was like 200FPS vs 88 FPS on my Radeon 7850


My card is fairly new but it seems like the newer cards should crunch some more performance in terms of the draw calls.

#5208798 Bus Bandwidth

Posted by dpadam450 on 04 February 2015 - 07:49 PM


Back when I first started openGL 8 years ago, I had the naive:



At the end of the day, you’re raising a fuss about immediate mode.  You may as well be stressing out over your 3dfx Glide performance or your Direct3D 6 performance.

Conversations about these things should not be happening today.  At all.



No I'm simply wondering why 100,000 glVertex3f() calls had almost no overhead 8 years ago, but my modern GPU completely dies when I call   glDrawElements 4,000 times. I have stripped the geometry and shaders, so its I'm literally not processing anything, and those 4,000 function calls KILL performance nowadays. So my question is.....why are the draw calls so expensive internally compared to say a state change glBind() or a glVertex3f() function?

#5201655 Crazy GLSL bug

Posted by dpadam450 on 03 January 2015 - 06:37 PM

Not sure how you are calculating specularFactor, but most of the time with diffuse/specular (well all the time really) you want to clamp your dot products between 0 and 1.

#5201555 Crazy GLSL bug

Posted by dpadam450 on 03 January 2015 - 11:05 AM

Update your graphics card drivers. Try having some input that starts the uniform at zero and if you press a button it increases it like .001 and see what happens over time with changes.

#5201383 scene graph render order

Posted by dpadam450 on 02 January 2015 - 02:51 PM

As few state changes as possible is best regardless of the operation. Loading a shader is going to be the worst because it has to copy the shader executable to each processor and if that is 50 lines of code it will thrash back and forth loading shader programs, rather than other calls that just change pointers to memory locations.


The final sub sort to apply to each of those prior sorts, would be the objects position. Render closer objects first so that you don't draw the same pixel and then paint another pixel on top of the one you just drew (overdraw).

#5201340 [GLSL] Prevent lights from casting onto shadows

Posted by dpadam450 on 02 January 2015 - 11:20 AM

I didn't read your original post that much: but it looked like your shader

"if(z > 0 && z < 1 && z < (shadowCoord.z /shadowCoord.w))"

Not sure why you have the 0 and 1 checks. You can set a GL_BORDER_COLOR (something like that syntax) that makes everything 1.0 for the shadow map and if you do clamp to edge, everything sampled outside the lights frustum will just return 1.0, if that is what your shader is trying to do.

#5200668 Blending problems on alpha enabled render target

Posted by dpadam450 on 29 December 2014 - 04:44 PM

Backbuffers don't need alpha channel support. Fragments of light (virtual or real) don't have any alpha component, just a color computer by traveling through, or bouncing off objects. Simply drop the backbuffers alpha channel support. You are drawing the bubble with some alpha data, and since that bubble is visible, you said that those pixels of the bubble have a certain alpha.  It simply writes that alpha to the backbuffer. Alpha blending doesn't actually need an alpha component to the back buffer, it computes "light fragments" by blending different alpha's of objects, but at the end of the day, our eyes don't have "alpha light" recepters, just light component (RGB).

#5183346 Rendered Object disappears under Perspective Projection

Posted by dpadam450 on 27 September 2014 - 02:46 PM

Your near plane is 1.0, your object is at 0.0    meaning it is behind your eyeball. Change your z = 0.0 for your verts to -10

#5183213 matrix/coordinates?

Posted by dpadam450 on 26 September 2014 - 03:53 PM

I skipped over your initial problem. If you are trying to render 2D with openGL  You dont want persepctive (which implies a 3D world) you want orthographic.


Should be a function something like that. Depth will still matter but you can work in 2D. Ortho(0,screenwidth, 0, screenheight)  <-- allows you to call glVertex3f() with 2d pixel coordinates + some z-depth.


With Ortho there is no perspective division to warp stuff away from the camera. The z value doesnt effect perspective, the input x,y  will be the output x,y

#5183182 Reading a texture inside if statement

Posted by dpadam450 on 26 September 2014 - 12:33 PM

No idea what either of you are talking about. You can sample a texture how ever you want whenever you want. Are you suggesting "stage3d" (no idea what this is), will not let you do it? If so then maybe that's a restriction on that language.

#5182711 Nvidia GI Hardware Support

Posted by dpadam450 on 24 September 2014 - 01:45 PM

I saw the Nvidia moon landing GI demo and the corresponding GI demo on the Nvidia youtube channel.


They mention this is coming with their new gpu, is this some hardware supported feature? Does anyone know how it will integrate with other software if that is the case?

Also, in the demo with the sphere, they show the voxel data. I'm assuming that the pixel shader performs a raycast into the voxel data to find the closest voxel? I've never messed with voxels before. I'm not sure how that works. Is the data on the gpu a 3d texture and it will just ray cast  from the fragments world position + normal until it hits a non blank texel in the 3d texture and then use that information?

If so, wouldn't that 3d texture be pretty big? for that small scene it looks like it is about 64x64x64 if it is a 3d texture. Maybe I just don't know enough about voxels. I remember the latest Crysis tech pdf mentioning their GI stuff. Were they doing the same type of thing then?