BGE or UPBGE PSX Shader?

Hi, y’all
I’ve been messing around with glsl (And having no Idea what I’m doing) and trying to archive the shader seen in this video:

Anyone can explain how this can work and how its made in bge or even possibly UPBGE?

glsl custom filter can be written I imagine… don’t now if it would work for the entire scene or just an object…

The nice thing about Godot custom shaders is that you can see them in the viewport and you can create uniforms that show up as UI elements (making them easy to test, reuse, and tweak). Though to be fair, it’s probably the same way in Unity and Unreal too.

Unless things changed in UPBGE, testing and iterating on custom shading is a slow and cumbersome guessing game (as you only see the result when the game is being played). That type of non WYSIWYG-based workflow is something that may have been acceptable in engines in the 1990’s, but not in 2017.

I guess we can blame it on the original bge developers. :frowning:

perhaps we could write shader code and python inside the engine, and write to a external.blend using py and then libLoad the result
even use python/ path to load images so you could alt tab and make/ save them in gimp
(seemlessly)

it would be a nice “shader design suite” eh?

Bah, I don’t know If I understand your question correctly, but I saw this video too


, while watching the one you send.

I think a good aproach could be with GLSL filters, like hanzo said.

For example, take a look at the TheTimst3r Post processing addon:

it has some filters like noise, for example, also as Night Vision, Retinex and game boy color. You could mix these and see if you achieve the result you want or you could even tweak the scripts if your have some glsl knowledge, or if you prefer write your own filter.

http://glslsandbox.com/

https://www.shadertoy.com/

Shadertoy I think have an online editor, but you can also search for already made shaders on it:

https://www.shadertoy.com/browse (the shaders thumbnail are in “realtime”, so you can probably have a slow down on your browser)

About the workflow of shader creation on bge/upbge, I think we could take some examples as others game engines do, for example. or even a way to write it like the nodes editor or the logic bricks, but in a better way, maybe even creating some kind of preview window, i think it would be nice.

1 Like

Simply ignoring the problems with BGE shader workflow (by using such roundabout multi-step processes) is not the way to go, especially since the BGE is perhaps one of the only active engines out there that can’t display the result of shader scripts during the creating process.

Though if UPBGE uses Eevee and its node-based material approach, then there might be little reason to even touch raw GLSL code in the future.

@Ace: There will always be a reason…otherwise most games will look alike shading wise.

Response to thread starter:

The easiest way to get pixelated looking textures is to simply disable mipmapping in user prefferences and use any resolution texture you want…I toyed with the idea myself when a work colleague approached me about making a 2D game with 3D elements…

I'm not sure how this works after publishing, but I assume it should be fine.

creating a upbge shader design suite, and publishing it is not a workaround it’s a solution*

Hi. I forgot the specifics, but it’s omitting some calculations which lead to the view dependent stretching and jittering.

Pretty sure people have emulated it in Unity if you wanted code examples, else look up ps1 emulator technical discussions / groups.

I made a PSX shader. It supports only 2 texture slots (1 = Color texture, 2 = Reflection texture)
https://i.imgur.com/DWrv0hD.gif
Here’s the script file: https://drive.google.com/file/d/0B4Q7HeW7vYDIQUZqWjVyMVM4ZVU/view?usp=sharing

To use it, in your Camera, just add an Always sensor and a Python controller with the script’s main module in it:
https://imgur.com/svWKl5Rl.png

2 Likes

Is it possible to have this pixel snapping effect but using the current glsl shader?
I mean, being able to continue using NM, Spec, the lighting sources of the BGE etc and combining it with this effect?

I’d say:

disable mipmapping in File> User Preferences> System> Mipmaps.

But then you wont have the pixel snapping effect. So use nodes and noise to distort the uvs.

Do you think that effect is doable with nodes? And if so, it would have to be applied to every object, right?
Wouldn’t it be pretty heavy this way?
There must be an easier way than nodes, right?

edit: i think that effect is doable with nodes, yes. And it would have to be applied to every object.

but i think nodes are ‘easier’ than glsl
and i’ve read somewhere that their cost as much as regular materials. but they opens up more possibilities.

1 Like

i am not sure of a way to do that using only regular materials, maybe using some textures to distort the uvs and get the exact same effect.