Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 18 Nov 2005
Online Last Active Today, 05:29 PM

#5228382 I'm having trouble attracting contributors to my project as it gets older

Posted by dpadam450 on 11 May 2015 - 10:28 AM

Didn't read all the responses since I didn't want to spend a lot of time on this topic:


People that have experience, simply don't like joining projects . We all started trying to make projects at the start and they always fail. As you grow you realize it is hard to actually find the right people to work together for no pay and with good experience. This is why new projects are usually a few guys who know each other that decide to go full-time to work on a game project / new company.


I would look at what it will take to get to the finish line. Put a spreadsheet of everything you can think of and put hour estimates and add them up. See how much time you work in a week etc. It is something that sounds like you don't have and are just aiming at random goals, there has to be structure in the project.

I didn't get to click the link since my work blocks game websites, but I'm assuming the quality isn't enough to get a kickstarter/donations page...? After 4 years if you don't have at least half the game done, then I would suggest letting it die. It relieves  a lot to just let it go and start fresh. I've done it many times.

#5228016 3D Texture upload fails

Posted by dpadam450 on 08 May 2015 - 04:04 PM

What is the format of the file you are loading in? Have you made sure that data is loaded correctly before going to the GPU? Is it actually a file format of unsigned shorts?


What happens if you do color = volValue*10 .......are the pixels actually different? Do they resemble the shape of a ct scan or just junk data?

#5227999 Back Face Culling idea

Posted by dpadam450 on 08 May 2015 - 01:55 PM

I had this idea years ago:

Normal back face culling is calculated once a triangle's points have been transformed, the cross product is taken from the order of the vertices and then it checks the sign-bit of the resultant vectors z-axis.

Why don't we instead pass in the view vector in model space (this would only work for non animated objects), perform the same cross product to get the triangles facing direction, and perform a dot(modelSpaceView, triangleDirection).


This way you don't have to transform half of your vertices before actually realizing the triangle is facing the wrong direction. Any issues with this? It would save lots of multiplications and additions...

#5224019 Normal Map Generator (from diffuse maps)

Posted by dpadam450 on 17 April 2015 - 11:46 AM

I mean take your brick texture and manually create a height map like this so the line parts have no height and the other parts have height:

The other ones do whatever you want. Again If you have a concrete diffuse, take a separate concrete texture and generate a normal map. This way you have normal map data that doesn't correlate to where there is already contrasted diffuse data.


A good example of how NOT to do it:



See those dark dirty lines? If you just grayscale that image for a height map and then normal map, it thinks that those dirt parts are actually height differentials and then makes contrasted normals around those areas. The result: all those darkened dirty lines just get darker and when lit, it won't really look like it is lit because it's already dark and contrasted along all those pixels.

#5219351 OpenGL FrameBuffer Object(FBO) issues

Posted by dpadam450 on 26 March 2015 - 10:12 AM

I'm not familiar with with the latest openGL. is GL_BGRA a valid format? Try GL_RGB, GL_RGBA  it may be stricter than that where you need GL_RGB8/GL_RGBA8.

#5219345 Skeletal animation issues

Posted by dpadam450 on 26 March 2015 - 09:53 AM

I think the baked version he is suggesting that those are the final outputs of what the bind pose should be (not going through skeletal animation).
Easiest way to debug is to set all your bones to the identity matrix and verify that through animation, your output is the bind pose.

Once you have this, manipulate a single bone matrix. Rotate it a couple degrees but don't animate it every frame.

#5217223 Normal Map Generator (from diffuse maps)

Posted by dpadam450 on 17 March 2015 - 06:23 PM

I would take the diffuse, block out the "lines" parts in black, the other parts in white. Potentially do a guassian blur depending on how smooth I want the edges of the block pieces. This will be my height map for a normal map. Generate the normal map


This could work as is but if you want micro detail normals, we can then go and find maybe a plain looking photo of some concrete and create a normal map from it that has those tiny details and overlay/merge them together with the previous normal map.


Then for specular I would go find another concrete texture, convert to black and white, play with the contrast/brightness and try it out. Sometimes you may actually want parts of the diffuse in the specular, sometimes you don't.


Now with your method, if you have a brick texture, you can't change the height of the bricks. You will only get a 1 pixel differential when creating the normal map from the brick part to the "lines" part. The algorithm will simply say thats a red pixel thats a white one, ok done. 


