Page 1 of 1

I haz a pixelshader (and this is a blogpost)

Posted: 08 Dec 2011, 07:36
by knorke
Actually I have no idea how this happend, seeing how I just woke up, brushed my teeth, and made this between 2 bowls of cereal.
Image
different, bigger image png blabla

It looks excactly like the placeholder loadscreens I was using which is just great and seems to be easy on cpu.
Image

Basically just wanted to collect some links for later never reading and looked at the blur shader of zeroK and outline widgt and did not understand what was going on.
Then I searched forum for "screencopy" which in hindsight does not even make sense since it is just a arbitrarily chosen name.
First result:
Even cruder--screencopy to texture -> TexRect with shader.
So that that is how this works.

So got that obama shader from Evil4Zerggin, from whose thread the result was.

changed glTexRect(0,vsy,vsx,0) to glTexRect(500,vsy,vsx,0)
and it was only rendering the shader on half the screen. :arrow: aha.
Looked at the code of the shader and appearently you just change frag_Color to something and it gets used for that pixel?
Image
Then blue and red and black screeens.

After that, making the actual shader was easy:

Code: Select all

local fragmentShaderSource = [[
uniform sampler2D screencopy;
void main() {
	int pixzelSize = 10; //why cant this be rand() % 10
	float pixelx = pixzelSize/1600.0f;	// ***get real up in this bitch
	float pixely = pixzelSize/1200.0f;	
	vec2 texCoord = vec2(pixelx*int(gl_TexCoord[0].x/pixelx), pixely*int(gl_TexCoord[0].y/pixely));
	gl_FragColor = texture2D(screencopy, texCoord);
}
]]
It also pixelizes some stuff it shoudnt, like selection rectangles but I guess that is just a matter of finding the correct widget:DrawPrexxxx variante.
Gotta get down to the bus stop.

tl;dr
Spring now looks like it is from 1997.
Image
Thanks to Evil4Zerggin for posting his shader example!
Seems like a good base to experiment with.

Re: I haz a pixelshader (and this is a blogpost)

Posted: 08 Dec 2011, 08:11
by PicassoCT
Knorke... you still ahead of me. Now need to write my own shaders :( And i dont even have whole game yet.



I still think all this retro is just a ubertroll trying to get to the engineers at intel and amd.

Re: I haz a pixelshader (and this is a blogpost)

Posted: 08 Dec 2011, 08:18
by Beherith
Nice stuff, epic C&C look :D
Read the glsl orange book. Its kinda short - can be read on a weeks worth of commutes to work and back. And will open your eyes to some crazy possiblities.

Also, this whitepaper http://www710.univ-lyon1.fr/~jciehl/Pub ... ES2005.pdf
Is a very newbie friendly way of going over some stuff in current shading techniques - like how you can render different aspects like normals, color and depth to buffers and do some insane post processing. It will make you go AHA and OMGWTFTHISISAWESOME so many times it will make your head spin.

From the paper:

Image

Re: I haz a pixelshader (and this is a blogpost)

Posted: 08 Dec 2011, 19:38
by knorke
shaders add 60% to game completness (and can make it go over 100%)

Book and pdf look good. I think first I should learn some more basic open gl things but will remember them for after that.

Re: I haz a pixelshader (and this is a blogpost)

Posted: 08 Dec 2011, 20:19
by PicassoCT
Insolence, you shall repent this outrage!
omg: Knorke haz shaderz! Then i must have shaderz as well! We the UnitedPicassoRepublics (U.P.R.s) shall arm up, and win this armsrace!

By the way looking back when i started, i learned some incredible stuff here. Maybee we should do that to the nubs, instead of bashing, show them the travell_List. People who started low, and how far they went and how much they accomplished. Take a sarcastic, baiting Smoth, and use him as Figurehead!

Re: I haz a pixelshader (and this is a blogpost)

Posted: 08 Dec 2011, 20:30
by smoth
Beherith wrote:Read the glsl orange book.
OpenGL Shading Language (3rd Edition)
^ that one? that thing is huge man!

Re: I haz a pixelshader (and this is a blogpost)

Posted: 08 Dec 2011, 21:38
by PicassoCT
this sort of read recommendation is given to the same sort of people who get always into public work programs - or free playstations games.

Best thing to get that sort of the street for some time, better for them and especially for public mental safety.

Now that i think about it, i always get books recomended if i talk to people on a prolonged basis :D

Re: I haz a pixelshader (and this is a blogpost)

Posted: 08 Dec 2011, 21:48
by KaiserJ
man i haven't a clue how shaders work but i really love the pixelly look

Re: I haz a pixelshader (and this is a blogpost)

Posted: 08 Dec 2011, 21:58
by PicassoCT
you get this itch to write
c:\config.sys

and start to free memory. Looking at this, out there, somewhere, a GhraphicsCard Engineer gets suicidal :D

Re: I haz a pixelshader (and this is a blogpost)

Posted: 19 Dec 2011, 11:53
by Cheesecan
Looks cool, now you could make minecraft spring.

Re: I haz a pixelshader (and this is a blogpost)

Posted: 18 Mar 2013, 18:11
by Zealot
What needs to be done to implement shaders like these in game?

Also has anyone come up with a cel or toon shader?

What would be involved in making one?


Thanks

Re: I haz a pixelshader (and this is a blogpost)

Posted: 18 Mar 2013, 20:26
by knorke

Re: I haz a pixelshader (and this is a blogpost)

Posted: 18 Mar 2013, 21:58
by SanadaUjiosan
Yay CT link.

It should be noted this widget can be a bit tough on your PC. I don't have a powerful computer by any means, but it is not a piece of junk either. I don't play with this widget due to some choppiness when there are a lot of units on screen.

Knorke I really like your example image.