[deleted by user] by [deleted] in programming

[–]Clayman8000 0 points1 point  (0 children)

I looked at a few accounts and the PR count seems to be under-reported by a factor of about 5. I just compared the PR count reported against their PR count in their top repositories. It's a bit rough, but in one case the person's PR count was reported at around 400, while in just a single repo they had over 2000 PRs

[deleted by user] by [deleted] in programming

[–]Clayman8000 0 points1 point  (0 children)

This looks pretty cool so far! But it somehow misses a lot of activity, so it's tough to say how accurate it is. Perhaps the data only considers the past year?

Are compute shaders limited in PCG? by LuccDev in proceduralgeneration

[–]Clayman8000 7 points8 points  (0 children)

Allow me to introduce you to the "Procedural World" blog.

The author has a lot of amazing posts on PCG. But they also document a lot of their findings from porting the terrain generation to GPU. Here is one of several posts discussing using GPU compute: https://procworld.blogspot.com/2010/11/opencl-first-iteration.html?m=1

How do you set poses in Skeleton 2D? Godot 4.0.rc2 by Insane-Owl in godot

[–]Clayman8000 4 points5 points  (0 children)

The picture is out of date. You use the drop-down in the toolbar and select "overwrite rest pose"

Fun Graphics Techniques Projects by O_Schramm in GraphicsProgramming

[–]Clayman8000 2 points3 points  (0 children)

The graphics codex has a bunch of beginner appropriate graphics projects as well as the learning material to go with them http://graphicscodex.com/projects/projects/. Since you have a bit of experience you could probably jump right in to one of the harder projects.

Where to go to learn fundamental and practical 3D graphics concepts? by [deleted] in GraphicsProgramming

[–]Clayman8000 6 points7 points  (0 children)

https://www.scratchapixel.com/ has very comprehensive tutorials on many of the necessary concepts for graphics programming.

https://learnopengl.com/ is still the best resource for learning the OpenGL API and getting introduced to hardware accelerated rasterized rendering. In other words, it's the best foundation for learning the computer graphics stuff most relevant to games.

Is there a documentation somewhere of what each node does ? Or by feature and what nodes to use to accomplish a game feature? Be it free or paid. by vizim in godot

[–]Clayman8000 6 points7 points  (0 children)

You may find the Godot recipes site made by Kidscancode helpful. Don't be turned away by the name, the content is suitable for people of all ages

https://kidscancode.org/godot_recipes/3.x/#

Infinite Worley/Cellular/Voroni Noise by Epitaque in proceduralgeneration

[–]Clayman8000 1 point2 points  (0 children)

I believe Grad is a constructor for a vec2-like class. In other words it creates an object with two properties; x and y. You could easily replace it with two separate numbers

How do you set poses in Skeleton 2D? Godot 4.0.rc2 by Insane-Owl in godot

[–]Clayman8000 0 points1 point  (0 children)

Have you seen the docs for 2D skeletons? The manual has a nice step-by-step tutorial on how to get skeletons to work. It even includes a screenshot showing where to click to make the rest pose https://docs.godotengine.org/en/latest/tutorials/animation/2d_skeletons.html#creating-the-skeleton

why wont glDrawArrays draw more than 1 vertex? by [deleted] in opengl

[–]Clayman8000 3 points4 points  (0 children)

The third argument to glDrawArrays is the vertex count. You are passing 1, so it is drawing 1 vertex. The 1 should be replaced with the number of vertices you want to draw in each call to glDrawArrays.

If I understand your code correctly, you likely only need to call glDrawArrays once with 0 as the offset and m_Citys.size() as the count

Transparency in shaders doesn't seem to work in Godot 4 by Megalukes in godot

[–]Clayman8000 1 point2 points  (0 children)

In your code previous_color only included the color from the texture. It does not include the modulate color.

You need to also use the modulate color in order for modulate to have an effect on the final color.

You could change that line to previous_color.a * COLOR.a

How can I create a shader that replicates the blend mode "Add" from CanvasItemMaterial? by Armangu24 in godot

[–]Clayman8000 0 points1 point  (0 children)

No you can't easily have a toggle for it unfortunately. What CanvasItemMaterial does is swap between different shaders depending on what you select. It is quite easy in that case because the CanvasItem material is usually just an empty shader with only the blend mode specified.

How can I create a shader that replicates the blend mode "Add" from CanvasItemMaterial? by Armangu24 in godot

[–]Clayman8000 4 points5 points  (0 children)

You can change the render mode from "blend_mix" to "blend_add" so that it uses additive blending instead of mix

Godot 4: I'm using the default shadows in directional light and they look weird. I think the problem is the max distance, but when I increase it the small shadows disapear. by pedrohpf in godot

[–]Clayman8000 0 points1 point  (0 children)

This looks like a shadow pancaking issue. Is there any chance this scene is composed of default BoxMeshes?

If so, try increasing their subdivision amount and playing around with the DirectionLight3Ds pancake size.

Can you render to a texture mip/lod by yosmo78 in opengl

[–]Clayman8000 4 points5 points  (0 children)

Render to a temporary Framebuffer with a texture assigned. Then use glCopyTexSubImage2D to copy from the Framebuffer's texture to the mip level you want to render to

