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

Pages: [1]
1
General / OpenGL: Use depth buffer from Gbuffer in default framebuffer
« on: August 07, 2014, 03:13:20 pm »
So I am making a deferred rendering application with OpenGL. After doing the geometry and light passes I want to render some particles. But I need some depth testing on those. So what I want to do is to use the depth buffer binded to my GBuffer to do some depth testing when drawing to the default OpenGL framebuffer.

I make and bind the depth buffer/texture to the framebuffer/GBuffer like this
glGenTextures(1, &_depthTextureID);
glBindTexture(GL_TEXTURE_2D, _depthTextureID);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, _width, _height, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, nullptr);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE);
glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, _depthTextureID, 0);

My question then is: How do I bind the Gbuffer depth buffer to the default framebuffer for depth testing on the geometry pass?

2
General / Problem with uniform in GLSL shader
« on: August 05, 2014, 09:55:32 pm »
So right now I'm playing around with some OpenGL stuff. Well I'm trying to make a deferred rendering application to better learn what deferred rendering is and how it works. But I have a wierd problem. I think it may be some kind of problem with the size of different floats. Hmm but well here we go with some code.

First of all I create my textures and add them to a framebuffer.
(click to show/hide)

And my fragment shader look like this.
(click to show/hide)

But I have problem when I'm setting "texCoords" right after main in my fragment shader. When using an uniform to pass the values. If I use the uniform I get the first and bad looking image attachment. If I just hard code the value instead of using the uniform, I get the second and good looking image attachment.

And function for setting the uniform look like so.
(click to show/hide)

So are there any out there on this forum that may have an idea why this happens?

3
Network / Unresolved external from static library Visual Studio 2013
« on: March 18, 2014, 10:28:28 pm »
Hi!

