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

learn more… | top users | synonyms

16
votes
0answers
525 views

How can I get PagedGeometry grass to receive shadows?

I made the switch to Ogre3D (v1.7) and to using PagedGeometry. What I'm trying to do is make a simple scene with a terrain, some trees and grass. In a nutshell, I would like to achieve this kind of ...
5
votes
0answers
117 views

Diamond-Square algorithm output is random and noisy

I have implemented a rough interpretation of the Diamond-Square algorithm in C++ to create some semi-realistic fractal terrain, but the output just seems like a random y value at each point rather ...
4
votes
0answers
81 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 ...
3
votes
0answers
69 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 #version 450 core layout(triangles) ...
3
votes
0answers
82 views

How can I fire a bullet from an actor's position?

I want to shoot a bullet from an actor. I know I need a location in space to fire a bullet from, which I've got in the form of a model set as an actor. Now I need to create a new object (in this case,...
3
votes
0answers
102 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
82 views

“UObject” has no member “BeginPlay”

so I loaded up UE4 to work on a new project. I created 2 C++ classes, one for a bullet, one for a canon. Upon loading into Visual Studio 2015 I immediately get the error "UObject" has no member "...
3
votes
0answers
40 views

RWTexture3D in Compute Shader on Intel HD 4000

I'm having some weird issues running a Compute Shader with DirectX 11 on an Intel HD 4000 GPU. The goal is to write different shapes into a DXGI_FORMAT_R32_FLOAT 3D Texture with a size of ...
3
votes
0answers
64 views

Easing towards stepped value

I'm currently developing this rhythm game in lua (on top of a c++ engine) and I'm having trouble keeping a steady playhead position for the song currently playing. The playhead position that the ...
3
votes
0answers
60 views

Optimal batching for 2D objects with transparency

I have a collection of 2d objects with transparency. Each object has a depth value to determine draw order and a material. I'm trying to batch them in an optimal way to minimize draw calls. Assume ...
3
votes
0answers
167 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 ...
3
votes
0answers
39 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 ...
3
votes
0answers
114 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 ...
2
votes
0answers
41 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 ...
2
votes
0answers
131 views

How to “hot-reload” a glsl shader

I am wondering if its possible to dynamically change shaders while the code is running. In my game, I want to have a development mode in which users can change the shader source and dynamically see ...
2
votes
0answers
52 views

What happens to Buffer data that isn't used?

I have a vertex struct that has 5 glm::vec3 but some of my objects only use 2 or 3 of those members. So I have two questions : 1.) What happens to the large buffer I create, even though I don't use ...
2
votes
0answers
103 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 ...
2
votes
0answers
40 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....
2
votes
0answers
58 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 ...
2
votes
0answers
116 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 ...
2
votes
0answers
128 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 ...
2
votes
0answers
224 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 ...
2
votes
0answers
225 views

OpenGL textures make very low fps

I loaded some textures just one time before I go to my mainloop(glutMainLoop). I am using SDL for the texture loading. However, when I compile, my game is running at 6-10 fps. When I don't load the ...
2
votes
0answers
92 views

SDL2 SDL_CreateTexture returns pointer to existing texture

I have an initialized renderer in SDL2 that works fine. I create some textures from images using SDL_CreateTextureFromSurface and store them in a vector. Afterwards, I create an empty texture so as ...
2
votes
0answers
178 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 ...
2
votes
0answers
72 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 ...
2
votes
0answers
345 views

Reading Color data from UTexture2D in UE4

Here's my code: // get RenderTarget2D static ConstructorHelpers::FObjectFinder<UTextureRenderTarget2D> TargetObj(TEXT("/Game/Textures/RenderTexture")); // generate a UTexture2D CameraTexture = ...
2
votes
0answers
586 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 ...
2
votes
0answers
151 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 ...
2
votes
0answers
807 views

Weird y offset when using custom frag shader (Cocos2d-x)

I'm trying to mask a sprite so I wrote a simple fragment shader that renders only the pixels that are not hidden under another texture (the mask). The problem is that it seems my texture has its y-...
2
votes
0answers
257 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: Glyph gl; gl.width = face->glyph->metrics.width / 64; gl....
2
votes
0answers
2k 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 ...
2
votes
0answers
311 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 ...
2
votes
0answers
313 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 ...
1
vote
0answers
33 views

C++ SFML: Keypressed Event not registering half the time?

I have a very simple event handeling system at the moment. void LevelScreen::PollInput() { sf::Event event; while (pWindow->pollEvent(event)) { if (event.type == sf::Event::...
1
vote
0answers
24 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)...
1
vote
0answers
29 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 ...
1
vote
0answers
23 views

SFML Texture issue removing from memory

I am currently working on loading tmx levels into my game, all is going well and i have layers being loaded textures being loaded and all the data being loaded such as level name, tile sizes etc. The ...
1
vote
0answers
14 views

Cocos2d How do I transition to a scene

So I have mainScene and I have LogoScene, I am wondering If i can make logoscene show a logo, then transition to mainscene. here is what i have import org.cocos2d.layers.CCLayer; import org....
1
vote
0answers
26 views

Getting Display Name via Steam ID for Non-Friends

When using the Steamworks SDK (in C++), is there any way to get the display/persona name from the CSteamID object, even if we are not friends on Steam? Or is this possible for friends only? In that ...
1
vote
0answers
45 views

When to Use Spatial Hashing vs Bounding Volume Hierarchy?

I've been slowly working on implementing a spatial hashing function into Bullet Physics to see how well it will work in my game engine as a general use. Though as I'm starting to design it, I do ...
1
vote
0answers
45 views

Perspective correct interpolation of normal values

I'm currently writing a software rasterizer and I'm at the point where I can draw arbitrary triangles with vertex colors and perspective correct texture mapping. I do point and directional lighting by ...
1
vote
0answers
161 views

OpenGL ArcBall Camera

I'm currently working on a OpenGl Project and I have alot of difficulty understanding how arcball camera work. From what I have read online, all I have to do is to rotate a camera around a target and ...
1
vote
0answers
47 views

Renderering problem with flat terrain

i was testing out my game engine last night, but stumbled across this unexpected result. Here is a picture: As it appears, it is renderering 1 triangle and not renderering the other triangles. I ...
1
vote
0answers
23 views

trouble getting correct transforms for multiple meshes from assimp importer

I have had excellent success in extracting almost everything i need from a collada file that i imported with assimp, however I am struggling to get the correct transforms for each mesh in the file. ...
1
vote
0answers
47 views

rendering a terrain

I'm trying to render a terrain using directx 11 and applying a heightmap to it. I load the heightmap then I copy it to a integer vector, then for each vertex position I assign the Y position of that ...
1
vote
0answers
38 views

Swept AABB vs AABB Calculation Error

I'm having issues running simple AABB vs AABB collision detection. I'm able to successfully detect collisions without checking with velocity. But for some reason my code keeps prematurely firing ...
1
vote
0answers
74 views

C++ Modern OpenGL - Calculate Vertex Normals

I'm learning modern OpenGL and i just got started so go easy on me :). Right now im trying to understand normals but im having some difficulties. On my program i have this class which i use to draw ...
1
vote
0answers
37 views

OpenGL texture not loading onto the model

I am still learning and I'd like to apologize if I don't explain something clear enough or anything like that. please forgive me :) So I am experimenting with 3D graphics for my university assignment....
1
vote
0answers
28 views

Skin Mesh Animation Shader Issue

I'm having troubles with properly animating a skin mesh from an .fbx file. I feel like the issue is in the shader, but not sure what is going on. All I know is that I am getting unexpected results ...