Categories
Game Creation Mastering Development

Stride: Can’t see shadows in programmatically created scene

As a learning exercise I’m trying to recreate the ‘new game’ scene with the sphere on a plane. Mostly working but two issues: Shadows are not working. Skybox light (reflected on the sphere) is not working. I can’t see any way to set this texture. Please tell me what I’m doing wrong. Thanks! using System; […]

Categories
Game Creation Mastering Development

How to add sprite batch on tile in isometric map in Libgdx

I’m using Libgdx to create an isometric game , but now I have problem. I want to add sprite on tile (3,4) , but I can’t do this, so I searched on stackoverflow , and I found this code :- public Vector2 twoDToIso(Vector2 punto) { Vector2 tempP = new Vector2(0, 0); tempP.x = (punto.x – […]

Categories
Mastering Development

How to structure (refactor) main loop in Opengl?

How do you guys usually structure your main loop (loop where all draw calls are called)? For example: In my program I am drawing a human object. When you are left clicking on object 3 arrows appear (X, Y and Z) and with the help of these arrows you are able to change position of […]

Categories
Game Creation Mastering Development

Direct3D Constant Buffer not updating

I started learning Direct3D a week ago and I’ve been following many tutorials but after I got to the point where I had to create a Constant Buffer I got stuck, the creation of the buffer seems to be working correctly but the UpdateSubresource function doesn’t seem to update it, the value I’m trying to […]

Categories
Mastering Development

C++ function that can take integer or float or double or any other castable to float

I am trying to implement a Vector3 struct in C++. I am overloading the "*" operator for handling multiplication with the scalar values. So it will work like this: v1 = Vector3(1.0f, 1.0f, 1.0f); v2 = 2*v1; v3 = 2.4f*v1; v4 = 2.4*v1; All 3 operations will return a Vector3 instance. However, I don’t want […]

Categories
Mastering Development

vertex shader uniform distortion

I have a quad, composed by two triangles, defined like so: glm::vec3 coords[] = { glm::vec3(-1.0f, -1.0f, -0.1f), glm::vec3( 1.0f, -1.0f, -0.1f), glm::vec3( 1.0f, 1.0f, -0.1f), glm::vec3(-1.0f, 1.0f, -0.1f) }; glm::vec3 normals[] = { glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.0f, 0.0f, 1.0f) }; glm::vec2 texCoords[] = { glm::vec2(0.0f, 0.0f), glm::vec2(1.0f, 0.0f), […]

Categories
Mastering Development

GLUT torus colliding with camera

I want to implement collision of 6 torus which are randomly disturbed in the game area. It is a simple 3D space game using the perspective view and in first person. I saw some stack overflow answer suggesting to compute distance of whatever (player) to torus cell and if bigger than half or whole cell […]

Categories
Mastering Development

OpenGL translucent quad artifact

I am currently attempting to make my water texture translucent. I have added the following blending parameters: void Application::initialiseOpenGL() { printf("Initialising OpenGL context\n"); context = SDL_GL_CreateContext(window); assertFatal(context != NULL, "%s\n", SDL_GetError()); SDL_GL_SetSwapInterval(0); glClearColor(0.0, 0.0, 0.0, 1.0); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_DEPTH_TEST); // glEnable(GL_CULL_FACE); // glCullFace(GL_BACK); } My water looks fine from one side: However, from the […]

Categories
Game Creation Mastering Development

How to time draw images to the window in d3d8

I need to be able to draw one image then have it disappear then draw the next image then disappear. I can draw 1 image on the window but I can not make it disappear and draw image 2. Also would be great too with some code examples makes it easier for me to read. […]

Categories
Mastering Development

Input attachment from previous subpass in Vulkan

I am trying to first render some content to an R8_UNORM image view in subpass 0, and then use the result as an input attachment in subpass 1, using subpassLoad in the fragment shader. However, the final output from the render pass (which is also the swapchain image(s) that is presented) contains garbage (see https://imgur.com/a/RmNdcxg) […]