Page 3 of 4

Re: Simple Tile Mirror Plugin

Posted: Fri Jan 19, 2018 22:58
by Joris
No, the new stuff is mostly internal.

But the one Kadete's talking about is just a slider than folds out to reveal two more. You can have the exact same functionality with three sliders, minus the folding part.

Re: Simple Tile Mirror Plugin

Posted: Fri Jan 19, 2018 23:16
by hive8
Got it :) Thank you for the the update, will these new interface option be released so we can use them with the FFGL framework.

Re: Simple Tile Mirror Plugin

Posted: Tue May 01, 2018 15:23
by hive8
Joris wrote:1088 is the size of the texture used by the GPU, because GPUs like working with multiples of 16.

1080 is the last row of pixels containing any actual data. The other 8 rows are just filled with black.

Which pixels contain data is retrievable via GetMaxGLTexCoords. In your case, you'll need to multiply any texture coordinates by the maximum texture coordinates of 0.9926470588 (1080/1088). To be safe, that needs to happen on both the x and y axes (of course using different values for x and y!)
Hi Joris could you give me quick example.

For maxCoords.t i would get 1088 (or what value)
how do i get the texture height the 1080 in my case?

Re: Simple Tile Mirror Plugin

Posted: Tue May 01, 2018 15:35
by Joris
You can get the height of a texture via texture.Height

(how hard are you slapping your forehead right now? ;))

Re: Simple Tile Mirror Plugin

Posted: Tue May 01, 2018 15:39
by Joris
Btw, maxCoords.t will be a fractional value (Height / HardwareHeight), not the actual value in pixels.

Re: Simple Tile Mirror Plugin

Posted: Tue May 01, 2018 17:20
by hive8
Joris wrote:Btw, maxCoords.t will be a fractional value (Height / HardwareHeight), not the actual value in pixels.

So i have the following which does not work

I am getting the hardware height
(float)Texture.HardwareHeight with this

then the Texture.Height

the i calculate like this


float tHeight = Texture.HardwareHeight / Texture.Height;

Which has no effect at all

I even hardcoded the value of 0.99264705882 in the

Code: Select all

	glBegin(GL_QUADS);

	//lower left
	glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 0.0f);
	glVertex2f(-1.0f, -1.0f);

	//upper left
	glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 0.99264705882);
	glVertex2f(-1.0f, 1.0f);

	//upper right
	glMultiTexCoord2f(GL_TEXTURE0, maxCoords.s, 0.99264705882);
	glVertex2f(1.0f, 1.0f);

	//lower right
	glMultiTexCoord2f(GL_TEXTURE0, maxCoords.s, 0.0f);
	glVertex2f(1.0f, -1.0f);
	glEnd();
Nothing as well

Code: Select all

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
	float color[] = { 0.0F, 0.0F, 0.0F, 0.0F };
	glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, color);

	if (m_MIS9) {
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT);
	}
I also have this

My head is bagging really hard against the desk :)

Re: Simple Tile Mirror Plugin

Posted: Tue May 01, 2018 19:46
by Joris
I formatted your text and removed the commented lines to make things easier to read.

So what are you expecting to see and what are you actually seeing? "Nothing" can mean so many things. Which is kind of ironic when you think about it.

Re: Simple Tile Mirror Plugin

Posted: Tue May 01, 2018 19:48
by Joris
float tHeight = Texture.HardwareHeight / Texture.Height;
If you look in the function, this is exactly what GetMaxGLTexCoords does for you. Except it does it the right way round (height/hardwareheight).

Re: Simple Tile Mirror Plugin

Posted: Tue May 01, 2018 21:29
by hive8
Joris wrote:I formatted your text and removed the commented lines to make things easier to read.

So what are you expecting to see and what are you actually seeing? "Nothing" can mean so many things. Which is kind of ironic when you think about it.
Didn't see the formatted text :(

here is what i have after looking at the function which does exactly what i tried to do LOL

Code: Select all

	//draw the quad that will be painted by the shader/textures
	//note that we are sending texture coordinates to texture unit 1..
	//the vertex shader and fragment shader refer to this when querying for
	//texture coordinates of the inputTexure
	glBegin(GL_QUADS);

	//lower left
	// glScalef(1.0F - (m_xScaleS1Tex * 2.0F) + 1.0F, 1.0F - (m_yScaleS1Tex * 2.0F) + 1.0F, 0.0F);
	// glMultiTexCoord2f(GL_TEXTURE0, m_STXS9 - 0.5f, 0.0f);
	glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 0.0f);
	//glVertex2f(-1.0f, -aspect);
	glVertex2f(-1.0f, -1.0f);

	//upper left
	glMultiTexCoord2f(GL_TEXTURE0, 0.0f, maxCoords.t);
	//glVertex2f(-1.0f, aspect);
	glVertex2f(-1.0f, 1.0f);

	//upper right
	glMultiTexCoord2f(GL_TEXTURE0, maxCoords.s, maxCoords.t);
	//glVertex2f(1.0f, aspect);
	glVertex2f(1.0f, 1.0f);

	//lower right
	//glMultiTexCoord2f(GL_TEXTURE0, maxCoords.s * (m_STXS9 - 0.5f), 0);
	glMultiTexCoord2f(GL_TEXTURE0, maxCoords.s, 0.0f);
	//glVertex2f(1.0f, -aspect);
	glVertex2f(1.0f, -1.0f);
	glEnd();
Please HELP LOL my head about to explode.

Re: Simple Tile Mirror Plugin

Posted: Tue May 01, 2018 22:03
by Joris
You realise I don't know what you want to do, right? And that I haven't seen what you're seeing? Posting code is cool, but you're going to have to use words to explain your problem first.