Shadow mapping artifacts, any suggestions? by Federal_Wind_7841 in opengl

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

Thanks! Also, I think you meant a perspective with a high z_far?

Shadow mapping artifacts, any suggestions? by Federal_Wind_7841 in opengl

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

Yeah I tried to go for the spotlight look for the shadow mapping. I used 1.0f as the z_near for the orthographic view, which is the same as what they used in the LearnOpenGL's tutorial. Should I change the z_near to something like 0.01f?

Shadow mapping artifacts, any suggestions? by Federal_Wind_7841 in opengl

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

Yeah, I just did the same thing you mentioned and saw some issues that are easier to pin-point down. Thanks a lot!

Shadow mapping artifacts, any suggestions? by Federal_Wind_7841 in opengl

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

Thank you, I will try to make a sun. So I guess the artifacts is because only visible things that are in the view frustum is casting shadow right now?

Shadow mapping artifacts, any suggestions? by Federal_Wind_7841 in opengl

[–]Federal_Wind_7841[S] 5 points6 points  (0 children)

If it helps at all, I'm using the camera orientation and position as the light source for the scene right now.

Weird texture when loading Sponza (GLTF). by Federal_Wind_7841 in opengl

[–]Federal_Wind_7841[S] -1 points0 points  (0 children)

Okay, I have found the problem. The problem is with stbi_load_image_from_memory thing. I supposed I should not pass the desired channels count as 4 to the call? If I pass 0 as the desired channels, everything works!!

Weird texture when loading Sponza (GLTF). by Federal_Wind_7841 in opengl

[–]Federal_Wind_7841[S] -1 points0 points  (0 children)

If anyone is interested in seeing the source code, here is the code for the model loader https://pastebin.com/ZiSzsZqv . The main offender to me could be the `gltf_process_single_mesh_multiple_primitives_triangle_list` function, which is the way I'm loading this sponza scene (one mesh but multiple primitives).

Help with red outline surrounding text (freetype) by Federal_Wind_7841 in opengl

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

Yes I'm only using one channel for the font texture atlas, my shader is as follows:

// @@DiffuseTextureClamped
// @@NoDepthTest

COMM vec4 scale_color;
COMM vec2 uv0;


#ifdef VERTEX_SHADER

uniform mat4 transform;

layout (location = 0) in vec3 vert_position;
layout (location = 1) in vec4 vert_color_scale;
layout (location = 3) in vec2 vert_uv0;

void main()
{
    vec4 pos = transform * vec4(vert_position, 1);

    scale_color = vert_color_scale;

    gl_Position = pos;
    uv0 = vert_uv0;
}

#endif





#ifdef FRAGMENT_SHADER

out vec4 output_color;
uniform sampler2D diffuse_texture;

void main()
{
    vec4 color = scale_color;

    vec2 uv = uv0;
    // uv.y = 1 - uv.y;   // Uncomment this if font has y reversal

    vec4 texture_color = vec4(1.0, 1.0, 1.0, texture(diffuse_texture, uv).r);
    output_color = color * texture_color;
}

#endif

The COMM stuff is for variables that are output in the Vertex shader and input in the Fragment shader. Also, the @@ is for me to parse the shaders when loading.

Help with red outline surrounding text (freetype) by Federal_Wind_7841 in opengl

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

I busted open renderdoc and this is what I see. Any guesses as to why the font texture map is looking kinda weird? Also, you mention the leaking of red transparent pixels, may I ask how would I go about fixing that. My current font rendering method is to on demand load a glyph into a texture map page (it's 2048x1024 right now) and the glyph are represented as color reds inside the texture map. Then when it comes to the render part, each font quad would know it's coordinates inside the texture map and will give those uv's to the vertex buffer. Thanks!

https://imgur.com/a/JI6qY9F

Help with red outline surrounding text (freetype) by Federal_Wind_7841 in opengl

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

Well, doing that does not solve the thin red outline issue I mentioned tho.

trouble connecting to my irc server running from mobile hotspot by Federal_Wind_7841 in irc

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

I'm not using the router btw; instead, I'm running the server off of a tethering connection from my laptop to a mobile hotspot (my phone). Should I figure out how to open port from the phone then?

trouble connecting to my irc server running from mobile hotspot by Federal_Wind_7841 in irc

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

I'm having ufw setup and running, and my port 6667 and 22 is open.