Jump to content

  • Log In with Google      Sign In   
  • Create Account


vNeeki

Member Since 16 Jul 2010
Offline Last Active Sep 05 2012 04:15 AM
-----

Topics I've Started

Multitexturing and glBindTexture

27 June 2012 - 09:04 AM

Hello ;)

Lets assume that i have 2 animation sheet textures which i bind this way :

//This is simplified code which simulates the run cycle of my basic texture management class

//Just bind both once
glActiveTexture(GL_TEXTURE0 );
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D,SomeID1);

glActiveTexture(GL_TEXTURE1);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D,SomeID2);

Now what i would like to know is if by switching to different texture layer(ie GL_TEXTURE0,GL_TEXTURE1) the VRAM will contain the last bound texture or if it will contain room for both of them without having to do wasteful uploads...In other words , would something like this work :

bool TexMgr::Bind(const Texture& Tex,int Active)
{
	if (ActiveTexture != Active)
	{
		glActiveTexture(Active ? GL_TEXTURE1 : GL_TEXTURE0);
		glEnable(GL_TEXTURE_2D);
		ActiveTexture = Active;
	}

	if (BoundTexture != Tex.Id)
	{
		glBindTexture(GL_TEXTURE_2D,Tex.Id);
		BoundTexture = Tex.Id;
	}
}


//Test
Bind("Player.png",0);
DrawPlayer();
Bind("PlayerDetail.png",1);
DrawPlayerDetails();

???
Or do i really have to do this:

bool TexMgr::Bind(const Texture& Tex,int Active)
{
	//Force upload(bind) texture aswell!!
	if (ActiveTexture != Active)
	{
		glActiveTexture(Active ? GL_TEXTURE1 : GL_TEXTURE0);
		glEnable(GL_TEXTURE_2D);
		ActiveTexture = Active;
		glBindTexture(GL_TEXTURE_2D,Tex.Id); //Force upload!
	} else if (BoundTexture != Tex.Id)
	{
		glBindTexture(GL_TEXTURE_2D,Tex.Id);
		BoundTexture = Tex.Id;
	}
}

?

Simple Neural Network example(s) with source code ?

30 May 2012 - 11:39 AM

What title says : Are there any simple NN examples with source code to look at ?

I would really like to implement a NN based AI for my game but i just can't figure out how to start so i would appreciate any input on the matter..

Thanks for your time.

Multiple opengl contexts with SDL 1.3

11 April 2012 - 09:56 PM

Hey.

Has anyone managed to get multiple opengl contexts to work with SDL 1.3 ? And if so , is it safe to use more than one contexts at the same time ?

Thanks for looking


Solved , there is an opengl wiki page about it

Rendering lots of pixels 1 by 1 ?

10 April 2012 - 12:44 AM

Hi.

I need to do a couple of heavy writes pixel by pixel and i was wondering which could've been the most efficient approach , since from what i read draw/readPixels functions are deprecated and not supported by GLES which i eventually plan to port my code to.

Any recommendations on how to handle this case?

Setting mipmap level ?

29 March 2012 - 08:08 PM

Hi

I would like to port my opengl renderer to D3D in order to be able to switch between them at runtime , although i hit a wall when attempting to set the mipmap level!

In opengl you just pass in the mipmap level in glXXTexImage2D functions , but D3D texture loader seems to not allow such arguments.

..So i would like to ask if that's possible in D3D(10,11) and if not ...is there any workaround ?

Thanks for looking.

PARTNERS