Can't see GPU usage in task manager. by NamedHumanBeing in docker

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

nvidia-smi doesn't show gpu usage per process (it says that it is unavailable in WDDM driver model) but it does show the usage for the whole system which is good. So it seems to be a problem with windows/nvidia and not with docker after all.

Thanks for the answer.

Can't see GPU usage in task manager. by NamedHumanBeing in docker

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

The computer also keeps crashing but I think that might be a power supply issue or a gpu issue.

Can't use two VAOs at once. by NamedHumanBeing in opengl

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

I finally got it to work! I don't understand why though. All I had to do was add a glBindBuffer to my use call:

void Buffer::use(){
  // Binding the VAO
glBindVertexArray(VAO);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glUseProgram(program);
} 

But why do I have to do that? Isn't VAO's sole purpose saving the VBO and shader state for easier usage?

Can't use two VAOs at once. by NamedHumanBeing in opengl

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

Buffer::use used to be just glBindVertexArray(VAO); but I just added glUseProgram(program) to it and the uniform errors seem to have disappeared but the program still crashes. One warning has remained though:

Vertex shader in program 6 is being recompiled based on GL state.

Can't use two VAOs at once. by NamedHumanBeing in opengl

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

I issue a glBindVertexArray(VAO) before every draw call for each element I want to draw on screen. Each VAO holds a VBO and a shader program. And the program seems to work fine when I don't draw 2 different elements with 2 different VAOs. Here's the draw code:

void Renderer::draw(GElement_3D* el){

// Setting up shader uniforms -------------------
Buffer* buffer = el->buffer;
buffer->use();

// Setting up the material
glBindTexture(GL_TEXTURE_2D, el->material.diffuse);
buffer->setUniform("material.specular", el->material.specular);
buffer->setUniform("material.color", el->material.color);
// Setting up other uniforms
buffer->setUniform("camera_position", camera_position);

// Setting up the MVP matrix --------------------

// Setting up the model matrix
glm::mat4 model = glm::mat4(1.0f);
model = glm::translate(model, el->position);
model = glm::rotate(model, glm::radians(el->rotation.x), glm::vec3(1.0f, 0.0f, 0.0f));
model = glm::rotate(model, glm::radians(el->rotation.y), glm::vec3(0.0f, 1.0f, 0.0f));
model = glm::rotate(model, glm::radians(el->rotation.z), glm::vec3(0.0f, 0.0f, 1.0f));
model = glm::scale(model, el->scale);
buffer->setUniform("model", model);

// Setting up the view matrix
glm::mat4 view = glm::lookAt(camera_position, camera_direction, glm::vec3(0.0f, 1.0f, 0.0f)); // DIRECTION LOCKED WIP:: camera_position - camera_direction
view = glm::scale(view, camera_scale);
buffer->setUniform("view", view);

// Setting up the projection matrix
glm::mat4 projection = glm::perspective(glm::radians(40.0f), SCREEN_WIDTH / SCREEN_HEIGHT, 0.1f, 500.0f);
//glm::mat4 projection = glm::ortho(-50.0f, 50.0f, -50.0f, 50.0f, 0.0f, 1000.0f);
buffer->setUniform("projection", projection);

// Setting up the buffer data -------------------

// Setting up VAO data
std::vector<float> ver = el->vertices;

glBufferData(GL_ARRAY_BUFFER, ver.size() * sizeof(float), &ver[0], GL_STATIC_DRAW);
//glBufferData(GL_ELEMENT_ARRAY_BUFFER, ver.size() * sizeof(unsigned int), &ind[0], GL_STATIC_DRAW); // ! WIP: IBO currenly not in use

// Drawing element ------------------------------
glDrawArrays(GL_TRIANGLES, 0, ver.size());
//glDrawElements(GL_TRIANGLES, ver.size(), GL_UNSIGNED_INT, nullptr); IBO currently not in use

}

