[-] HobbesHK@startrek.website 5 points 5 months ago

This worked perfectly - thank you!!

For anyone else looking here later, the final shader code (confirmed working Godot 4.2) is:

shader_type canvas_item;

uniform sampler2D screen_texture : hint_screen_texture;
uniform vec4 water_color : source_color;
uniform sampler2D wave_noise : repeat_enable;

void fragment() {
	vec2 water_wave = (texture(wave_noise, UV * TIME * 0.02).rg - 0.5) * 0.02;
	vec2 uv = vec2(SCREEN_UV.x , SCREEN_UV.y - UV.y) + water_wave;
	vec4 color = texture(screen_texture, uv);
	float mix_value = 1.0 - UV.y;

	float avg_color = (color.r + color.g + color.b) / 3.0;
	avg_color = pow(avg_color, 1.4);
	mix_value += avg_color;

	mix_value = clamp(mix_value, 0.0, 0.7);
	COLOR = vec4(mix(water_color, color, mix_value).rgb, texture(TEXTURE, UV).a);
}

Credits to Single-mindedRyan for creating this shader in the first place.

35
submitted 5 months ago* (last edited 5 months ago) by HobbesHK@startrek.website to c/godot@programming.dev

I have been looking for a 2D reflective water shader for some time and was delighted to see that this tutorial was posted on YouTube to create just that:

https://www.youtube.com/watch?v=wPr5PvSgxFo

I've had a go at implementing it and have got the reflective water rendering. It's very "Kingdom: Two Crowns" like when spread across the full width of the scene.

However, as you can see from the image above, I've drawn a pond (as a separate Sprite2D) and I've applied the water shader to the pond. It's done that, but draws the water as a rectangle.

Is there a way to apply this shader to the Sprite2D, but conform to the actual sprite (only the light blue), rather than as a rectangle?

[-] HobbesHK@startrek.website 3 points 6 months ago

These all sounds like good ideas to play with, thanks! I'll have a go later tonight and will update here. It would be bonkers if the mesh shaders were at fault, since I got my 7800XT specifically for that feature...

22
submitted 6 months ago* (last edited 6 months ago) by HobbesHK@startrek.website to c/linux_gaming@lemmy.ml

I was wondering if anyone could offer some insights.

Bit the bullet and purchased Alan Wake 2 on the Epic Game Store. With the DLC on the way I just can't wait any longer and maybe this one will never come to Steam? (With Epic as publishers, who knows)

I've installed Heroic Game Launcher, downloaded the latest Wine-GE and Proton-GE, downloaded the game and managed to get it running. Tried it with both Wine-GE and Proton-GE. No noticeable difference.

My specs:

  • Intel Core i7 10700K
  • 48Gb RAM
  • Radeon RX 7800 XT 16Gb
  • Manjaro Linux, kernel 6.9
  • Mesa 24.1.1 (using the mesa-nonfree repo)
  • Game is installed on my 1TB NVME drive

I'm running things on Medium/High, with FSR2 on Balanced, in 2560x1440

No raytracing enabled anywhere.

Honestly, it doesn't matter what resolution I choose. Even when running is 720p on Low, the framerate is the same.

I get around 27 fps with regular dips into the lower 15-20 when I spin the camera around quickly.

I've finished the first chapter (just in the morgue) and the framerate got choppier and choppier. I get Bright Falls has a lot more going on than the intro woodsy bit. But at this rate, I'm just not sure what to do.

When I look at other people on YouTube, their framerates are much higher. Even on Linux. And with less powerful hardware. Other games run MUCH faster. I get AW2 is demanding, but I can play CP2077: Phantom Liberty at 140+ fps in Dog Town on High in 1440p with FSR2 enabled, so I don't feel that AW2 should tank my PC that hard.

Is there something I'm overlooking here? I've tried the CyberFSR as well, made no noticeable difference.

Mangohud shows my CPU is consistently around 50% and my GPU is around 40% so there's definitely room to push things more, I feel. So why isn't AW2 using these resources?

Any help would be greatly appreciated. I love this game and want to play it, but the framerate is stopping me from really enjoying it.

[-] HobbesHK@startrek.website 9 points 6 months ago

I prefer the world-famous song “Press X to Jason”

https://m.youtube.com/watch?v=_56257iS77A

Since it’s about the first 5-10 minutes of the game, it’s not a big spoiler.

Stupid Jason.

[-] HobbesHK@startrek.website 4 points 1 year ago

As an open source alternative, I prefer a Jellyfin server and then using Feishin as a client. Nicer UI and options. Plex is a major no-no for me since they’ve started emailing people what they’ve been watching on their own servers. Privacy issues and required online login/plex-owned accounts for my own media? No thank you.

[-] HobbesHK@startrek.website 3 points 1 year ago

So much cool stuff to play with! Great summary by GDQuest. Integer scaling for pixel art - finally! Very chuffed with this.

