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.


Messages - Mercurialol

Pages: [1]
1
Graphics / Re: Passing multiple textures to the shader
« on: January 06, 2014, 10:49:09 pm »
Well, I'd like to pass different coordinates for different textures. As I can't access m_vertices inside the sf::Sprite, the only alternative I know about is to draw a polygon over my sprite, use the sprite's texture as a mask and finally play with some blend modes.


2
Graphics / Re: Passing multiple textures to the shader
« on: January 05, 2014, 12:53:10 am »
Alright, I decided to play with the source a bit. Can anyone give me a bit of help on the technical stuff about altering the source and making it work? I've read the resources on cmake, static libs, linking, but I must admit my head is becoming a big mess. I just need guidelines, i.e.:
1. Download source
2. Include... whatever
2. Compile... whatever
3. Link... whatever

Thanks in advance

3
Graphics / Passing multiple textures to the shader
« on: January 01, 2014, 01:01:50 pm »
As I was going to ask my question, I saw http://en.sfml-dev.org/forums/index.php?topic=13934.0 on the very top of the forum board, but it didn't actually answer my question.

Enemy get hits by a bullet. I need to apply a debuff. It's basically a color which is masked by a noise texture which then gets masked by the sprite texture. Something like:
 
gl_FragColor= spriteTexture * noiseTexture * color;

To achieve the animation of the debuff, I'd like to animate the noiseTexture rect myself, by moving the rect from... let's say (0.0 , 0.0) , (0.2 , 0.2) to (0.0, 0.8) (0.2, 1.0) - basically just moving the rect slowly down.

Question: I'd need to pass a different rect for the noise texture, and I've done this in the past by simply passing texture coordinates for each vertex separately, in plain OpenGL.

1. Is this achievable in SFML?
2. If not, is there an alternative ?

I was thinking about playing with SFML source a bit (which actually super excites me  ;D ), but I figured I ask you guys before doing any acrobatics.

Btw. I really like SFML and I'm a big supporter. Still waiting for the day it comes on iOS.

Thanks in advance

Mercurial

4
Graphics / Re: Texture size when drawing
« on: January 07, 2013, 08:39:53 pm »
Yeah, that's what it was. The last view I have set - I have basically defined the part of the world I see.

Sorry for that.

Mercurial

5
Graphics / Re: Texture size when drawing
« on: January 07, 2013, 05:26:10 pm »
Yeah my bad about that one. About mapping pixel to coordinates 1:1, I will have to find out what exactly happened... Since when I draw everything on the default view of the render window it was just fine. Before, I had something like (pseudo code):
setView(view1);
drawSomeStuff();
setView(view2);
drawSomeOtherStuff();
and view1 had width of lets say 3/4 of screenSize.width and view2 the left 1/4 and the position was set correctly, but it looked weird and like it didn't map 1:1 pixel to coords. My past experience are some other engines that use views basically as containers which you position, and add sprites as subviews, so maybe I misunderstood the logic here.

 I'm not sure what exactly happened, but I'll try to reformulate my question as soon as I find out.

Mercurial


6
Graphics / Texture size when drawing
« on: January 05, 2013, 07:49:59 am »
Hey all. I'm sorry if the question was already answered, but I couldn't find it using search.

I took a 600x600 px texture and tried to draw it in the default view of a render window of size 600x600 and it was cropped. After a bit of testing, it fit perfectly in a render window with the 750x750 size. I've tried setting the sprite textureRect to 600x600 but nothing changed (probably since the sprite default textureRect is the whole rect).

Render window documentation says video mode size includes title bar and borders, but 150px sounds too much for both.

1.Is the viewCoordinates/pixel ratio 1:1, and if YES what else could be the problem?
2.If the video mode size includes borders and title bar, why does getDefaultView().getSize().x/y return the videoMode size? Shouldn't view show the drawable area size only ? Or the titlebar and borders are also drawable :) ?

Thanks in advance

Mercurial

Pages: [1]