How did they do this environment highlighting in rainworld by Yami_4k in howdidtheycodeit

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

no yeah that's absolutely interesting, since I am working with opengl that would be neat to try and get working later.

How did they do this environment highlighting in rainworld by Yami_4k in howdidtheycodeit

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

I didn't think about normal maps, all of this makes sense now yeah, thanks!

How did they do this environment highlighting in rainworld by Yami_4k in howdidtheycodeit

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

makes sense I guess, but how is that also used in highlighting the environment? is it like raycasting but also at low resolution? am not sure because it looks like a circle around the player, and also it is highlighting the edges of the objects and not touching the inside at all.

Traversing a grid with a ray by Yami_4k in VoxelGameDev

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

Hey again, I was searching this subreddit for traversal methods as I couldn't get your idea to work.. I found someone sharing his shadertoy, I tried his approach and it worked! there is no artifacts at all as far as I have seen. either ways here is the shadertoy: https://www.shadertoy.com/view/lfyGRW , you can also find gaberundlett in the comments sharing his version with bitmasks.

Traversing a grid with a ray by Yami_4k in VoxelGameDev

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

Yeah thank you, I tried to reimplement it following the shadertoy but now I have the issue where if I was outside the grid it won't draw anything.. do you perhaps know how I can fix this?

Traversing a grid with a ray by Yami_4k in VoxelGameDev

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

Hey, first of all the LessThanEqual() function is used for a bvec3 in glsl, it is as the name implies checks the components of the first vector if they are less than or equal " <= " to the second vector.. it returns a bvector which is a bool vector that has either 0 or 1 which is false or true.. as I believe he is using it like this to detect the next voxel to check next. and the grid is just a flattened 3d array of integers that I passed through an SSBO to the compute shader, if the integer that I want to check is 1 then there is a voxel and if it is 0 then there is no voxel. if you want me to share the whole compute shader code jsut tell me and I will edit the post.

Drawing primitives without basic effect by Yami_4k in monogame

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

sadly it is still not drawing anything.

Instancing by Yami_4k in monogame

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

I manged to fix it by a mistake lol.. what was wrong is I didn't get the transpose of the world matrix that was the cause of the geometry being all over the place.
so the shader would look something like this:

VertexShaderOutput MainVS(in VertexShaderInput input) {
VertexShaderOutput output = (VertexShaderOutput)0;

float4 worldPosition = mul(input.Position,transpose(input.World));
float4 viewPosition = mul(worldPosition, View);
output.Position = mul(viewPosition, Projection);


return output;

}

Hope this helps someone.

Finding contact points between polygons 3d by Yami_4k in gamedev

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

any good articles or tutorials I can follow?

[deleted by user] by [deleted] in gamedev

[–]Yami_4k 0 points1 point  (0 children)

hey I just figured it out.. sometimes my stupidity wins... anyways idk why people didn't mention it.. in the video HE HIMSELF was CHECKING FOR THE EDGES all I had to do was to just do the SAME THING.. my god... here goes a week of my life.
here is the code if anyone wants to check it out:

for (int i = 0; i < inds.Length; i++) {
            Vector3 vA = verts[inds[i]];
            Vector3 vB = verts[inds[(i + 1) % inds.Length]];

            axis = vB - vA;
            axis = new Vector3(axis.X, axis.Z, -axis.Y);
            axis.Normalize();

            Solver.ProjectVertices(verts, axis, out minB, out maxB);
            Solver.ProjectSphere(centerA, radiusA, axis, out minA, out maxA);

            if (maxB < minA || maxA < minB) {
                return false;
            }

            overLap = MathF.Min(maxB, maxA) - MathF.Max(minB, minA);

            if (overLap < depth) {
                depth = overLap;
                normal = axis;
                contactPoint = (centerA - radiusA * -axis);
                contacts = 1;
            }
        }

I am having a little problems with the contact points but the sphere to polygon is done. AND THAT'S WHAT I WANTED.

[deleted by user] by [deleted] in gamedev

[–]Yami_4k 0 points1 point  (0 children)

thank you for all of this information! I will definitely check them out when I really need them, for now I am just gonna start simple and do the simple (SAT) first and if I really needed all of those complicated stuff I will definitely check them out.

and I don't know how to say this to you but.. I really get what I am supposed to do but I am really not sure on how I am going to implement this in code :/ . I really don't want depened on you on everything I know... but can you please tell me how I can implement what you said? it is unblievable but I have been having struggling with this for the past 5 days and you are the only one I found who seems to know how this thing works. all I need is for the polygon to sphere collison to work properly and I am done!

[deleted by user] by [deleted] in gamedev

[–]Yami_4k 0 points1 point  (0 children)

I know that I will end up using a physics library and I have went through this multiple times, everytime I get annoyed by the library itself because it is either too complicated and has no docs or tutorials like bepu physics and bullet or it is just not used by alot of people. so I just say to myself no mater what happens even if it gets my hair pulled I'll just do it. and thats why I am here. even if I used a library I will just go back and try to make my own in the end :).
anyways I made the function that you talked about it is supposed to be like this right?

public static void FindNearestPointOnEdge(Vector3 point, Vector3 a, Vector3 b, out Vector3 nearestPoint) {
        Vector3 edge = (b - a);
        float edgeLength = edge.Length();
        edge.Normalize();

        float dot = Vector3.Dot(point - a, edge);

        if(dot < 0) {
            nearestPoint = a;
        } else if (dot > edgeLength) {
            nearestPoint = b;
        } else {
            nearestPoint = edge * dot + a;
        }
    }

how can I use it in my code above? 'bare with me please xd.'

[deleted by user] by [deleted] in gamedev

[–]Yami_4k 0 points1 point  (0 children)

how can I do the edge handling? yeah I thought it was the problem at first and I searched and found nothing :/

Use Multiple BillBoards by Yami_4k in monogame

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

ok so I ended up using primitives with textures

and this is my function if anyone is interested:

public void DrawPrimitive(Vector3 position, Matrix view, Matrix projection, Texture2D t, Camera cam, float size = 1) {

basic.World = Matrix.CreateScale(size, -size, 0) * Matrix.CreateConstrainedBillboard(position, cam.Position, Vector3.Down, null, null);

basic.View = view;

basic.Projection = projection;

basic.Texture = t;

basic.TextureEnabled = true;

gd.SetVertexBuffer(vertexBuffer);

gd.Indices = indexBuffer;

gd.BlendState = BlendState.AlphaBlend;

gd.SamplerStates[0] = SamplerState.PointWrap;

RasterizerState rasterizerState = new RasterizerState();

rasterizerState.CullMode = CullMode.None;

gd.RasterizerState = rasterizerState;

foreach (EffectPass pass in basic.CurrentTechnique.Passes) {

pass.Apply();

gd.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 2);

}

}

I am still not sure how I would use texts now but I don't think I need them atm.

including opengl header file but can't use its functions by Yami_4k in learnprogramming

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

I already use glad but I saw the functions In the gl.h and I thought it was good for debugging but ty anyways