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

Pages: [1] 2 3
1
DotNet / Re: How to use Opengl 3.x in SFML
« on: April 24, 2016, 04:00:35 pm »
Cheers

2
DotNet / Re: How to use Opengl 3.x in SFML
« on: April 24, 2016, 01:01:30 pm »
Maybe my questions wasnt very clear.
I want to know if I have to use low level opengl in order to use version higher than 120, because after 120 things like gl_TexCoord or gl_ModelViewProjectionMatrix are deprecated. So you have to pass them to the shader manually.

3
DotNet / Re: Multi-threaded rendering SFML .net
« on: April 21, 2016, 10:15:15 am »
Oh ok, I thought the sfml thread did some specific sfml work under the hood as well.
I'm not very experienced with threads  ::)

4
DotNet / Multi-threaded rendering SFML .net
« on: April 21, 2016, 09:21:33 am »
Hello,

I want to create a loading screen with SFML .NET.
I read this:

http://www.sfml-dev.org/tutorials/2.0/graphics-draw.php

but there's no sfml thread in C# version of SFML.
or do I need to add some another module to my project?

5
DotNet / How to use Opengl 3.x in SFML
« on: April 16, 2016, 10:13:56 pm »
Hello, I'm trying to modify the standard vertex and fragment shader to be used with version 330.
Is it possible to do this without directly using opengl?

This is the vertex shader I'd like to use:

#version 330 core

layout(location = 0) in vec2 in_position;
layout(location = 1) in vec3 in_color;
layout(location = 2) in vec2 in_tex_coord;

out vec4 v2f_color;
out vec2 v2f_tex_coord;

uniform mat4 mvp;

void main()
{
    gl_Position = mvp * vec4(in_position.x, in_position.y, 0, 1);
        v2f_color = vec4(in_color, 1);
        v2f_tex_coord = in_tex_coord;
}

I draw to the render window using the VertexArray class.
Is it possible to get the model view projection matrix and send it to the shader?
Also, how would I go about sending "in" values to the vertex shader using sfml?

Or do I just have to go back to version 120 in order to not be bothered directly with opengl?

6
DotNet / Re: Audio Listener doenst seem to be working.
« on: April 02, 2016, 12:08:13 pm »
Im sorry, I made a mistake. After drawing the listener position I found out that it was in the wrong place, I have now put it to the center of my view instead of the position of my view and now it works.

Thanks for your time, sorry I wasted it  :-\

7
DotNet / Re: Audio Listener doenst seem to be working.
« on: April 02, 2016, 10:34:08 am »
Oh I misunderstood the name of that property, I've set it to false but I still don't hear anything unless I put the Attunuation to 0.001f, but then the distance isnt as influencial and the sound is still really soft even when the listener is really close. Is it correct that I'm putting the Y values into the Z position (I saw this in a tutorial)?

8
DotNet / [Solved] Audio Listener doenst seem to be working.
« on: April 01, 2016, 10:56:44 pm »
I'm trying to use the Listener in a 2D world.
I have a mono channel .WAV sound buffer which I play through a Sound.

            s.Position = new Vector3f(position.X, 0.0f, position.Y);
            s.Attenuation = 1.0f;
            s.RelativeToListener = true;
            s.Play();
 

I have set the Listener.Position to the same position as the Sound.
But I hear nothing, only when I make Attenuation 0.001 I hear something softly, but then it doesnt seem to matter what the Sound's position is. Even when I make the difference huge, the sound remains the same volume through my speakers.
Also, the Listener.GlobalVolume is set to 100.0f

Am I doing something wrong here?

9
DotNet / Re: High CPU usage with very basic SFML program
« on: March 24, 2016, 07:41:12 pm »
OK, it seems like it runs fine on my laptop, only using 0,4% cpu at 60fps.
Don't really understand whats wrong with my pc then.

10
DotNet / Re: High CPU usage with very basic SFML program
« on: March 24, 2016, 04:54:30 pm »
Hmm, I just updated my gfx driver and closed any possible graphical process in the background but it didnt make any difference.

I dont know if it's usefull info but I have a Nvidia GeForce GTX 970 in my desktop.
I will try running on my laptop later today, see if that makes a difference.

11
DotNet / Re: High CPU usage with very basic SFML program
« on: March 24, 2016, 12:58:31 pm »
Thanks for your reply,

So, apparantly it has something to do with Vsync alone, when I set framerate limit to 60 but dont set vsync, it uses almost no CPU.
However, setting vsync to true and not setting framerate limit still keeps the CPU usage to 25%

Also maybe noteworthy, when I dont set frame limit or vsync, it runs around 8000 fps but uses LESS cpu than it would when I set vsync to true and running on 60 fps.

12
DotNet / Re: Box2DX and SFML .Net
« on: March 24, 2016, 03:40:40 am »
I tried using Box2DX at first, I got strange assertion failures when creating polygon colliders.

I now use Farseer physics, which works like a charm!
It is based on box2d but has some additional features and is written in C#.
I just changed the source abit (replaced all namespace Microsoft.Xna.Framework with Farseer)
That way it has nothing to do with XNA anymore (not that it did, was just a namespace).

https://farseerphysics.codeplex.com/

p.s. if anyone is interested, I wrote a SFML version of the debug view thing.

http://pastebin.com/L8jsKq9n

Just use your render window instead of m_game.m_Window

13
DotNet / High CPU usage with very basic SFML program
« on: March 24, 2016, 03:13:22 am »
I have really high cpu usage (max for 1 core) for my sfml program.
At first I thought it was something in my framework but the profiler showed that 97% of all performance came from external code.
So I created a very basic SFML program and I have the same issue:



Yellow text is Fraps, confirming the program runs with 60 fps.
The only way I get the cpu to calm down abit is by manually letting the thread goto sleep, but even then its using way more than I would expect.

Any thoughts?

14
DotNet / SetParameter not working with integer
« on: March 17, 2016, 02:15:07 am »
Hello again  ;D

A while ago I posted this thread on C++ side of SFML:

http://en.sfml-dev.org/forums/index.php?topic=19872.msg143047#msg143047

I had problems using integers with shader->SetParameter. People suggested me to build the latest version of the SFML source and use the new functino: SetUniform instead.
This worked, however, SFML .NET version seems to have to old SetParameter function, and the problem I had in my previous post has returned.

Are there any plans of updating the .NET version to SetUniform as well?

Thanks,

Rob

15
I just noticed the ToString in the source, I can use this, parse the string and get the values ><

public override string ToString()
            {
                return string.Format("[Transform]" +
                       " Matrix(" +
                       "{0}, {1}, {2}," +
                       "{3}, {4}, {5}," +
                       "{6}, {7}, {8}, )",
                       m00, m01, m02,
                       m10, m11, m12,
                       m20, m21, m22);
            }

            float m00, m01, m02;
            float m10, m11, m12;
            float m20, m21, m22;

I'm joking of course, I figured another way to calculate it.

Pages: [1] 2 3