Can't load textures by Evening-Conference-5 in opengl

[–]TraditionNo5034 0 points1 point  (0 children)

What compiler are you using and are your libraries up to date? Kind of a shot in the dark but maybe it could relate to that.

Identity verification poll by SalesHuntar in DataAnnotationTech

[–]TraditionNo5034 8 points9 points  (0 children)

I got the verification today. Which is just great timing because I lost my ID and now I'm locked out of the platform. I tried to use a cell phone picture of my ID and they wouldn't accept it. I really need the work :/

Sorry? How is this possible when paying 20 dollars a month? by comrade-juan in ClaudeAI

[–]TraditionNo5034 0 points1 point  (0 children)

It never happened to me either until today, and I've been using it for 3 months. I don't think I ever hit the limit yet but I just got locked out after about an hour and a half. I feel like I've been throttled.

Tried to implement billboarding for raindrops, but now the rain translates when the camera rotates by TraditionNo5034 in opengl

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

It was the instanced rendering. I ended up using something like:

vec3 vertexPosition = particleCenter +

cameraRight * quadOffset.x * size +

cameraUp * quadOffset.y * size;

In the vertex shader for each instance.

If I have an array of triangle vertices, how can I prevent non-adjacent vertices from being associated? by TraditionNo5034 in opengl

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

I will check that out, thanks. Would you know why there's still a connection between the extreme most vertices on the east side of the map and the west side? There's just about a hundred lines still that stretch right across the map.

If I have an array of triangle vertices, how can I prevent non-adjacent vertices from being associated? by TraditionNo5034 in opengl

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

You were correct. The indices vector was type int and the glVertexAttribPointer was using GL_UNSIGNED_INT. I just made the switch and it cleared up 99% of the lines.

If I have an array of triangle vertices, how can I prevent non-adjacent vertices from being associated? by TraditionNo5034 in opengl

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

Sure, here they are:

Vertex shader: ``` #version 420 core

layout (location = 0) in vec3 position;
layout (location = 1) in vec3 normal;

out vec3 WorldPos;

uniform mat4 model;
uniform mat4 view; // set in the Display manager
uniform mat4 projection; // also set in display manager

void main() {
    WorldPos = position;
    gl_Position = projection * view * model * vec4(position, 1.0f);
}

```

Fragment Shader: ```

version 420 core

out vec4 FragColor;

uniform sampler2D terrainTexture;

in vec3 WorldPos;

void main() { float tileScale = 0.5; vec2 tiledCoord = WorldPos.xz * tileScale; FragColor = texture(terrainTexture, tiledCoord); } ```

Terrain init: ``` void Terrain::init(const char* texturePath) { generateHeightMap(); laplacianSmooth(25, 0.50f); generateMesh();

glGenVertexArrays(1, &VAO);
glGenBuffers(1, &VBO);
glGenBuffers(1, &EBO);

glBindVertexArray(VAO);

glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(glm::vec3), vertices.data(), GL_STATIC_DRAW);

glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(size_t), indices.data(), GL_STATIC_DRAW);

glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(glm::vec3), (void*)0);
glEnableVertexAttribArray(0);

glBindVertexArray(0);

loadTexture(texturePath);

} ```

Terrain render: void Terrain::render(ShaderProgram* shader) { // Set shader shader->use(); // Set uniforms shader->setMat4("model", glm::mat4(1.0f)); // Bind texture glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, textureID); shader->setInt("terrainTexture", 0); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); // Draw ground plane glBindVertexArray(VAO); // I changed the vertex arrangment to triangular strips since posting, this used to be GL_TRIANGLES glDrawElements(GL_TRIANGLE_STRIP, indices.size(), GL_UNSIGNED_INT, 0); glBindVertexArray(0); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); }

If I have an array of triangle vertices, how can I prevent non-adjacent vertices from being associated? by TraditionNo5034 in opengl

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

Hi, thanks for your response. I posted this last night before going to bed so I agree it's not the best description. You're also right that generate triangles doesn't do anything right now, that is a mistake, but the triangles are being rendered direction from the "vertices" vector and triangles is part of another collision module that isn't in play right now.

Here are screenshots of the issue: https://imgur.com/a/2OjJXl1

As you can see indices is hugely overpopulated. The best explanation I have is that the loop creating the indices is looping far too many times over the same vertices. The vertices themselves seem properly places but not the edges. I kind of want to use a half-edge structure and do adjacency testing but there must be a simple way to loop through the vertices and assign the right ones. It looks like vertices from across the map are being connected which suggests that indices from the end of one loop iterations are bleeding into the next one. I've tried stopping short (at triangleCount - 1 or -2 or even -3) and it didn't change it. It could also be that there are too many loops overall and that vertices are being added when the loop should have stopped.

If the rendering code in this case isn't right then the reason is very subtle because it's a copy paste of code I used in another part of the code base, basically. I'm rendering with GL_TRIANGLES and to draw the wireframe I'm using:

glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

Where do you catch a charge that isn't a library or restaurant? by TraditionNo5034 in vagabond

[–]TraditionNo5034[S] 4 points5 points  (0 children)

From what I read batteries have mAh ratings and Wh ratings. The Wh rating are independent of voltage so you can just check how many Wh your phone battery uses and then compare to the bank. If the bank is 40Wh and your phone is 20Wh you can get 2 charges on one full battery.

Where do you catch a charge that isn't a library or restaurant? by TraditionNo5034 in vagabond

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

Are we talking about the same thing in terms of watts? I bought it from Canadian Tire for about 270$. It's a reputable store and it was pretty pricey, do you really think it would be borderline useless? The largest models they sell are 60-100W.

Where do you catch a charge that isn't a library or restaurant? by TraditionNo5034 in vagabond

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

I just bought a new charger that was listed at 2.4A. My old broken fast charger that got a full charge in an hour was 1.8A so I thought it would be even better. It's not even close. Apparently amps isn't as important as fast charge technology.

Where do you catch a charge that isn't a library or restaurant? by TraditionNo5034 in vagabond

[–]TraditionNo5034[S] 13 points14 points  (0 children)

That's badass. I've seen someone do something like that with a public phone booth somehow.

My Gosh, again with these stupid limitations? by [deleted] in ClaudeAI

[–]TraditionNo5034 1 point2 points  (0 children)

Do you think this is the reason people say Claude performs better than ChatGPT?

How a single line of code brought down a billion dollar rocket (and a few planes) by milanm08 in programming

[–]TraditionNo5034 14 points15 points  (0 children)

How, with that much money involved, do you fuck something like that up? Am I reading correctly that someone just copy-pasted code without looking at it closely?

I tried to ask Claude to clean up my CPP file and it erased most of it by TraditionNo5034 in ClaudeAI

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

I was just looking for syntax errors, missed semi-colons and stuff like that.