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

Pages: [1]
1
General / sf::priv and Linker Problems
« on: December 05, 2013, 04:09:56 pm »
I'm making a 3d engine on top of SFML so I have to basically remake SFML/Graphic in 3D.
This takes for the most part a lot of copy pasting of original SFML code and making some little changes to it.
I've made a RenderTexture3 (3 for 3D  :P) class and everything compiles just right but I get some linker error on the Texture implementations that are in sf::priv namespace:
error LNK2019: unresolved external symbol "public: __thiscall
sf::priv::RenderTextureImplFBO::RenderTextureImplFBO(void)" (??
0RenderTextureImplFBO@priv@sf@@QAE@XZ) referenced in function "public: bool __thiscall
RenderTexture3::create(unsigned int,unsigned int,bool)" (?create@RenderTexture3@@QAE_NII_N@Z)

error LNK2019: unresolved external symbol "public: static bool __cdecl
sf::priv::RenderTextureImplFBO::isAvailable(void)" (?isAvailable@RenderTextureImplFBO@priv@sf@@SA_NXZ)
 referenced in function "public: bool __thiscall RenderTexture3::create(unsigned int,unsigned int,bool)" (?
create@RenderTexture3@@QAE_NII_N@Z)

error LNK2019: unresolved external symbol "public: __thiscall
sf::priv::RenderTextureImplDefault::RenderTextureImplDefault(void)" (??
0RenderTextureImplDefault@priv@sf@@QAE@XZ) referenced in function "public: bool __thiscall
RenderTexture3::create(unsigned int,unsigned int,bool)" (?create@RenderTexture3@@QAE_NII_N@Z)

And the responsible code part (basically the same as in sf::RenderTexture)
        // Create the implementation
        delete impl_;
        if (sf::priv::RenderTextureImplFBO::isAvailable())
        {
                // Use frame-buffer object (FBO)
                impl_ = new sf::priv::RenderTextureImplFBO();
        }
        else
        {
                // Use default implementation
                impl_ = new sf::priv::RenderTextureImplDefault();
        }

        // Initialize the render texture
        if (!impl_->create(width, height, tex_.m_texture, depthBuffer))
                return false;

I've asked Laurent quite long ago about a similar problem with glcheck.
He told me to make a new class for that and I did.
This time I don't want to make a new class, mostly because I will have to recreate a whole group of classes and update them myself later, which goes against my goal of basing my engine on SFML and only updating the relevant parts.

I hope someone here can help me ;)

2
Graphics / Making 3D SFML
« on: May 09, 2013, 04:38:29 pm »
Over the last month or so I have been trying to make a 3D SFML-like thing (with SFML as the base).

Today I ran into a problem with GLEW while making a 3D version of RenderTarget. I'm not sure which libraries to link/ not link.
Currently I'm only linking the extlibs/libs-msvc/glew.lib (and the standard sfml libs), but it still gives linker errors:

Error   2       error LNK2019: unresolved external symbol "void __cdecl sf::priv::ensureGlewInit(void)" (?ensureGlewInit@priv@sf@@YAXXZ) referenced in function "public: void __thiscall RenderTarget3::resetGLStates(void)" (?resetGLStates@RenderTarget3@@QAEXXZ)     C:\Users\SVS\documents\visual studio 11\Projects\Project1\Project1\RenderTarget3.obj    Project1

Error   3       error LNK2001: unresolved external symbol __imp____glewBlendEquation    C:\Users\SVS\documents\visual studio 11\Projects\Project1\Project1\RenderTarget3.obj    Project1

Error   4       error LNK2001: unresolved external symbol __imp____glewUseProgramObjectARB      C:\Users\SVS\documents\visual studio 11\Projects\Project1\Project1\RenderTarget3.obj    Project1

Error   5       error LNK2001: unresolved external symbol __imp____glewBlendFuncSeparateEXT     C:\Users\SVS\documents\visual studio 11\Projects\Project1\Project1\RenderTarget3.obj    Project1

Error   6       error LNK2001: unresolved external symbol __imp____GLEW_EXT_blend_func_separate C:\Users\SVS\documents\visual studio 11\Projects\Project1\Project1\RenderTarget3.obj    Project1

Error   7       error LNK1120: 5 unresolved externals   C:\Users\SVS\documents\visual studio 11\Projects\Project1\Debug\Project1.exe    Project1
 
Any help would be very appreciated :)

