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 - nathanchere

Pages: [1]
1
It's the ability to choose the monitor for a fullscreen window. #188
This is already working in SFML.Net :)

2
Graphics / Re: RenderTexture implementation
« on: April 30, 2014, 05:34:21 am »
Aww :( OK thanks.

3
General discussions / Re: SFML Game Development -- A book on SFML
« on: April 30, 2014, 04:00:27 am »
Just want to make sure I'm not re-inventing the wheel here - has anyone else already ported the book samples to SFML.Net yet?

4
Graphics / RenderTexture implementation
« on: April 30, 2014, 03:26:28 am »
Is there a way (short of changing the SFML code and making a new build, which I can't get working at the moment) to force RenderTexture to use RenderTextureImplDefault instead of RenderTextureImplFBO?

5
Graphics / Re: RenderTexture won't clear properly
« on: April 28, 2014, 09:26:51 am »
One last thing... for anyone still looking for a workaround (C#; adapt for C++ or whatever accordingly):

// do all your drawing
// etc..
// right before display:

Shape shittyHack = new RectangleShape(new Vector2f(0,0)){ FillColor = new Color(0,0,0,0) };
Window.Draw(shittyHack);

// and now you may...

Window.Display();
 

I don't normally like playing with C++ code these days but if I can get SFML building at home I'll look into exactly why this is happening and hopefully not require a fake Draw() to make sure the entire RenderTexture is drawn.

6
Graphics / Re: RenderTexture won't clear properly
« on: April 28, 2014, 09:10:13 am »
OK here's what I've got. It's using SFML.Net but I think it gets the point across.

Spike source code:
https://github.com/nathanchere/Spikes_SfmlRenderTexture

Compiled version if you just want to see the shiny:
https://dl.dropboxusercontent.com/u/14432582/sfmlRenderTextureSpike.7z

Main code for the really lazy:
        private void RenderWorking()
        {
            window.Clear(Color.Black);

            textureOne.Clear(Color.White);
            textureOne.Display();

            var renderSprite = new Sprite(textureOne.Texture);

            // Note #2
            // renderSprite.Position = new Vector2f(Mouse.GetPosition(window).X, Mouse.GetPosition(window).Y);

            renderSprite.Draw(window, RenderStates.Default);

            // Note #1
            // window.Display();
        }

        private void RenderBuggy()
        {
            shapeTwo.Position = new Vector2f(Mouse.GetPosition(window).X, Mouse.GetPosition(window).Y);

            textureTwo.Clear();
            textureTwo.Draw(shapeTwo);
            textureTwo.Display();

            window.Clear();
            var renderSprite = new Sprite(textureTwo.Texture);
            window.Draw(renderSprite);
        }

        private void RenderMoreBuggy()
        {
            textureThree.Clear(new Color(
                (byte) (DateTime.Now.Millisecond%128),
                (byte) (DateTime.Now.Millisecond%64),
                (byte) (DateTime.Now.Millisecond%255)
            ));
            textureThree.Display();

            shapeThree.Position = new Vector2f(Mouse.GetPosition(window).X, Mouse.GetPosition(window).Y);
            shapeThree.Rotation = 0.36f*DateTime.Now.Millisecond;
            textureThree.Draw(shapeThree);            

            window.Clear();
            var renderSprite = new Sprite(textureThree.Texture);
            window.Draw(renderSprite);
        }

 

So basically RenderWorking is doing the white-square-in-corner thing, RenderBuggy is the red-square-following-mouse thing,  and RenderMoreBuggy is intended to display the issue better.

Use: press 1 2 and 3 to toggle render mode, Space to toggle displaying text over the top.

Huh? What's the point of the text? Read on...

Observations:

 
  • the white square test works fine, although it's a bad test. Gives a false positive that it's working OK because nothing is changing or moving
  • Uncomment the window.Display() call at Note #1 and you reproduce the flickering someone mentioned earlier in the thread - make sure you're not calling Display on the main render target multiple times in a row?
  • the red square demo replicates the expected buggy result. Main difference with this and the white square demo is that the whole drawing area is a RenderTexture, not just the white square, and there is movement
  • The third demo tries to better highlight how RenderTexture regions which aren't being drawn over do not get updated, even when you use Clear()

The interesting part for me is the main loop:

while (window.IsOpen())
            {
                window.DispatchEvents();
                Render();
               
                if(DisplayText) window.Draw(Text); // Note #3

                window.Display();
            }
 

Render() calls whichever one of the three afore described functions is currently selected. Behaviour is as already described. When drawing text is enabled, suddenly the buggy drawing goes away.

Example:
 


I'm now more inclined to believe yes it really is a bug and not just people "doing it wrong".

{edit} disregard; issue identified will be fixed in SFML 2.2.

7
Graphics / Re: RenderTexture won't clear properly
« on: April 28, 2014, 06:45:31 am »
This is the results of running your code:


I am running the AMD Catalyst 12.8 drivers, which is the current version.

I get the same results using the SFML 2.0 RC.
Graphicscard is also an AMD, but its a 6950.

When it occured within my project i thought it were my fault, but it seems to be a more general problem.

Just my two cents, I still get the same issue with SFML 2.1. I get the red square ghosting, but the FBO teapot demo works fine. Happens consistently on both systems I've tried (one with an Nvidia quadro 3000m and Win7, one with ATI Firepro M3900 and Win8). Issue doesn't occur when writing direct to window, only when using RenderTexture. It seems inconsistent in a multi-monitor scenario, ie the ghosting appears much worse on the non-primary displays.

Is it fair to say this is still an ongoing issue? I don't mind digging in to work out why it's happening as long as it isn't already resolved and I've just missed the relevant post(s).

Pages: [1]
anything