Custom Textures in 2d Filters

Hello folks!

I’m looking for artists to get some feedback regarding a new feature I’ve been coding.

As you may know, thanks to Hamed Zaghaghi you can access the color, depth and luminance buffer to code your own custom shaders.

What I did is to allow you to pass up to 4 custom images to the shader as well. It’s useful for generation of random values, and other uses you can think about.

Please let me know what uses do you for this feature, send test files, screenshots, critics or comments.

To read the history of the patch you can access here and here.

To download a windows version go to graphicall.
To download a Linux versionn go to graphicall as well :slight_smile:
To get the source code (patch) access here, or http://pasteall.org/3500/diff .

Best regards,
Dalai Felinto

Demo 1: wavy effect
Demo 2: Fish Eye Lens

Hello dfelinto!

I would like to try this patch but im on linux so i hope i can managed to compile with patch.
If i understand well this patch i can create a screenspace effect based on material textures?
Like glow map or glowing matrial, bloom etc.?

I have a PC, but i can’t try it for the moment, because, being windows, it ceased to work after less than three months.

I will try to compile a Linux build later.

I even updated the patch there (link above) but apparently it is still not working … (on Linux).

There is a nice demo Mike (pan) did already with the patch. It’s a very nice wavy effect.
I’ll post it later as well.

sounds cool. I’m for anything that gives more creative freedom without breaking stuff.

Some news:
The patch is working in linux as well (tested with cmake and scons). I will upload a graphicall build soon.

The file is in the above link (or here - http://pasteall.org/3500/text)

Another thing. There is already a nice example from mpan3 using this patch (thanks Mike):
http://www.4shared.com/file/75926384/bc5109f7/mike_2dfilter-customtex.html

@squareline:

I would like to try this patch but im on linux so i hope i can managed to compile with patch.
If i understand well this patch i can create a screenspace effect based on material textures?
Like glow map or glowing matrial, bloom etc.?

It’s very easy to compile Blender in Linux. If you need any help let me know.
This patch allow you to create screenspace effects using images (not procedural textures).
You can’t act per object/material though.

after try apply the patch with scons the dry test result

patch --dry-run -p0 < 081213_c.patchpatching file source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
patch: **** malformed patch at line 124: -

@squareline:
Thanks for testing. The problem was in the Blender files end of line.

Now that this is fixed, I re-patched and I heard that it’s working
(thanks ianwill and Moguri for the tests)

The nem patch is here: http://pasteall.org/3500/diff and in the Blender/Projects link above.

Hello,
managed to apply the patch but after under compiling have an error.

Compiling ==> ‘SCA_2DFilterActuator.cpp’
In file included from source/gameengine/Rasterizer/RAS_IRenderTools.h:34,
from source/gameengine/GameLogic/SCA_2DFilterActuator.h:5,
from source/gameengine/GameLogic/SCA_2DFilterActuator.cpp:3:
source/gameengine/Rasterizer/RAS_2DFilterManager.h:34:29: error: DNA_image_types.h: No such file or directory
In file included from source/gameengine/GameLogic/SCA_2DFilterActuator.cpp:3:
source/gameengine/GameLogic/SCA_2DFilterActuator.h:7:29: error: DNA_image_types.h: No such file or directory
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp:124:2: warning: no newline at end of file
In file included from source/gameengine/Rasterizer/RAS_IRenderTools.h:34,
from source/gameengine/GameLogic/SCA_2DFilterActuator.h:5,
from source/gameengine/GameLogic/SCA_2DFilterActuator.cpp:3:
source/gameengine/Rasterizer/RAS_2DFilterManager.h:48: error: ‘Image’ has not been declared
source/gameengine/Rasterizer/RAS_2DFilterManager.h:112: error: ‘Image’ has not been declared
In file included from source/gameengine/GameLogic/SCA_2DFilterActuator.h:5,
from source/gameengine/GameLogic/SCA_2DFilterActuator.cpp:3:
source/gameengine/Rasterizer/RAS_IRenderTools.h:183: error: ‘Image’ has not been declared
In file included from source/gameengine/GameLogic/SCA_2DFilterActuator.cpp:3:
source/gameengine/GameLogic/SCA_2DFilterActuator.h:16: error: ISO C++ forbids declaration of ‘Image’ with no type
source/gameengine/GameLogic/SCA_2DFilterActuator.h:16: error: expected ‘;’ before ‘’ token
source/gameengine/GameLogic/SCA_2DFilterActuator.h:30: error: ‘Image’ has not been declared
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp:16: error: ‘Image’ has not been declared
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp: In constructor ‘SCA_2DFilterActuator::SCA_2DFilterActuator(SCA_IObject
, int*, const STR_String&, RAS_2DFilterManager::RAS_2DFILTER_MODE, short int, float, int, RAS_IRasterizer*, RAS_IRenderTools*, PyTypeObject*)’:
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp:26: error: class ‘SCA_2DFilterActuator’ does not have any field named ‘m_ima’
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp:40: error: ‘m_ima’ was not declared in this scope
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp: In member function ‘virtual bool SCA_2DFilterActuator::Update()’:
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp:81: error: ‘m_ima’ was not declared in this scope
scons: *** [/home/bbb/svn/blender-svn/build/linux2/source/gameengine/GameLogic/SCA_2DFilterActuator.o] Error 1
scons: building terminated because of errors.

im using latest SVN version

@squareline:
I talked with other users and it’s compiling with scons with no problems. What was suggested to do is to run a scons clean before and make sure that:

  1. your Blender source is updated (as you said it is)
  2. there are no other patches applied
  3. you are using an updated scons (or the one that is included in Blender source).

Please let me know if it works.

Cheers,
Dalai

Sorry if I’m a bit stupid but I still don’t understand whats happening. I have run the patch version of blender and the only feedback I can give is I don’t understand what I’m seeing - an image filling half the screen.

Maybe you could do a simpler description for people who don’t understand OpenGL.

You don’t need to understand openGL, but you will need to understand a little of GLSL to use custom filters.

The image filling half of the screen is just an example to show how to load the image in your Custom Shader (that you need to write by yourself :/)
But the other example is more interesting - http://www.4shared.com/file/75926384/bc5109f7/mike_2dfilter-customtex.html

Could you post some screenshots pls. EDIT:looking in the first link on your page.

this is INCREDIBLE!!!

==)

thanks this should be committeed to trunk ASAP

(did I say that right? I’m not a programmer xD)

On that note, anyone have any tips on how I can build this patch for 64bit windows :slight_smile:

Thanks for the new demo file… Think I get the picture now… Very cool indeed

A recorded a video of the demo above: http://www.youtube.com/watch?v=UwvvTwMzk-w
Thanks for all the positive feedback. I still wanna see more demos though :stuck_out_tongue:

Good news. Apparently the bug I found was confirmed, and now I can finish the part of my code that wasn’t working (to load textures that are not applied to any object).
That way before the end of this year I can finish this patch and discuss/define its final implementation in trunk.

hey just in time for the game competition =)

a quick update: I setup my Linux box and got the same error as yours squareline.
I think who tested did it with Game Engine disabled :slight_smile:

Now that I setup my scons here I can fix the patch to run on Linux in a day or two.

hey just in time for the game competition =)

I thought the competition would finish in March only :slight_smile:
And I’m not sure if you can use patched Blenders there :D:rolleyes:

“big useful features” like the video texture player are allowed.

Thanks for info, than i waiting for bugfix