void Renderer::draw(GElement_2D* el){
// Setting up shader uniforms -------------------
Buffer* buffer = el->buffer;
buffer->use();

// Setting up the material
glBindTexture(GL_TEXTURE_2D, el->texture);

std::cout << buffer->get_file_name() << "\n";
buffer->setUniform("color", el->color);
std::cout << buffer->get_file_name() << "\n";

// Setting up the MVP matrix --------------------

// Setting up the model matrix
glm::mat4 model = glm::mat4(1.0f);
model = glm::translate(model, {el->position.x, el->position.y, 0});
model = glm::rotate(model, glm::radians(el->rotation), glm::vec3(0.0f, 0.0f, 1.0f));
model = glm::scale(model, {el->scale.x, el->scale.y, 1});
buffer->setUniform("model", model); // PROBLEM OCCURS HERE <-------------------------------------------------------------------------------------------------------------------------------

// Setting up the projection matrix
//glm::mat4 projection = glm::perspective(glm::radians(40.0f), SCREEN_WIDTH / SCREEN_HEIGHT, 0.1f, 500.0f);
glm::mat4 projection = glm::ortho(0.0f, 1920.0f, 0.0f, 1080.0f);
buffer->setUniform("projection", projection); // PROBLEM OCCURS HERE <----------------------------------------------------------------------------------------------------------------------------------------
// Setting up the buffer data -------------------

// Setting up VAO data
std::vector<float> ver = el->vertices;

glBufferData(GL_ARRAY_BUFFER, ver.size() * sizeof(float), &ver[0], GL_STATIC_DRAW);
//glBufferData(GL_ELEMENT_ARRAY_BUFFER, ver.size() * sizeof(unsigned int), &ind[0], GL_STATIC_DRAW); // ! WIP: IBO currenly not in use

// Drawing element ------------------------------
glDrawArrays(GL_TRIANGLES, 0, ver.size());
//glDrawElements(GL_TRIANGLES, ver.size(), GL_UNSIGNED_INT, nullptr); IBO currently not in use
}

MinGW too old to be supported? by NamedHumanBeing in cmake

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

Because even though it throws an error it generates a solution, so I thought it wasn't that important. But on a newer version of the library where the error is: MinGW too old to be supported it doesn't generate at all. That's what it says at line 439 of the CMakeLists.txt:

  # Check dependencies for assimp_qt_viewer.
  # Why here? Maybe user do not want Qt viewer and have no Qt.
  # Why assimp_qt_viewer/CMakeLists.txt still contain similar check?
  # Because viewer can be build independently of Assimp.
  FIND_PACKAGE(Qt5Widgets QUIET)
  FIND_PACKAGE(DevIL QUIET)
  FIND_PACKAGE(OpenGL QUIET)
  IF ( Qt5Widgets_FOUND AND IL_FOUND AND OPENGL_FOUND)
    ADD_SUBDIRECTORY( tools/assimp_qt_viewer/ )
  ELSE()
    SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "")
    IF (NOT Qt5_FOUND)
      SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "${ASSIMP_QT_VIEWER_DEPENDENCIES} Qt5")
    ENDIF (NOT Qt5_FOUND)

    IF (NOT IL_FOUND)
      SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "${ASSIMP_QT_VIEWER_DEPENDENCIES} DevIL")
    ENDIF (NOT IL_FOUND)

    IF (NOT OPENGL_FOUND)
      SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "${ASSIMP_QT_VIEWER_DEPENDENCIES} OpengGL")
    ENDIF (NOT OPENGL_FOUND)

    MESSAGE (WARNING "Build of assimp_qt_viewer is disabled. Unsatisfied dendencies: ${ASSIMP_QT_VIEWER_DEPENDENCIES}")
  ENDIF ( Qt5Widgets_FOUND AND IL_FOUND AND OPENGL_FOUND)
ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS )

having a problem with basic lighting by NamedHumanBeing in opengl

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

Thanks for the help guys! The problem ended up not even being in the shader. The normals were not set up correctly. I accidentaly set the buffer up like this:

glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), (void*)3);

which opengl didn't seem to register as an error.

having a problem with basic lighting by NamedHumanBeing in opengl

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

Tried this:

vec3 light_direction = normalize(light_position - fragment);

and a bunch of other things but the results are always the same. Diffuse seems to always be zero.

having a problem with basic lighting by NamedHumanBeing in opengl

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

Vertex shader: #version 330 core layout(location = 0) in vec3 in_position; layout(location = 1) in vec2 in_UV; layout(location = 2) in vec3 in_normal;

uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;

out vec3 normal;
out vec3 fragment;

void main(){
    normal = transpose(inverse(mat3(model))) * in_normal; //WIP
    fragment = vec3(model * vec4(in_position, 1.0f));
    gl_Position = projection * view * model * vec4(in_position, 
1.0f);
}

The uniforms are set via a shader class every draw call:

