Questions tagged [c++]

C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

399 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
0answers
543 views

How to link assimp lib to universal app

I cannot make assimp object loader work with universal app, and I got the same problem as this one: Assimp and directX12 universal apps I tried the static library approach mentioned in the answer of ...
7
votes
1answer
401 views

Why isn't my cbuffer updating?

I am really frustrated because my cbufer isn't updating. This is my VS: ...
6
votes
1answer
314 views

Set the name of an animation in collada to be used by AssImp

I am using the collada file format to contain my model and animation but when I use AssImp to load the file the name will be empty for the animation. Where is the name for animation set on the collada ...
5
votes
0answers
245 views

SSAO shader program produces no occlusion

I'm attempting to implement screen-space ambient occlusion by the method shown here. My SSAO shader program is the one part that isn't working. Here are the outputs of the initial rendering pass, ...
5
votes
1answer
1k views

A script isn't showing in the Content Browser

Just to set the tone, I'm very new to game development. I'm currently taking an online video course for Unreal Engine 4 that required me to create a C++ script. After I created the script and it ...
5
votes
1answer
280 views

How to generate a multiplier map for radiosity

I am following this tutorial: here I am at the part where you are creating a hemicube. I have got the code to render the scene into a texture and therfore an array. Now how can I generate a so-called ...
5
votes
1answer
213 views

How do I detect image clicks in Dark GDK?

I am trying to determine if an image has been clicked, using the Dark GDK game engine. I've found no methods in the engine that do this. I would rather not brute force this with a large nested if/...
5
votes
1answer
2k views

Water wave simulation