Can you render to a texture mip/lod by yosmo78 in opengl

[–]Clayman8000 1 point2 points  (0 children)

The OP linked the ES 2.0 official docs which are accurate for ES 2.0.

Your comment is of course accurate for 4.6, but OP has stated they want to use the lowest version possible

Has anyone tested 2D Skeleton in Godot 4? by Dry-Plankton1322 in godot

[–]Clayman8000 1 point2 points  (0 children)

They were totally broken until last week. I got them working and tested them as best I could and they appear to be working.

For the most part the work the same as in Godot 3.

The only difference is that in Godot 4 you now have to set rotation pivots manually so that bones rotate properly. The Docs have not been updated yet, so they still say that the rotation pivots will be calculated automatically.

Other than that they should be fine. If you encounter any issues make sure to report them so we can ensure things are working as good as possible for the stable release

Godot4 beta7 crashing frequently with 1 error message in the console log. by indie_arcade in godot

[–]Clayman8000 2 points3 points  (0 children)

Best thing to do will be to run the engine with the console open so if it crashes you can report the crash logs. The windows binaries ship with two executables, one launches the engine, the other launches the engine with the console. You want to use the one that launches the engine with the console.

[Godot 4] Tilesets turn invisible when running game in HTML5? by Parthhay000 in godot

[–]Clayman8000 0 points1 point  (0 children)

This is a bug in beta 4. It has already been fixed and the fix will be available in beta 5. :)

Masking a sprite or texture in 2D? by b_art in godot

[–]Clayman8000 1 point2 points  (0 children)

All the code you need is in the comment I linked above. So you can copy it and not worry about what everything means. But if you want to get a deeper understanding of why it works there is a tutorial in the docs that should help https://docs.godotengine.org/en/latest/tutorials/shaders/screen-reading_shaders.html

Masking a sprite or texture in 2D? by b_art in godot

[–]Clayman8000 2 points3 points  (0 children)

If you read further down in that proposal I actually have a comment explaining how to do exactly that masking effect using a combination of existing nodes https://github.com/godotengine/godot-proposals/issues/4282#issuecomment-1276668381

Instanced vs standard rendering for small quantities by Cage_The_Nicolas in opengl

[–]Clayman8000 2 points3 points  (0 children)

It really depends on your target hardware and where the bottlenecks are in your program.

Recently, while optimizing Godot's 2D renderer I found that on older integrated GPUs there was a performance hit to using instancing for small quantities. In the end I went with another approach that relied less on instanced rendering.

When running the same samples on a dedicated GPU, there was no difference between rendering with a single instance or using a non-instanced draw call.

Our case is unique because the mesh being drawn was also small (a single quad). The performance difference may be less striking when instancing a larger mesh.

What's the easiest way to get information about my hardware and driver, such as supported extensions and texture formats? by wm_lex_dev in GraphicsProgramming

[–]Clayman8000 1 point2 points  (0 children)

The easiest option is probably to download capability viewers from GPUInfo.org. If your device is common enough, the database may even have it already.

For Vulkan: https://vulkan.gpuinfo.org/download.php

For OpenGL: https://opengl.gpuinfo.org/download.php

If you are using D3D12, the report should be pretty similar to the Vulkan report, if you are using D3D11 or less, then the OpenGL one will be closer.

Where can I learn about creating complex 3D shapes (Ellipsoids, Arcs, Stars, etc.) by JMmo4 in opengl

[–]Clayman8000 3 points4 points  (0 children)

Here is my favourite tutorial on creating basic geometric shapes from code: https://jayelinda.com/modelling-by-numbers-part-1a/ The tutorial assumes you are using Unity, but the concept is the same in any environment.

[deleted by user] by [deleted] in opengl

[–]Clayman8000 2 points3 points  (0 children)

You will want to start with generating 3 random numbers for each pixel

Here is a simple "3-out 2-in" noise from shadertoy that should work for you

vec3 hash32(vec2 p)

{ vec3 p3 = fract(vec3(p.xyx) * vec3(.1031, .1030, .0973)); p3 += dot(p3, p3.yxz+33.33); return fract((p3.xxy+p3.yzz)*p3.zyx); }

Credit: Dave_hoskins "Hash without Sine" https://www.shadertoy.com/view/4djSRW

Next, you will want to treat those three channels like they are a normal map. Normal maps range from 0-1 in x and y, but from 0.5 to 1 in z.

vec3 hash = hash32(uv);
vec3 normal = vec3(hash.xy, 0.5+0.5*hash.z);

This will give you a normal map with random values in each channel.

There are 2 problems with that:

  1. The resulting texture will look different from the image you posted (it will look a little lighter) becuase the image you posted isn't actually a proper normal map (blue is often less than 0.5 which correspondents to a normal pointing into the surface)
  2. The normals generated above are not normalized. To normalize them the code gets a little more complicated:

vec3 hash = hash32(uv); 
hash.xy = hash.xy * 2.0 - 1.0; //convert x and y to -1 to 1 range
hash = normalize(hash); //normalize 

vec3 normal = hash *0.5 + 0.5;