[-] HobbesHK@startrek.website 8 points 1 year ago

You may want to change the fact that web exports don't work on macOS. MacBook Pro M1 user here. I'm happily running my Godot 4.1 as web exports on my server. Setting the headers is required for any browser / operating system, but things seem to work fine for me on Mac.

[-] HobbesHK@startrek.website 7 points 1 year ago

Oh, absolutely, and more power to them. Godot 4 has been an incredible piece of work and each update things are getting better and better. The thought of more developers using Godot is exciting, since it feels like we're nearing the tipping point where it will really take off.

[-] HobbesHK@startrek.website 2 points 1 year ago

I took away the 2 .visible = true commands at the end, just to see if they were the culprit. They are not. It appears that the get_viewport().get_texture().get_image() command gets called before the interface elements are turned off, even though the order of code would make me think otherwise.

8
submitted 1 year ago* (last edited 1 year ago) by HobbesHK@startrek.website to c/godot@programming.dev

Hi everyone, I was hoping someone could help me with the following. I have a button that saves a screenshot PNG to the Downloads folder when you press it.

What I want is for the button to disappear after it is pressed, so the screenshot does not include the two menu buttons called "%SaveReport" and "%BackMainMenu".

The code for the save button is listed below:

`

func _on_SaveReport_pressed():

$"%SaveReport".visible = false

$"%BackMainMenu".visible = false

print("I've disabled the buttons")
print("That means the screenshot SHOULD be button free")

take_screenshot()

$"%SaveReport".visible = true
$"%BackMainMenu".visible = true

`

As you can see, it calls the take_screenshot() function which is listed above:

`

func take_screenshot(): image = get_viewport().get_texture().get_image()

if OS.get_name() == "Web" or OS.has_feature('JavaScript'):
	print("We're on the web")
	# We're on the web		

	image.clear_mipmaps()

	var buffer = image.save_png_to_buffer()
	JavaScriptBridge.download_buffer(buffer, fileName)

if OS.get_name() != "Web" or !OS.has_feature('JavaScript'):
	# We're not on the web
	print("We're not on the web")
	
	var docs = OS.get_environment("HOME") + "/Documents"
	
	var title = str(docs + "/results",global_ints.observed_person_name, global_ints.observation_minutes,".png")
	
	print(title)
	
	var _saveimage = image.save_png(title)
	
	if OS.get_name() != "OSX":
		print("We're not on MacOS")
		var _openfolder = OS.shell_open(docs)
	
	if OS.get_name() == "OSX":
		print("We're on MacOS")
		
		var _openfolder = OS.shell_open("file://" + docs)

`

The code works. The screenshot is taken and it's saved to the Downloads folder and MacOS/Windows/Linux open up the Downloads folder straight after.

For the life of me, I can't figure out why the Back & Screenshot buttons ( "%SaveReport" and "%BackMainMenu") that I turn invisible BEFORE I call take_screenshot() end up being in the screenshot. Every single time.

Anyone have any ideas?

Thank you!

[-] HobbesHK@startrek.website 4 points 1 year ago

Thank you! I had a look through the documentation and managed to fix the error.

18
submitted 1 year ago* (last edited 1 year ago) by HobbesHK@startrek.website to c/godot@programming.dev

Hi everyone,

Pretty much as I described in my toot (text copied here). Is anyone aware of what I may need to fix to get this plugin to work again?

I'm hoping someone can help me with a Godot engine question. With the Q&A forum being read-only, I'm hoping Lemmy people can answer this one for me.

I'm trying to use this plugin for HTML5 downloads in Godot 4.1:

https://github.com/Pukkah/HTML5-File-Exchange-for-Godot

It's for Godot 3.4, but I've upgraded my projects and want to stay in 4.1.

Currently, it throws an error “Identifier JavaScript not defined in scope” (see screenshot).

Would anyone have an idea on what to fix here? Thanks!

[-] HobbesHK@startrek.website 16 points 1 year ago

I don’t miss it one bit as a social platform. I just wish that search engines wouldn’t prioritise it as much when I try to find a “how to do….” guide. It’s insane how many Reddit threads (half deleted and otherwise) dominate the results. Just show me a nice webpage please.

Without Adblock detection. And no bloody “how to” videos either. I just want to read it through, thank you.

[-] HobbesHK@startrek.website 3 points 1 year ago

I’ve been on Manjaro for about 1.5 years now too. I switched over to the Unstable branch a while back, which fixed this issue for me. This branch seems to be getting all packages at the same speed as regular Arch. Plus, I still get the Manjaro-specific kernels, access to their repos, integrated pamac, etc. For now, I’m sticking with Manjaro this way.

[-] HobbesHK@startrek.website 3 points 1 year ago

I love his stuff - thanks for sharing this one! I’ve been trying to put a build mode together for a looooong time and this helped quite a bit.

view more: next ›

HobbesHK

joined 2 years ago