I'm having a strange behavior simulating water waves. It works perfectly with directional waves, but point waves don't work like expected. If i do not normalize the directional vector(WoldPosition - ...
4
votes
1answer
276 views

How can I create a templated function to add components to their necessary containers using an ECS system?

I had implemented a basic ECS system and was then informed that it should be changed as each system should not directly store their required components. I have created a ...
4
votes
0answers
153 views

Determine user mouse selection of 3D Object for multiple viewports

I am currently working on setting up some world objects for my level editor and am running into a bit of a snag. When I get the hit location from the mouse raycast, I would like to determine what part ...
4
votes
0answers
98 views

Problem with shooting. Projectile is missing target from about 5 degrees to about 30 degrees

I'm trying to make projectile shooting code. But there is a problem, in most cases projectile is missing target. -sprite is origin of projectile -bulletSprite is a projectile -mouse is a target <...
4
votes
0answers
257 views

Limit/Clamp camera movement using quaternions

I'm making a camera object for rendering with OpenGL. However, instead of using the typical "LookAt" method I'm trying to use just a Quaternion for orientation and a Vector3 for position. Instead of ...
4
votes
2answers
1k views

OpenGL GLSL using projection,view and transformation

I have been trying to get a simple triangle to render on the screen. I am using Projection, View and Transformation matrices but am unable to get anything to the screen. Main loop ...
4
votes
0answers
595 views

Creating random nebulae for scrolling space background

If you've ever seen a picture of space, you'll most likely see that there is some kind of pretty nebula in the background. I would like to find out how I could create random, semi-realistic looking ...
4
votes
0answers
172 views

How do you fix wobbling shadow edges?

I've implemented an omni-directional shadow map and I've noticed a rather unwanted behaviour on the shadows. It seems like when the angle between the occluded points and the light source is really ...
4
votes
0answers
1k views

How do I sample a cubic shadow map in DirectX 11?

I've implemented a cubic shadow map for dealing with omni-directional light sources in my scene. By defualt it produces hard shadows Obviously a shadow map with higher resolution (currently using ...
4
votes
0answers
59 views

How to increase the number of available chapters for an HL2: EP2 mod?

I created a mod for Half-Life 2: Episode 2 that has 39 chapters (or maps, here it is the same). The problem is that the game seems to see only 32: when clicking "new game", and clicking next, I count ...
4
votes
0answers
170 views

OpenGL Planet Generation - Simple Matrix Issue (Planet “Spins” With Mouse)

I originally asked this question on StackOverflow & was directed here by a commenter. Im currently working on a OpenGL planet rendering. I'm using the Tessellation pipeline. So far things are ...
4
votes
0answers
254 views

Python interpreter as in-game console

Say I have a game which has lots objects (NPCs, monsters, etc.), I want a console so I can change the variables of the objects (like changing HP for example), how could I embed python into my program, ...
4
votes
0answers
925 views

implementing shadows into my 2D GLSL-based lighting system

I'm writing a lighting system in OPENGL using GLSL shaders, and I'm pretty happy with the light casting I have so far, but I'm totally stuck on casting shadows. Everything I've found online on this ...
4
votes
0answers
208 views

DX 11 Specular Highlights in Deferred Renderer

I am currently implementing a deferred renderer in DX11.1. Right now I am having a problem that I can't seem to crack with specular highlights when I have multiple light sources. I keep a vector of ...
4
votes
0answers
631 views

Text alignment in OpenGL with FreeType2

I'm trying to implement font rendering and have got into some trouble with glyph metrics. Here's the code where I get the metrics: ...
4
votes
0answers
3k views

Arcball 3D camera

I have checked multiple threads before posting, but i havent been able to figure this one out. Ok so i have been following this tutorial, but im not using glm, ive been implementing everything up ...
4
votes
0answers
2k views

How do I mix 3D skeletal animations?

I'm trying to create a 3D-model skeletal animation system for C++/Open GL. I would like to be able to mix animations by allowing animations to only affect specific bones. My game has ride-able ...
4
votes
1answer
109 views

Optimizing black and white matrix block drawing

Disclaimer: I am uncertain if this is the best place to post this question, so please advise me of how I can best find the answer if I am doing something wrong. I am asking this question because I am ...
4
votes
1answer
123 views

How to make expanding ring with constant thickness?

I need to generate this burst or (donut-shaped) pulse. I'm having a difficult time how to generate such shape. At first, I was thinking of scaling the image but that didnt work out because the line or ...
3
votes
0answers
113 views

Understanding callbacks for connecting/disconnecting controller

I am using glfw and let's say I track controllers with a simple struct: ...
3
votes
0answers
300 views

Reading depth buffer result in only two values

I am attempting to add an SSAO post processing shader to my deferred rendering engine. I am running into problems with reading from the depth buffer. In the images linked below you can see the depth ...
3
votes
0answers
452 views

How to store Lua script's inner state?

Situation: I am working on an Entity-Component system, and I am using LuaBridge as a Lua binder. There is only one Lua State. Currently when I update the game objects, I just check whether it has a ...
3
votes
0answers
84 views

Problem with rendering in my game when using a following camera

I've got an issue while rendering 2d images with my own simple 2D camera object. First my setup: a star initial position 0,0 a planet circles the star initial position 300, 300, moves at a radius of ...
3
votes
0answers
138 views

Integration of Game Loop + Physic Engine : when to delete objects?

How to manage code around physic engine, when a game object should be deleted? I will use a tiny game as an example:- 1st iteration of development I have a very simple game with 1 character (Jumper)...
3
votes
0answers
439 views

SFML Raycasting Problem: Textures not displaying propely

I have been lurking on gamedev.Stackexchange for a while now and finally have a question to ask. I have been working on a simple raycasting engine (like wolfenstein 3d) using the SFML Graphical ...
3
votes
0answers
252 views

Geometry Shader crashing

I keep getting some strange errors in my Geometry shader and when I search for the cause of the errors, it returns nothing substantial. Here is the code. Shader ...
3
votes
1answer
579 views

Specular Light not working (Phong Lighting)

There seems to be a problem with my current Phong Shading implementation. I have been using the per fragment approach. The specular highlight aspect of the technique is not rendering as it should, as ...
3
votes
0answers
273 views

Texture Mapping to procedurally generated geometry

How can I calculate texture coordinates of such geometry? The angle shown in the image (89.90 degree) may vary, therefore the geometry figure is changing and is not always such uniform.(maybe like ...
3
votes
0answers
624 views

Tick frame: update order problems

Sorry, it's a bit long story but I hope you can help me. First of all: I have an entity class called SceneObject. The SceneObject has components (eg. RenderableMesh, Camera) and transformation data (...
3
votes
0answers
191 views

Implementing Browser in Unreal Engine 4.10

I am looking to add some oauth to a game I am working on. I can get the user auth to work in the browser that comes with UE4, however there is not any capability to detect changes to the currently ...
3
votes
0answers
218 views

One big asset file or many small asset files?

I'm working on a game and I'm wondering if it is better for performance and memory usage to have one large file containing all my assets (the assets are in a custom format) with a look up table at the ...
3
votes
0answers
290 views

Adjust the Camera Viewport Rect in Unreal Engine

Am new to Unreal Engine. I want to adjust the Camera Viewport Rect so that the camera will render to half of the screen. This is achieved in Unity by changing the Camera Viewport Rect property. How ...
3
votes
0answers
174 views

Recognize pattern in 3D building environment

I'm currently developing 3rd person building game (as bacheleor thesis). I need to recognize constructed patterns co I can mark corresponding structure as some building (so player can start using that ...
3
votes
0answers
1k views

OpenGL Render Queue Design

I am currently designing the rendering system for a 2D game built in C++ and OpenGL, and am unsure about how to go about implementing a sorting procedure to maximise efficiency and minimize OpenGL ...
3
votes
0answers
990 views

How to correctly synchronize a shared surface?

I am trying to share a direct3d9 surface between two processes. One process (let's call it A) writes to the surface, and the other (B) displays it on screen. Currently, process A does a StretchRect of ...
3
votes
1answer
463 views

Full screen shader causes performance hit

I basically want to have a shader run that can do something like toon shading, or grayscale the whole screen, or radial lighting. To do this, I create a new bitmap each time the display resizes that ...
2
votes
1answer
115 views

Game Either Runs Poorly or at Different Speeds

I'm making a simple 2D shooter game using C++ and SDL2. For my main game loop, I used the code from the famous Fix Your Timestep article. The problem is that, because I'm using a fixed delta time, the ...
2
votes
0answers
110 views

Structure for a strategy game

I am making a strategy game like Age of Empires. It's a pretty big project and I need a clear game structure. I have defined a Game_Object class with variables ...
2
votes
0answers
164 views

Using shared memory instead of marshalling for C++ native plugins in Unity?

So I'm a C++ developer who has been playing with C# for a week or two in order to get acquainted with Unity, and I'm curious about the marshalling process used to transfer data for use in C++ native ...
2
votes
0answers
167 views

Getting false positives with SAT

I've been trying to get proper collision detection with SAT in 3D. I started of with this post: How many and which axes to use for 3D OBB collision with SAT. I've been trying to get the right axis to ...
2
votes
0answers
65 views

compiler optimixation interfering with threaded function

I'm making a block game in c++ that stores voxels in a octree and because, at least in my implementation, editing the octree is slow, I'm generating the chunks of land in a separate thread. I manage ...
2
votes
0answers
526 views

OpenGL back/front end threading and Doom 3 BFG engine

Introduction I have been reading through the source code of id Software's Doom 3 BFG engine. The whole codebase is on GitHub at id-Software/DOOM-3-BFG. The architecture is both clean and elegant. The ...
2
votes
0answers
104 views

Moving Draw functions out of GameObjects

This is basically the issue as in Tactics for moving the render logic out of the GameObject class with the topic already discussed here and here However I'm not really satisfied with the given answers....

1
2 3 4 5
8