[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Slick Forums • View topic - [ADDED] Managed Shader support

Slick Forums

Discuss the Slick 2D Library
It is currently Mon Jul 06, 2020 2:12 am

All times are UTC




Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Fri Mar 23, 2012 7:50 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
Yes -- org.newdawn.slick.shader is obsolete and incomplete.

Sorry liam -- not trying to "take over" your work. If you want to see specific changes/features to my design I'm open to suggestions. Also if you have any criticisms about it then let me know.


Top
 Profile  
 
PostPosted: Sat Mar 24, 2012 12:21 am 
@davedes Hey, its completely fine. I've realised now the benefits of your implementation.


Top
  
 
PostPosted: Sat Mar 24, 2012 12:48 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482


Top
 Profile  
 
PostPosted: Sat Mar 24, 2012 3:10 pm 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
I guess one vertex shader plus one fragment shader is okay. But we NEED a TestCase for something like horizontal Blur and vertical Blur. I still have issues on how to make it possible to add more then one effect for a postprocessing effect... But as I can see there is no way but to make one source file which implements all the functions :/

I will use them for sure btw. For wave animations and stuff like that :)

_________________
Current Projects:


Projects:
- Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
PostPosted: Sat Mar 24, 2012 6:21 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
Pushed ShaderTestAdvanced which shows a simple way to achieve horizontal/vertical blur. Used this tutorial:
http://www.gamerendering.com/2008/10/11 ... er-shader/

The code is a bit messy -- I'll have to clean it up a little.


Top
 Profile  
 
PostPosted: Sat Mar 24, 2012 7:23 pm 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
I guess we can't hide away the messy code for shaders. For blur I once had another shader which was for backgrounds and works with one pass (without the downside of the texture samplings.

_________________
Current Projects:


Projects:
- Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
PostPosted: Sun Mar 25, 2012 2:22 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
i'd be interested to see that. :) generally speaking blurring in a single pass requires more texture lookups (via texture2D) than blurring in two passes, but i'm sure there are a variety of blur techniques that I'm overlooking...


Top
 Profile  
 
PostPosted: Sun Mar 25, 2012 11:03 am 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
Here you go:
http://pastebin.com/EMB1n2ay

I'M not exaclty sure who it works but it blur pretty well (Could not find out ho to change the the strengh of the blur). I don't even know where I have this code from xD

_________________
Current Projects:


Projects:
- Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
PostPosted: Sun Mar 25, 2012 9:02 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
From what I gather online and in IRC channels it's not worth the trouble to have "reusable" shaders, or having multiple shaders attach to the same program. Especially because there is no performance/memory benefits of separating shader and program creation: all of the compiling is done when you link the programs. Also this is likely to introduce problems on certain drivers that don't fully support it. I will include a static validate method for users who want to validate a shader without having to create a new program.

Unless anybody strongly feels that they need "reusable" shaders, I will revert to my first draft (no Shader class, just a ShaderProgram which attaches and links everything on construction).

EDIT: Deleted Shader, made ShaderProgram all you need. Advanced users who want to handle compile/link/attach separately can override the empty constructor and use the protected methods.


Top
 Profile  
 
PostPosted: Mon Mar 26, 2012 7:58 am 
Offline
Regular

Joined: Sun Oct 30, 2011 4:47 pm
Posts: 184
Location: Mittweida, Saxony, Germany
The only advantage I can see, if I understand everything correctly is that you could implement the Shader as DeferredResource. So the sources of the shaders can be load by any thread during the loading process but the linking is done is the thread that controls OpenGL.

I have no clue how long it takes to compile the shaders. Is it possible to read compiled shaders back and store them as a sort of cache for the local maschine?

Other then that... I "like" the current implementation. My subjective impression of it. Its a nice clear and exspecially selfexplaining structure. In case there are no major disadvantages I would keep it as it is.

Nitram


Top
 Profile  
 
PostPosted: Mon Mar 26, 2012 8:40 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482


Top
 Profile  
 
PostPosted: Mon Mar 26, 2012 9:53 pm 
Offline
Regular

Joined: Sun Oct 30, 2011 4:47 pm
Posts: 184
Location: Mittweida, Saxony, Germany


Top
 Profile  
 
PostPosted: Mon Mar 26, 2012 11:36 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482


Top
 Profile  
 
PostPosted: Tue Mar 27, 2012 7:00 am 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
Loading is not import imho. If you look on games you often see that shaders are compiled and linked at game start. Benchmarking loading time is imho not as important as FPS, meaning how fast works the shader.
Anyway, I'm okay with all. Seems like having a Shader class is really useless xD I thought it might be a good idea but well :D

If the extension does not work for you it's possible that it does not work on other pc too So I say drop that since I really think if a dev wants something like this he can make it himself just like most of us create their own Ressoure class for ref images/sounds etc.

_________________
Current Projects:


Projects:
- Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
PostPosted: Tue Mar 27, 2012 7:46 am 
Offline
Regular

Joined: Sun Oct 30, 2011 4:47 pm
Posts: 184
Location: Mittweida, Saxony, Germany


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group