Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ief015

Pages: [1]
1
Graphics / sf::Text Sub Rectangle
« on: February 08, 2012, 04:33:13 am »
Is there a way to do something similar to sf::Sprite::SetSubRect but for sf::Text?

For example:

I'm making a textbox for my game. There's a problem though;



As you can see, the sf::Text is drawn past the textbox.


I guess this also goes as a request. Any ideas?
Thanks

2
Network / Network binding for .NET?
« on: February 25, 2011, 05:46:22 am »
Wondering if there will ever be a .NET binding for this library. Or is it a WIP?

3
Graphics / GLSL beginner needs help!
« on: December 08, 2010, 10:57:40 pm »
Image here!

I'm a beginner with GLSL, and if you look at the image above, I'm having some issues. D:

The glow looks like it's working just fine, except the strange diagonal tear and strange blocks appearing.

I have two RenderImages, one that renders the shader/glow, and one on top of that one with the points without shading.

The shader RenderImage first uses a shader that "stretches" the pixels horizontally, then it uses a second shader that does the same thing, except horizontally.

Horizontal shader:
Code: [Select]

//HORIZONTAL GLOW

uniform float fadedelta;
/*
//Fading Delta:
float fadedelta = 0f;
for (float i = 0f; i < 10f * glowMul; i++)
fadedelta += (1f - (i / (10f * glowMul)));
fadedelta = 1f / (1f + 2f * fadedelta);
*/

uniform sampler2D img;
uniform float width;
uniform float g; //glow multiplier (glowMul)

void main() {
vec2 step = vec2(1. / width, 0.);
vec4 clr = texture2D(img, gl_TexCoord[0].st);

vec4 c = clr * fadedelta;

float threshold = 10. * g;
for(float i = 0.; i < threshold; i++) {
vec4 c_inc;

c_inc = texture2D(img, gl_TexCoord[0].st + step * i);
c += c_inc * (1. - (fadedelta * i)) * fadedelta;

c_inc = texture2D(img, gl_TexCoord[0].st - step * i);
c += c_inc * (1. - (fadedelta * i)) * fadedelta;
}
gl_FragColor = c * g;
}


Vertical shader:
Code: [Select]

//VERTICAL GLOW

uniform float fadedelta;
/*
//Fading Delta:
float fadedelta = 0f;
for (float i = 0f; i < 10f * glowMul; i++)
fadedelta += (1f - (i / (10f * glowMul)));
fadedelta = 1f / (1f + 2f * fadedelta);
*/

uniform sampler2D img;
uniform float height;
uniform float g; //glow multiplier (glowMul)

void main() {
vec2 step = vec2(0., 1. / height);
vec4 clr = texture2D(img, gl_TexCoord[0].st);

vec4 c = clr * fadedelta;

float threshold = 10. * g;
for(float i = 0.; i < threshold; i++) {
vec4 c_inc;

c_inc = texture2D(img, gl_TexCoord[0].st + step * i);
c += c_inc * (1. - (fadedelta * i)) * fadedelta;

c_inc = texture2D(img, gl_TexCoord[0].st - step * i);
c += c_inc * (1. - (fadedelta * i)) * fadedelta;
}
gl_FragColor = c * g;
}


Thanks for any help. :3

Also if it helps, I'm using C# and the latest build of the SFML 2 .NET binding.
I can post the application source if I need to.

EDIT:

I think I got it

Pages: [1]