Hot answers tagged

6

When a matrix is orthogonal, inverse and transpose are equivalent making an inverse transpose equal to the original matrix. So if your model view matrix is orthogonal, the normal matrix will be equal to it. As user41442 pointed out, in most cases modelview matrices are actually orthogonal so this can be a bit of a short hand. There's still cases where it's ...


3

You must configure GDX to use GL30 prior to calling functions on Gdx.gl30: config.useGL30 = true;


3

SurvivalMachine nailed one of your problems (you can see that the texture is repeated twice). Your other problem (the texture is a big blob instead of a crosshair) is because you don't use transparency : some of the completely transparent pixels of your texture have a green color value (that's a common sight with optimized PNGs). Just enable blending with ...


2

You can render a quad onto the framebuffer with a shader that will just set the color value to 1000.0. Since you don't even need to set a texture really let alone compute lighting, this should not really take any noteworthy time to accomplish. It's pretty easy to do but here is a tutorial that talks about rendering to a texture. Though really you don't ...


2

Changing shader properties for each camera You can accomplish this with a script on the camera. In my example I change the color but you can extend this idea to any property in the shader. [ExecuteInEditMode] public class CameraMaterialChanger : MonoBehaviour { public Color myColor; // color you want the camera to render it as public Material ...


2

This would depend on whether your game uses direct calls to the bindings or not. So if your library deals with all low level stuff itself, you build it, link to your game and you are good to go, no need for extra linking of GLFW, GLEW, etc. But going this way your game will not have direct access to the recources and functions these helper libraries give. If ...


2

Even though you are binding the textures correctly with glActiveTexture and glBindTexture you are not telling GLSL which sampler uniform goes to which texture. What you should do is this: glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, colorBuffers[0]); glUniformi(glGetUniformLocation(bloomShader.program, "colorTexture"), colorBuffers[0]); ...


2

Maybe there's more problems, but at least this looks incorrect: gl.glTexCoord2f(2f, 1.0f); Your texture is repeated horizontally 2 times because its wrap mode is repeat and the coordinates you set are over 1 (in this case 2f). To fix this, replace 2f with 1f: gl.glTexCoord2f(1f, 1.0f);


1

Looks like you are using the wrong function, need to use uniform1i instead. https://www.opengl.org/sdk/docs/man/html/glUniform.xhtml glUniform1i and glUniform1iv are the only two functions that may be used to load uniform variables defined as sampler types. Loading samplers with any other function will result in a GL_INVALID_OPERATION error. ...


1

Your question needs re-phrasing. SDL and OPENGL are two different technologies so to speak. Also, this question will lead to opinions instead of facts Wikipedia says: Simple DirectMedia Layer (SDL) is a cross-platform software development library designed to provide a low level hardware abstraction layer to computer multimedia hardware components. Open ...


1

Sometimes resources seem inaccessible because the devs used customized or proprietary formats, I.E. appending sound effects to the end of sprite image file. Keep in mind while it's possible to obfuscate the resources, but you can't fully protect them. Even if encrypted, your game will need to decrypt them before use & will need the key. If the key is in ...


1

Regarding cubemap seams, you can just filter across edges. See: glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); As far as your actual shadow quality, the entire benefit of VSM and ESM techniques comes from the special form that the visibility test takes. You probably want to introduce a constant factor for over- or under-darkening the shadows, so that the edge isn'...


1

I didn't see any call to SwapBuffers after your draw commands. That's definitely a problem that will cause a blank screen. As long as there are no OpenGL errors, it's the only problem.



Only top voted, non community-wiki answers of a minimum length are eligible