BGE or UPBGE PSX Shader?


(joao678) #1

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?


(Qareeb S Alhaqq) #2

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


(Ace Dragon) #3

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.


(Akira_San) #4

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


(BluePrintRandom) #5

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?


(Hdhunk) #6

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.


(Ace Dragon) #7

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.


(JustinBarrett) #8

@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.

(BluePrintRandom) #9

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


(<== Lost? Click Me) #10

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.


(TwisterGE) #11

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


(backyardbomb98) #12

PSX Shader Test.blend (110 KB)

How come the textures aren’t showing when I try the script?


(backyardbomb98) #13

PSX Shader Test.blend (110 KB)How come the textures don’t appear when I try the script?


(backyardbomb98) #14

Do you have a blend file?


(backyardbomb98) #15

PSX Shader Test.blend (107 KB)

When I try the script, the textures don’t seem to want to work. What could be the problem?