Again with any other concrete textures that are say white concrete with some dirty parts. The dirty parts will get normal mapped. That doesn't make sense and doesn't look good. The contrasting grime will generate different normals even though the surface hasn't changed just because of some dirt or leaking rust etc. So again just source a completely different concrete texture and generate a normal map from it. Using 1 image for all 3, you just get normals among the contrast in the diffuse, and it just never looks quite eye-popping.

#5216841 Normal Map Generator (from diffuse maps)

Posted by dpadam450 on 16 March 2015 - 08:20 AM


I'm making a commercial game


Then you should definitely swap a couple normal textures in game to see the difference it makes when sourcing different images, whether for this project or the next. It is a huge difference. I've never had a good result doing what you are suggesting, even though I did it for a while too.

#5216153 Normal mapping on flat water surface produces incorrect specular highlights

Posted by dpadam450 on 12 March 2015 - 04:04 PM

Your vertex shader looks odd.
Each triangle should have a tangent space vector and a normal vector (in model space).

Those vectors get multiplied by the model or modelview to get them into world space or camera space, depending on where you are performing your lighting.

Your vectors from the normal map are already in tangent space (they are relative to your TBN vectors).


So it should be
vec3 normal = modelviewmatrix*normal;

vec3 tangent = modelviewmatirx*tangent;

vec3 biTangent = modelviewmatrix*bitangent;


You have now put the NTB vectors from model, to world, to camera. Your light is probably in world space? so you need to get it into camera space so that all 4 vectors are in the same space to describe each other (so you can describe the light relative to the TBN)

vec3 lightVecView = viewmatrix*light;


vec3 lightVecTangentSpace = TBN*lightVecView;
For this line I usually just take the light as :  dot(lightVecView.x, tangent), dot(lightVecView.y, biTangent), dot(lightVecView.z, normal)

// so this is wrong, the inverse of the model matrix will put the normal from the exported space and rather than apply the world matrix to put the vectors in the world, you are putting them into some unknown 3d space from what I can tell.
mat3 normalMat = transpose(inverse(mat3(model)));


//as long as sun.Position.xyz is in camera space and the TBN vectors are in camera space, OR they are both in world space, you are fine.
mat3 TBN = transpose(mat3(t, b, n));
TangentFragPos = TBN * FragPos;
TangentLightDir = TBN * sun.Position.xyz;
TangentPlayerPos = TBN * playerPos;

#5214988 Mipmaps with multiple texture arrays

Posted by dpadam450 on 06 March 2015 - 12:11 PM

All texture parameters need to be set for the current bound texture. You can also change them at run time.


Also, you may want to turn on anisotropic filtering for some nicer results. Something you can change at run-time with the click of a button to see the change. 2,4,8,16 you can set it to. Will drop your performance a bit. I use 8.0 most of the time.

GLfloat fLargest;

#5214890 Mipmaps with multiple texture arrays

Posted by dpadam450 on 05 March 2015 - 11:10 PM

MipMapCount = log((double)TextureSize) / log((double)2);
This will calculate the mip map level given an input "texturesize", so you don't have to hard code it.

#5214889 Mipmaps with multiple texture arrays

Posted by dpadam450 on 05 March 2015 - 11:05 PM

    glTexStorage3D(GL_TEXTURE_2D_ARRAY, numDiffuseMipMapLevels, pixelFormat, TextureSize,TextureSize, textures.size());

mipLevelUploading = 0;
//loop through 'i' textures

glTexSubImage3D(GL_TEXTURE_2D_ARRAY, mipLevelUploading, 0, 0, i, diffuseTextureSize, diffuseTextureSize, depth, pixelFormat, GL_UNSIGNED_BYTE, texture->pixels);

That's my code and this is called about 8 times back to back uploading all my texture arrays.


Maybe your glTexStorage3D call isn't factoring in mip maps properly?..........aha scrolled up,:

glTexStorage3D(GL_TEXTURE_2D_ARRAY,11, GL_RGBA8, 4096, 4096, 1); <-------------------13 mip maps, not 11

#5214883 Mipmaps with multiple texture arrays

Posted by dpadam450 on 05 March 2015 - 09:44 PM



Is this called before or after the image loading calls? I forget if it should be before or after.


"The only thing that really affects things is whichever array is loaded first is the one with issues."


Just to be clear. If you bypass loading the second image, the first image will is completely fine?  And when you tested your texture arrays being applied, did you still load both, but only bind one during drawing? Since it obviously sounds like a loading issue, just wondering  if you still loaded them both.


Have you tried gDebugger to see if it says your texture arrays are mip-mapped. You can also use the texture viewer to see what they hold.

#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.