Questions tagged [c++]

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

544 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
2 answers
501 views

Why isn't my cbuffer updating?

I am really frustrated because my cbufer isn't updating. This is my VS: ...
Daniel Hop's user avatar
7 votes
2 answers
428 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 ...
Dender Red's user avatar
7 votes
0 answers
693 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 ...
Oscar's user avatar
  • 261
6 votes
0 answers
809 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: ...
RenX's user avatar
  • 707
6 votes
1 answer
255 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/...
BobMan's user avatar
  • 61
6 votes
1 answer
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 - ...
Haruko's user avatar
  • 368
5 votes
0 answers
200 views

How inefficient is my ray-box-intersection algorithm?

One of the most critical parts of my raytracer is the calculation of a collision between ray-box which is done following way: ...
NHSH's user avatar
  • 51
5 votes
0 answers
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 ...
Joshua's user avatar
  • 51
4 votes
0 answers
260 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 ...
Chaz H's user avatar
  • 41
4 votes
0 answers
345 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, ...
Mac O'Brien's user avatar
4 votes
0 answers
113 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 <...
jmic's user avatar
  • 41
4 votes
0 answers
197 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)...
javaLover's user avatar
  • 227
4 votes
1 answer
475 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 ...
Stents's user avatar
  • 41
4 votes
0 answers
410 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 ...
Phaninder M's user avatar
4 votes
0 answers
816 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 ...
Ben Hollier's user avatar
4 votes
0 answers
246 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 ...
SvinSimpe's user avatar
  • 215
4 votes
0 answers
2k 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 ...
SvinSimpe's user avatar
  • 215
4 votes
0 answers
74 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,...
V4karian's user avatar
  • 151
4 votes
0 answers
184 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 ...
Brian's user avatar
  • 41
4 votes
0 answers
340 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, ...
bboy3577's user avatar
  • 153
4 votes
0 answers
1k 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 ...
Liyara's user avatar
  • 41
4 votes
0 answers
238 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 ...
Patrick Purcell's user avatar
4 votes
0 answers
4k 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 ...
user38873's user avatar
4 votes
1 answer
128 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 ...
MrNoise's user avatar
  • 73
4 votes
1 answer
145 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 ...
quinnavery's user avatar
3 votes
0 answers
197 views

How can I implement native c++ scripting like it's done in engines like Unreal and Godot?

I've been developing my own game engine and I'm kind of stuck in the process of scripting. I decided to use C++, since my game engine is mainly written in C++. (and don't suggest me other languages as ...
Anuhas's user avatar
  • 31
3 votes
0 answers
1k views

Unreal Engine 4.25.4 - CreateDefaultSubobject inside a child component attached to an actor loses values in blueprint editor

I have the following actor: ...
Jimmyt1988's user avatar
3 votes
0 answers
127 views

Access GLFW functions from DLL

My game uses DLLs as mods. Players can write DLLs which can render, play audio, print to console, etc. This works fine, however when I try to access GLFW functions, they don't seem to work properly. <...
J4S's user avatar
  • 153
3 votes
0 answers
160 views

Understanding callbacks for connecting/disconnecting controller

I am using glfw and let's say I track controllers with a simple struct: ...
Sky Doge's user avatar
3 votes
0 answers
334 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 ...
AJ Weeks's user avatar
  • 113
3 votes
0 answers
691 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 ...
Tudvari's user avatar
  • 711
3 votes
0 answers
93 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 ...
user743414's user avatar
3 votes
0 answers
313 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 ...
0xen's user avatar
  • 443
3 votes
1 answer
1k 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 ...
user40247's user avatar
3 votes
0 answers
305 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 ...
Cherkesgiller's user avatar
3 votes
0 answers
903 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 (...
csisy's user avatar
  • 355
3 votes
0 answers
245 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 ...
Jason Crosby's user avatar
3 votes
0 answers
286 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 ...
Captain Picard's user avatar
3 votes
0 answers
183 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 ...
Pavel Pája Halbich's user avatar
3 votes
1 answer
1k 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 ...
Asik's user avatar
  • 545
2 votes
0 answers
90 views

How can I write a fold expression in Unreal 5?

I'm trying to write a variadic function template that would fold a parameter pack over an expression in UE5. However, the compiler fails on the fold expression. Since my function is a little complex, ...
MetaZenithian's user avatar
2 votes
1 answer
230 views

Smoothing multiple combined vector translations

I am currently working on my arm/weapon rig for an fps game written in a custom engine. I am to the point where I am implementing the movement of the arms/weapon (hereby referred to as weapon), for ...
whitwhoa's user avatar
  • 181
2 votes
1 answer
2k views

Using UPawnMovementComponent to control a Pawn with Keyboard sharing code between Pawns

I've just started to learn Unreal and reading the tutorial Components and Collisions I have found that they use the UPawnMovementComponent to control their ...
VansFannel's user avatar
2 votes
0 answers
55 views

OpenGL : Blending & feedback effect

I'm struggling on a simple project, as an example/sandbox, I'm rendering a small oscillating rectangle on my output. I'm not using glclearcolor() but instead, on ...
ebkgne's user avatar
  • 21
2 votes
0 answers
94 views

How to get struct layouts from vertex shader input using ID3D12Reflection

I am attempting to write a code generator that builds C++ structs/classes from D3D12 reflection data built using DXC. Given a simple vertex shader signature: ...
MSinger's user avatar
  • 21
2 votes
0 answers
2k views

'CoreMinimal.h' file not found when building on Unreal Engine on Mac

I'm trying out C++ on Unreal Engine 4.25 on Mac. If relevant, my Xcode version is 12. When I try to compile, there's an error: 'CoreMinimal.h' file not found. I've ...
nusantara's user avatar
  • 121
2 votes
0 answers
1k views

Efficient communication between entities using ECS via entt

To avoid confusion about the ECS terms I'll use, I explain them here quickly. I use entt terminology and set-up my architecture like this: Entity: is only an id (...
mrzo's user avatar
  • 133
2 votes
0 answers
125 views

How can an Entity trigger changes to the world in C++?

I'm writing a simple physics based game in C++ using SFML. I want to trigger a scene change when my playerCharacter collides with a door. Since C++ does not have any native Event Sender/Listener ...
john_shreds's user avatar
2 votes
0 answers
186 views

How can a system similar to Dwarf Fortress' legends mode be implemented?

In Dwarf Fortress, nearly everything that happens during world generation is logged and viewable in legends mode. An XML file containing that information can be exported and loaded into a utility such ...
Austin's user avatar
  • 31
2 votes
0 answers
270 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 ...
Traistorm's user avatar

1
2 3 4 5
11