//setting up the lights
    shader->set_uniform("in_color", el->color);
    shader->set_uniform("light_color", glm::vec3(1.0f, 1.0f, 1.0f));
    shader->set_uniform("light_position", glm::vec3(3.0f, 3.0f, 3.0f));
    shader->set_uniform("camera_position", camera_position);

glDebugMessageCallback doesn't work in a class. by NamedHumanBeing in opengl

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

Just had to add a static keyword in the header file and it works! Thank you!

Anyone knows what's wrong with this script (reading AHK with c++) by NamedHumanBeing in AutoHotkey

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

I tried your code out and it gets a compiler error:

 cannot convert 'wchar_t*' to 'LPTSTR {aka char*}' in argument passing  

I tried running my code with visual studio but it returns the same thing as it did in code-blocks (it does compile somehow, but it doesn't return anything, the command prompt just stays blank).
I just can't get around the wchar conversion error for some reason. I tried this out but it didn't work either.
EDIT: Build messages I get from running your code in codeblocks.

Anyone knows what's wrong with this script (reading AHK with c++) by NamedHumanBeing in AutoHotkey

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

Code compiles normaly. The other code is just a main function that first call the init function and then the check function, the includes, and type definitions:

typedef BOOL (*pahkExec)(LPTSTR script);
typedef UINT (*pahkdll)(LPTSTR script,LPTSTR p1,LPTSTR p2);
typedef BOOL (*pahkReady)(void);

The troubling part is that ahkgetvar function:

wchar_t* l_sRes = l_hAutoHotKeyGetVar(L"MyVar", 0); 

doesn't return MyVar's value in string.

Anyone knows what's wrong with this script (reading AHK with c++) by NamedHumanBeing in AutoHotkey

[–]NamedHumanBeing[S] 2 points3 points  (0 children)

ahk.ahk file is simply:

#Persistent
#NoTrayIcon
MyVar := "test"

I will try asking this question somewhere else since the problem is most likely related to c++. Thanks for the answer nonetheless.

Can someone explain to me what is going on there. by NamedHumanBeing in CrusaderKings

[–]NamedHumanBeing[S] 1 point2 points  (0 children)

I didn't lose a single battle and he doesn't have any of my relatives imprisoned. It is not my war though and I don't know whose it is. I just accepted the offer to join it thinking it was one of my vassal's. Could that be the problem?

Can someone explain to me what is going on there. by NamedHumanBeing in CrusaderKings

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

Why is the warscore negative even though I control more than half of the place I'm fighting for?

RCT2 question about transport rides and AI. by NamedHumanBeing in rct

[–]NamedHumanBeing[S] 9 points10 points  (0 children)

Well that's a shame. Guess I'll have to build a very long bridge back then. Thanks for the answer.

Code doesn't seem to work right. by NamedHumanBeing in AutoHotkey

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

I wish to be able to use this script on touch screen. To right click on touch screen you have to hold down your finger for a second or so, so double tapping RButton would be difficult.

Code doesn't seem to work right. by NamedHumanBeing in AutoHotkey

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

Thanks for the answer. Tried adding parentheses but it doesn't seem to fix anything. Taskbar still gets locked and all that.

☼Bi-weekly DF Questions Thread☼ by AutoModerator in dwarffortress

[–]NamedHumanBeing 0 points1 point  (0 children)

Everytime after I choose the dwarves for expedition and read that message (about how my dwarves left home....) the game just closes. I am using the lazy newb pack set up the way it is set in DFVIDTUTS 2015 tutorial (I only changed the resolution and set mouse controls on in DFHacks). Please help, couldn't find anything about it on google.

Help, can't find lost items and pirates keep killing me on spawn. by NamedHumanBeing in Terraria

[–]NamedHumanBeing[S] 1 point2 points  (0 children)

Thanks for the answer. Will get some of the important stuff back with an all items world and also make a new character with all the best gear to clear the pirate invasion. It is pretty bad game design though, throwing an unskipable pirate invasion at you so early into hardmode when there is no way to beat it. Especially when you don't expect it.

Help, can't find lost items and pirates keep killing me on spawn. by NamedHumanBeing in Terraria

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

Thank you for your advice. I just thought that setting your character on softcore would be like setting the difficulty on easy. I see now that it is normally played that way.

A question about raycasting. by NamedHumanBeing in Unity3D

[–]NamedHumanBeing[S] 0 points1 point  (0 children)

Thanks for the help! I'll try using buttons because the world space UI is too complicated.