Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 18 Nov 2005
Offline Last Active Today, 12:01 AM

#5306785 Taxes management for flash games

Posted by on 19 August 2016 - 04:06 PM

If you sell a product in EU on your own, I believe you will have to collect VAT tax for the consumers country or yours.  If you are making a business deal with a company that is selling your product or paying you for a service, then no, you don't pay income tax in their country, just yours.

#5299387 Frame buffer speed, when does it matter?

Posted by on 06 July 2016 - 03:45 PM

It is always a spotlight and always used.....it's a computing system, it is always fetching memory. Not sure what you meant by frame buffer. FBO? If you want to see the performance impact of GPU Ram speed, then download a perfomance/OC tool and turn down the memory speed about 500Mhz while in a game and see what happens to the framerate.

If you are talking system RAM, then no that speed doesn't matter too much with interfacing to the GPU, at least if you look at low speed DDR3 vs high speed DDR3, the benchmarks I've seen might get 1 FPS cump from 59 to 60.

#5298637 shader problem in engine

Posted by on 30 June 2016 - 09:25 AM


In the procedure of making a game, which part apply shader to models ?


You should be doing this at the art level. You need to assign specific shaders. For instance clothing pieces will have a specific clothing shader because it has very small cloth details and should have a detail texture.

#5298557 Dynamic Environment Cubemap

Posted by on 29 June 2016 - 03:18 PM

I've had issues before either in the rendering or the reflection vector.  I suggest using a sphere to debug.


In my current shader, I have to flip the x-axis of the reflection vector: texCube(envMap, vec3(refVec.x*-1, refVec.y, refVec.z) ). Pretty sure that is just an issue with my current code as I dont recall doing that before.  But I've had issues where I had to convert the vector from GL to DX coordinates because the cube map is stored in directX coordinates most likely. So try flipping y and z, and/or negating one of those after flipping.


aside from that, you could also be potentially rendering to the wrong cube face on accident or using the wrong view matrix to render to the face.



vec4 R_World = inverseView * vec4(R, 0.0);


You could also using an interpolate/varying of the world eye/camera and get rid of the matrix multiply in the pixel shader.

#5298384 Proper billboarding/impostors for asteroids fields, where object instances ar...

Posted by on 28 June 2016 - 08:12 AM


Out of curiosity, how is it done in 3D to know when you reach a time when extra details adds too many burden and steals an unacceptable amount of cycles


When you are writing the same pixel over and over (meaning you have an asteroid behind an asteroid behind an asteroid and if you draw in reverse order it will continually update the same pixel), or you have very tiny triangles. If you have triangles that are 1x1 pixel or so, then it will chew up performance. Pixel shaders run on 2x2 blocks of pixels for mip mapping reasons so if you have a bunch of tiny triangles it causes a ton more work at a single pixel location.


In the case of an asteroid field, most of the screen isn't going to be drawn, just a bunch of small/fairly small asteroids, that is why you want to LOD down to like 20 verts or so because you don't even know the difference at that far away. You can't make out much geometric shape.

#5298340 Proper billboarding/impostors for asteroids fields, where object instances ar...

Posted by on 28 June 2016 - 12:44 AM

If you are using instancing, that is 10 different models, so only 10 draw calls. So how many models do you have? What is the vertex count?  Why not LOD the asteroid geometry into 1 or 2 more LOD levels. If you are using displacement mapping then LOD geometry is as simple as a sphere with less subdivisions.


If you really wanted to get fancy, those 10 draw calls could be reduces to 1 if you are passing per object matrices and per object id's in range 1 to 10. In the shader you can use a texture array and use the id to look at a certain displacement map. (Not sure if texture arrays are supported in vertex shader but they probably do in the modern feature set).


Regardless, how many triangles are you pushing? I would think it would be much simpler to just LOD until performance is good (you could get it down to probably 20 verts per asteroid). You should easily be able to push a million verts which would be 50,000 asteroids above 60fps.

#5298163 Help with PBR implementation

Posted by on 26 June 2016 - 05:46 PM