3
I'm currently using a vertexArray for the tile map in my game.
However it is very bothersome and confusing to calculate the offsets in the array (it's basically a 4d array).
I've tried using nested vectors (vector<vector<vector<Vertex> > > verts) and dynamically allocated array (starting with Vector*** verts and so on) but when I pass either into the draw function like this
((Vertex*)&verts[0],*number of vertexes*, sf::Quads) my app crashes...

I'm pretty sure it's due to the fact that vectors/allocated arrays are not contiguous... can I do this in some other way?  :(

4
Feature requests / full vector functionality for vertexArray
« on: May 02, 2012, 06:19:26 pm »
Just thought, since vertexArray is basically a vector<Vertex>, why not add all the functionality, like insert, remove and so on.
It's really easy to do and quite damn useful  :)

Also a side question: do all the vertices in the draw call get stored into a VBO?

5
Graphics / Smoothly rendered vertexArrays?
« on: May 01, 2012, 09:29:49 pm »
I was doing this http://drilian.com/2009/02/25/lightning-bolts/ using vertexArray for rendering, but I ran into a problem: vertexArrays don't seem to render smoothly.

Is there any way to fix this?

6
Graphics / Parts of a RenderTexture + Weird shader/blendmode bug
« on: April 14, 2012, 02:26:43 pm »
1) I need to reuse parts of a single renderTexture as Textures, so I was wondering how can you do it in SFML?
(or do I actually have to code it in openGL? getTexture(sf::Rect) would be nice :P)

2) I also found a weird bug... or maybe it's just my GPU
Anyway, I'm basically multiplying the renderTexture over itself and shifting it every time upwards by 1, 2, 4, 8 and so on pixels. For some reason the renderTexture starts "banding" and multiplying itself much further and some weird artifacts appear:

I've tried both shaders and just using BlendMultiply, but the effect perseveres.
But it might be just my GPU... laptop Intel GPUs are shit.

But if anyone knows a better and faster way to "bleed" or smear pixels, I would really appreciate if you'd tell me about it :)

7
Graphics / Drawing with shader = only quarter of the screen
« on: April 06, 2012, 08:13:18 pm »
I've been using the following sample vertex and frag shaders (comments are not mine):
VERTEX:
varying vec2 vTexCoord;
 
// remember that you should draw a screen aligned quad
void main(void)
{
   //gl_Position = ftransform();
 
   // Clean up inaccuracies
   vec2 Pos;
   Pos = sign(gl_Vertex.xy);
 
   gl_Position = vec4(Pos, 0.0, 1.0);
   // Image-space
   vTexCoord = Pos * 0.5 + 0.5;
}
FRAGMENT:
uniform sampler2D RTBlurH; // this should hold the texture rendered by the horizontal blur pass
varying vec2 vTexCoord;
 
const float blurSize = 1.0/512.0;
 
void main(void)
{
   vec4 sum = vec4(0.0);
 
   // blur in y (vertical)
   // take nine samples, with the distance blurSize between them
   sum += texture2D(RTBlurH, vec2(vTexCoord.x, vTexCoord.y - 4.0*blurSize)) * 0.05;
   sum += texture2D(RTBlurH, vec2(vTexCoord.x, vTexCoord.y - 3.0*blurSize)) * 0.09;
   sum += texture2D(RTBlurH, vec2(vTexCoord.x, vTexCoord.y - 2.0*blurSize)) * 0.12;
   sum += texture2D(RTBlurH, vec2(vTexCoord.x, vTexCoord.y - blurSize)) * 0.15;
   sum += texture2D(RTBlurH, vec2(vTexCoord.x, vTexCoord.y)) * 0.16;
   sum += texture2D(RTBlurH, vec2(vTexCoord.x, vTexCoord.y + blurSize)) * 0.15;
   sum += texture2D(RTBlurH, vec2(vTexCoord.x, vTexCoord.y + 2.0*blurSize)) * 0.12;
   sum += texture2D(RTBlurH, vec2(vTexCoord.x, vTexCoord.y + 3.0*blurSize)) * 0.09;
   sum += texture2D(RTBlurH, vec2(vTexCoord.x, vTexCoord.y + 4.0*blurSize)) * 0.05;
 
   gl_FragColor = sum;
}

The shader works, but when I draw a full-screen sprite with it, only the top-right quarter of the sprite gets drawn:


Any ideas?

8
General / Shaders and SFML: Has anyone got a good tutorial?
« on: April 04, 2012, 08:52:51 pm »
I'm trying to understand how to use shaders with SFML renderTextures and so on.
But no luck so far  :(

I'd be very grateful if anyone would be awesome enough to explain it or post a link to a good tutorial ;)

Pages: [1]