I've upgraded my visual studio to 2013 lately and have been recompiling the libraries.
Everything have been working like a charm, untill i tried to use a class from the network library ...  :(

I'm linking it correctly with "sfml-network-s-d.lib", "SFML_STATIC" and so on..

I get no error compiling SFML in Visual Studio 2013.

I dont have a log on this computer, but i it's just ALOT of unresolved externals. Nothing about "__declspec(dllimport". Its like the whole static library is broken, but the library is being compiled without any error.

Anyone who have a idea whats wrong? The only idea I have right now is going back to Visual Studio 2012 and use the precompiled libraries.

UPDATE:

Here is a simple test code
#include <SFML\Network.hpp>

int main()
{
        sf::TcpSocket socket;
        return 0;
}

Here is my log
Error   1       error LNK2019: unresolved external symbol __imp__setsockopt@20 referenced in function "protected: void __thiscall sf::Socket::create(unsigned int)" (?create@Socket@sf@@IAEXI@Z)        C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(Socket.obj)      Testing
Error   2       error LNK2019: unresolved external symbol __imp__socket@12 referenced in function "protected: void __thiscall sf::Socket::create(void)" (?create@Socket@sf@@IAEXXZ)     C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(Socket.obj)      Testing
Error   3       error LNK2001: unresolved external symbol __imp__socket@12      C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(IpAddress.obj)   Testing
Error   4       error LNK2019: unresolved external symbol __imp__connect@12 referenced in function "public: enum sf::Socket::Status __thiscall sf::TcpSocket::connect(class sf::IpAddress const &,unsigned short,class sf::Time)" (?connect@TcpSocket@sf@@QAE?AW4Status@Socket@2@ABVIpAddress@2@GVTime@2@@Z)    C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(TcpSocket.obj)   Testing
Error   5       error LNK2001: unresolved external symbol __imp__connect@12     C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(IpAddress.obj)   Testing
Error   6       error LNK2019: unresolved external symbol __imp__getpeername@12 referenced in function "public: class sf::IpAddress __thiscall sf::TcpSocket::getRemoteAddress(void)const " (?getRemoteAddress@TcpSocket@sf@@QBE?AVIpAddress@2@XZ)      C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(TcpSocket.obj)   Testing
Error   7       error LNK2019: unresolved external symbol __imp__getsockname@12 referenced in function "public: unsigned short __thiscall sf::TcpSocket::getLocalPort(void)const " (?getLocalPort@TcpSocket@sf@@QBEGXZ) C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(TcpSocket.obj)   Testing
Error   8       error LNK2001: unresolved external symbol __imp__getsockname@12 C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(IpAddress.obj)   Testing
Error   9       error LNK2019: unresolved external symbol __imp__htonl@4 referenced in function "public: enum sf::Socket::Status __thiscall sf::TcpSocket::send(class sf::Packet &)" (?send@TcpSocket@sf@@QAE?AW4Status@Socket@2@AAVPacket@2@@Z)        C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(TcpSocket.obj)   Testing
Error   10      error LNK2001: unresolved external symbol __imp__htonl@4        C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(SocketImpl.obj)  Testing
Error   11      error LNK2001: unresolved external symbol __imp__htonl@4        C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(IpAddress.obj)   Testing
Error   12      error LNK2001: unresolved external symbol __imp__htonl@4        C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(Packet.obj)      Testing
Error   13      error LNK2019: unresolved external symbol __imp__ntohl@4 referenced in function "public: class sf::IpAddress __thiscall sf::TcpSocket::getRemoteAddress(void)const " (?getRemoteAddress@TcpSocket@sf@@QBE?AVIpAddress@2@XZ)     C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(TcpSocket.obj)   Testing
Error   14      error LNK2001: unresolved external symbol __imp__ntohl@4        C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(IpAddress.obj)   Testing
Error   15      error LNK2001: unresolved external symbol __imp__ntohl@4        C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(Packet.obj)      Testing
Error   16      error LNK2019: unresolved external symbol __imp__ntohs@4 referenced in function "public: unsigned short __thiscall sf::TcpSocket::getLocalPort(void)const " (?getLocalPort@TcpSocket@sf@@QBEGXZ)        C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(TcpSocket.obj)   Testing
Error   17      error LNK2001: unresolved external symbol __imp__ntohs@4        C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(Packet.obj)      Testing
Error   18      error LNK2019: unresolved external symbol __imp__recv@16 referenced in function "public: enum sf::Socket::Status __thiscall sf::TcpSocket::receive(void *,unsigned int,unsigned int &)" (?receive@TcpSocket@sf@@QAE?AW4Status@Socket@2@PAXIAAI@Z)       C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(TcpSocket.obj)   Testing
Error   19      error LNK2019: unresolved external symbol __imp__select@20 referenced in function "public: enum sf::Socket::Status __thiscall sf::TcpSocket::connect(class sf::IpAddress const &,unsigned short,class sf::Time)" (?connect@TcpSocket@sf@@QAE?AW4Status@Socket@2@ABVIpAddress@2@GVTime@2@@Z)     C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(TcpSocket.obj)   Testing
Error   20      error LNK2019: unresolved external symbol __imp__send@16 referenced in function "public: enum sf::Socket::Status __thiscall sf::TcpSocket::send(void const *,unsigned int)" (?send@TcpSocket@sf@@QAE?AW4Status@Socket@2@PBXI@Z) C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(TcpSocket.obj)   Testing
Error   21      error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function "public: static void __cdecl sf::priv::SocketImpl::close(unsigned int)" (?close@SocketImpl@priv@sf@@SAXI@Z)       C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(SocketImpl.obj)  Testing
Error   22      error LNK2019: unresolved external symbol __imp__ioctlsocket@12 referenced in function "public: static void __cdecl sf::priv::SocketImpl::setBlocking(unsigned int,bool)" (?setBlocking@SocketImpl@priv@sf@@SAXI_N@Z)   C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(SocketImpl.obj)  Testing
Error   23      error LNK2019: unresolved external symbol __imp__htons@4 referenced in function "public: static struct sockaddr_in __cdecl sf::priv::SocketImpl::createAddress(unsigned int,unsigned short)" (?createAddress@SocketImpl@priv@sf@@SA?AUsockaddr_in@@IG@Z)        C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(SocketImpl.obj)  Testing
Error   24      error LNK2001: unresolved external symbol __imp__htons@4        C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(Packet.obj)      Testing
Error   25      error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function "public: __thiscall sf::priv::SocketInitializer::SocketInitializer(void)" (??0SocketInitializer@priv@sf@@QAE@XZ)   C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(SocketImpl.obj)  Testing
Error   26      error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function "public: __thiscall sf::priv::SocketInitializer::~SocketInitializer(void)" (??1SocketInitializer@priv@sf@@QAE@XZ)  C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(SocketImpl.obj)  Testing
Error   27      error LNK2019: unresolved external symbol __imp__WSAGetLastError@0 referenced in function "public: static enum sf::Socket::Status __cdecl sf::priv::SocketImpl::getErrorStatus(void)" (?getErrorStatus@SocketImpl@priv@sf@@SA?AW4Status@Socket@3@XZ)    C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(SocketImpl.obj)  Testing
Error   28      error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function "unsigned int __cdecl `anonymous namespace'::resolve(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?resolve@?A0xffb3341e@@YAIABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)       C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(IpAddress.obj)   Testing
Error   29      error LNK2019: unresolved external symbol __imp__inet_ntoa@4 referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall sf::IpAddress::toString(void)const " (?toString@IpAddress@sf@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)    C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(IpAddress.obj)   Testing
Error   30      error LNK2019: unresolved external symbol __imp__getaddrinfo@16 referenced in function "unsigned int __cdecl `anonymous namespace'::resolve(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?resolve@?A0xffb3341e@@YAIABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)    C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(IpAddress.obj)   Testing
Error   31      error LNK2019: unresolved external symbol __imp__freeaddrinfo@4 referenced in function "unsigned int __cdecl `anonymous namespace'::resolve(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?resolve@?A0xffb3341e@@YAIABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)    C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Testing\sfml-network-s-d.lib(IpAddress.obj)   Testing
Error   32      error LNK1120: 21 unresolved externals  C:\Users\Peter Bech\documents\visual studio 2013\Projects\Testing\Debug\Testing.exe     Testing
 

Pages: [1]