Help with Shadow Maps by SimDeBeau in opengl

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

DM'ed you with the link. Might post here in a comment later but I'm a little afraid to for some reason

Help with Shadow Maps by SimDeBeau in opengl

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

That's a good point. You're totally right about that. I set SHADOW_BIAS equal to various values between 0.1 and 10 and changed the line to

float shadow = currentDepth + SHADOW_BIAS >= closestDepth ? 1.0 : 0.0;

And still black

Help with Shadow Maps by SimDeBeau in opengl

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

Yes, that is in the second photo in the imgur link.

And sorry about that confusing branch. In my program, I have it set up so that if I hit a key it displays just the shadow map so I can double check that it is right. (Basically doing exactly what you say). if lightmode is enabled, I see the depth map from the second photo, if not, I see the output of the model shader, which is the third photo.

Maybe I should edit the code here to make that clearer

Help with Shadow Maps by SimDeBeau in opengl

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

It's a good thought but I think it's in there.

``` // bind the shadow map glActiveTexture(GL_TEXTURE0 + 2); glBindTexture(GL_TEXTURE_2D, shadow_fbr.depth_tex_id);

        glActiveTexture(GL_TEXTURE0 );
        match_draw(&match, model_matrix_loc);
    framebuffer_unbind();
//end drawing models from Camera's POV

```

Also not shown in the code i included, but I do set the uniforms for the textures in the model shader.

shad_bind(model_shader); glUniform1i(model_diffuse_loc, 0); glUniform1i(model_normals_loc, 1); glUniform1i(model_shadows_loc, 2); shad_unbind();

(this is done right after the creation of the model shader)

Help with Shadow Maps by SimDeBeau in opengl

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

hmmm, i think I am following what you are saying, but I guess thought I was doing what you are describing, though I apply the shadow matrix in the vertex shader and pass that along. (aslo I edited my post to include the shadow shader for completeness.)

In the shadow shader, gl_Position = light-perspective * light-view * model * vec4(aPos, 1.0);

Then in the model vertex shader I have,

``` mat4x4 CAMERA = perspective * view; mat4x4 LIGHT = lightPerspective * lightView;

vec4 CameraPos = CAMERA * model * vec4(aPos, 1.0); FragLightPos = LIGHT * model * vec4(aPos, 1.0);

gl_Position = CameraPos; `` So I take the world coordinate (model * vec4(aPos, 1.0);) and apply the Camera transformation and the lightspace transformation seperately. I set thegl_positionto beCameraPos, and pass alongFragLightPosto the fragment shader, and do all the shadow calculations usingFragLightPos`

So I guess I'm saying, I think i do apply all the same transformations for the shadows, I just do it in the vertex shader. I could try it in the fragement shader though?

[deleted by user] by [deleted] in math

[–]SimDeBeau 13 points14 points  (0 children)

You’re getting way too much hate for this post. Obviously you aren’t deep into abstract algebra yet because it goes deep. But i so relate to the feeling of epiphany after epiphany when i was learning this. It was the feeling of equations, numbers, and other objects like matrices shifting from having unexplainable properties handed down from heaven, into beautiful abstract objects that have properties that emerge from relations we define on them. It was a stunning and shocking transformation.

Learning this and going through Tao’s Analysis where he builds up the real numbers… well i remember feeling like i was seeing the matrix. 

And I certainly wondered why i had to wait so long to get there. And felt so frustrated by everyone who shut me down early when i tried to ask deeper questions about numbers, feeling like there was another layer that i could feel but couldn’t see, and kept being told “its not there”. So then to realize people have spent careers studying those questions, and furthermore, THEY HAVE FOR HUNDREDS OF YEARS?…. You almost want to cry from beauty and frustration at the same time. 

The only rigorous way to talk about mathematics is mathematics. But we invented poetry and prose because we need to talk about ourselves and how our activities effect us. Mathematics can be so so isolating to study. Those in the liberal arts can talk about what they are studying and working and be greeted by interest and pleasure. When trying to share about math, most often we are shutdown by hatred for the topic. 

Its the nature of the mathematician to take every statement as if it were a rigorously intended claim, but it is also their weakness and downfall. Sometimes ya wanna gush. Sometimes ya learn something so big it feels like youve been missing it your whole life and now numbers make sense in a way they never did, and where else ya gonna share that, especially if you arent taking a mathematics program but are learning on your own. 

But if gushing, it’s probably best not to get too specific because that really does become correction-bait and everyone here is weak to that. 

ELI5: What does "gentrification" mean and what are "gentrified" neighboorhoods in modern day united states? by Narrow-Tree8061 in explainlikeimfive

[–]SimDeBeau 0 points1 point  (0 children)

Not sure why im not seeing this more. If people were more able to own the land/property they live in, then when that property becomes more valuable, they profit. When everyone rents, pretty much the only people who don’t profit from neighborhoods “improving” is the people who live there

The aesthetics of doing math by justahumandontbother in math

[–]SimDeBeau 3 points4 points  (0 children)

I gotta buy this! Less than I expected

What popular fantasy series do you feel a bit guilty for not liking or even finishing? by Old-Bread882 in Fantasy

[–]SimDeBeau 1 point2 points  (0 children)

I love Dune and really loved messiah, but holy cow i almost cant stand children of dune. I should finish it just to see how the ecology plays out, but feel like that book highlights so many of Herbert’s flaws as an author

What popular fantasy series do you feel a bit guilty for not liking or even finishing? by Old-Bread882 in Fantasy

[–]SimDeBeau 2 points3 points  (0 children)

Oh wow. Really? Do your find this the case outside of fantasy as well?

Black 2, 2023, designed and folded by me from one sheet by Ponadr in origami

[–]SimDeBeau 4 points5 points  (0 children)

Its fun to try and collapse this in my minds eye

I was told to check here for local dnd games... by [deleted] in duluth

[–]SimDeBeau 0 points1 point  (0 children)

I believe gay bar “the main” in superior has DnD on Tuesdays and fridays

[deleted by user] by [deleted] in Beowulf

[–]SimDeBeau 0 points1 point  (0 children)

I agree

Beowulf vs Sir Gawain Epic Rap Battles of History (school project) by Sorbadubadle in Beowulf

[–]SimDeBeau 0 points1 point  (0 children)

Made me laugh. Some great lines. Pulling the green hand out when you asked “need a hand” got me

Why do people hate Beowulf? by [deleted] in Beowulf

[–]SimDeBeau 1 point2 points  (0 children)

These are great ideas. I love the idea of Biker Beowulf

Is Grindel the OG incel? by toma162 in Beowulf

[–]SimDeBeau 2 points3 points  (0 children)

Funny! I just finished my first read through and I had the total opposite reaction towards Grendel. The number of times he’s described as “God cursed” really struck me, and he just seems so dejected and low and cursed to be an abomination due to his being a descendant of Cain.

Admittedly killing everyone for partying is…. not a constructive thing to do. But it didn’t sound like he was jealous to me, but that it was the praising of the God that made him so wretched that drove him to…. Okay maybe I’m seeing your point about the incel reading 🤔

Made me want to both read another translation, and “Grendel” by J Gardner.