Age Verification
This website contains age-restricted material including nudity and explicit content. By entering, you confirm being at least 18 years old or the age of majority in the jurisdiction you are accessing the website from.
I am 18+ or older - Enter
I am under 18 - Exit
Our parental controls page explains how you can easily block access to this site.

Последние сообщения - Страница 288

  Форум

TheEmu
Присоединился в Jul 2012
7424 Сообщения

Discussions for Scenes for Version 1.2.X Fullscreen Mode here

Всё о iStripper
26 January 2023, 5111 Ответы
Just needed to add this:

#define texture2D texture2D_Fract

(Whatever that is)

That is a pre-processor directive that defines a simple text macro substitution.

It causes any use of the name "texture2D" that is encountered later in the source fle to be replaced by "texture2D_Fract"

texture2D_Fract is a locally defined function that is used as a wrapper around the standard GLSL function "texture" that uses only the fractional parts of the position coordinates, P, passed to it to identify which point is being sampled.

The result of the standard GLSL function texture() is only defined when both coordinates are in the range 0.0 to 1.0 (actually I think the condition might be greater than or equal to 0.0 and less than 1.0 which would exclude 1.0 from the valid range). How the function behaves when fed values outside of this range is implementation dependant, some clamp the values so that any out of range value is treated as either 0,0 or 1.0 while others discard the integer part of the value and just use the fractional part. Using texture2D_Fract either directly or via texture2D macro ensures that the second of these variations is used. This means that "wrap around" semantics are used for out of range values.


Some history. The texture2D() function is an old, deprecated, part of the GLSL language having been superceded by the newer texture() function. By defining a macro near the start of the shader source file we can effectively replace all uses of the deprecated function with the newer function without having to edit the body of the shader. At the same time this macro also eliminates the ambiguity as to what happens if the function is passed an out of range value for the texel position (I can say this with certainty as I was the person who introduced this way of using macros to adapt shadertoy shaders for iStripper - for example on my system the texture() function clamps the position coordinates but quite a few of the shadertoy shaders assumed wrapping semantics)
dolphins109
Присоединился в Feb 2011
1834 Сообщения
JayZ971
MODERATOR
Присоединился в Mar 2009
6813 Сообщения
Previous Страница 288 След.