Don't have the time to look through all your code. From the images though it looks like you have only applied specular. Where is the basic diffuse ( dot(normal, light) )?.  In using a cube map you would get the diffuse term by mip mapping the cube map and using the normal of the surface to look up into the cube map at the lowest mip (1x1 for each face). The downsampling gives you the average of light in a hemisphere, which is what diffuse is. The sum of all light that can hit the surface and bounce back.



finalColor.rgb = lerp(finalColor.rgb, litColor.rgb, schlickFresnel);


Your last line looks fishy. Fresnel is the amount of specular, and specular should actually get added on top of the diffuse.

#5297649 Anyone used UVAtlas?

Posted by on 22 June 2016 - 07:01 PM

1.) No idea what you are talking about. Is this a tool that generates uv lightmap coordinates? It returns more vertices because it is splitting vertices.


2.) You can always unwrap and bake models individually. I use blender to model and export and generate a set of UV's for AO maps. I bake the maps in blender using those uv's.

#5297008 Artefacts in triangle mesh

Posted by on 17 June 2016 - 01:48 PM


Isn't the whole point of smoothing groups so you avoid having to manually create an edge loop though? Note I've only used blender, and 'make sharp' on an edge does (I think) the same thing, it internally forces a duplicate of vertices on edges so they can have different normals and not share the same normal.


Well for one, he didn't say he was going to bake normal maps, and I don't bake normal maps all the time for every object in my game. For a cartoony looking game like zelda wind waker or so, you wouldn't need normal maps in your entire game really.

Sub-surface division will take a quad and split it into 4 quads down the center. It doesn't make edges sharper.  The "make sharp" on an edge I believe is a feature to lock the edges from moving during sub-dividing. (IE  make a cube in blender and apply sub-division, it will warp the cube into a sphere, instead of just making the edges stay and subdivide around them).  I always manually put edge loops around my models, more control and doesn't add more than a minute of work. But also, as said if I don't intend to use a normal map at all or at some far away LOD, then I need those loops in the low-poly, not just the high poly, otherwise I will get artifacts like this guy.

#5296922 Artefacts in triangle mesh

Posted by on 17 June 2016 - 01:32 AM

For one, this is why we have normal maps. You can bake nice normals at a super high poly resolution. Your real issue is just not enough edge loops.


Anytime you have a vertex that is on an edge that is 90 degrees, or close to it, you need to create loops around it, otherwise it is interpolation lighting over such high angles. Also, this is why you usually apply sub surface division and then back normals onto low poly meshes. For this same type of reason. More polys = better surface representation and lighting.


#5296249 PBR Shader

Posted by on 12 June 2016 - 03:14 PM

Metals do not diffuse light. All metals and plastics have roughness from 0 to 100%. There is no good # , just one that matches the surface you are trying to mimic.

#5296170 CreateWindow limiting to 2560x1440

Posted by on 11 June 2016 - 10:06 PM

I turned my dpi scaling down to 100% from 150% in system settings and things adjusted according, now how do I deal with this when windows dpi scaling is on?

#5295632 Computing Matrices on the GPU

Posted by on 08 June 2016 - 09:48 AM

I don't have experience doing this on the GPU but are you currently threading your work on the CPU. 100 objects doesn't seem like much.

#5294698 Having trouble using glGetTexImage with a depth texture of an FBO

Posted by on 02 June 2016 - 01:37 PM

Make sure m_TextureID is valid at the time you call getTexImage. You could try creating a 2D texture right before and calling getTexImage on that instead. Are you sure that the texture is filled with data, try glTexImage2D() before getTexImage. See if TexImage2D fails as well.

#5292835 OpenGL Fonts Tip

Posted by on 22 May 2016 - 01:57 AM

I went back into my old font code which is from the old NEHE tutorial years ago. I finally had the need to support multiple fonts because I actually want to release a game. I'm using wglUseFontBitmaps and CreateFont.


Anyway maybe someone will stumble upon this and help them down the road but it took me a while to figure. The tutorial was using ANSI_CHARSET instead of  DEFAULT_CHARSET, so 99% of the fonts I used seemed to not work at all. For instance webdings wasn't showing symbols but was printing like a normal font.

font = CreateFont(  -1*fontSize,