<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-IN" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">I am currently working on Metal implementation to solve similar issues and what i have noticed is we can pass properties related to texture filters and mipmapping when we call XXXContext->setMap()
call. Because at this place we have an idea what kind of map we are creating and what kind of filters we want to use.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">As part of
<a href="https://bugs.openjdk.org/browse/JDK-8310109">https://bugs.openjdk.org/browse/JDK-8310109</a> I have added default filters is shader itself, but for the next thing I am working on :
<a href="https://bugs.openjdk.org/browse/JDK-8310658">https://bugs.openjdk.org/browse/JDK-8310658</a> I am planning to create appropriate sample descriptors with filters and pass it to shader and mostly filter state management will be set through setMap() call.
But it is still an idea, will share once I have proper working code for Metal.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">Jay<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Nir Lisker <nlisker@gmail.com><br>
<b>Date: </b>Sunday, 25 June 2023 at 11:34 PM<br>
<b>To: </b>Matija Brown <Matija.Brown@outlook.de><br>
<b>Cc: </b>Jayathirth Rao Daarapuram Venkatesh Murthy <jayathirth.d.v@oracle.com>, Kevin Rushforth <kevin.rushforth@oracle.com>, openjfx-dev@openjdk.org <openjfx-dev@openjdk.org><br>
<b>Subject: </b>[External] : Re: [JavaFX 3D ( | Feature Request)] Setting Texture Nearest-Sampling on PhongMaterial<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Perhaps Jay and Kevin can weigh in on this.<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">By the way, I see that the com.sun.prism.Texture interface already defines get/setLinearFiltering methods that specify if the filtering is not linear then it uses a nearest neighbor algorithm. It's not used
by the 3D side it seems.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">On Sun, Jun 25, 2023 at 8:54 PM Matija Brown <<a href="mailto:Matija.Brown@outlook.de">Matija.Brown@outlook.de</a>> wrote:<o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">This is a good point you’re bringing up Nir!<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">I’m really not sure on that. On the one hand your interpretation seems the most sensible, but on the other hand I can’t see any use case of NEAREST
filtering in specular or self-illumination maps.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">However giving more options is also always good, and the same way there aren’t really many places (that I’m aware of) one would have NEAREST filtered
diffuse maps and use any of the others at all.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">TLDL: Would work excellently your way API wise, but I’m not certain if it makes sense use-case wise.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Matija.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:11.0pt">From:
</span></b><span style="font-size:11.0pt"><a href="mailto:nlisker@gmail.com" target="_blank">Nir Lisker</a><br>
<b>Sent: </b>Sunday, 25 June 2023 19:49<br>
<b>To: </b><a href="mailto:Matija.Brown@outlook.de" target="_blank">Matija Brown</a><br>
<b>Cc: </b><a href="mailto:jayathirth.d.v@oracle.com" target="_blank">Jayathirth Rao Daarapuram Venkatesh Murthy</a>;
<a href="mailto:kevin.rushforth@oracle.com" target="_blank">Kevin Rushforth</a>; <a href="mailto:openjfx-dev@openjdk.org" target="_blank">
openjfx-dev@openjdk.org</a><br>
<b>Subject: </b>Re: [JavaFX 3D ( | Feature Request)] Setting Texture Nearest-Sampling on PhongMaterial<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">I think that the first question to answer is whether the filtering method is applied to all maps/textures of the material (diffuse, specular, self-illumination)
or to each individually. I would imagine that the former makes more sense. If that's the case, the texture filtering parameter will be just one more property in PhongMaterial (perhaps in the Material supertype if it also makes sense for other possible materials
- that can be figured out later in any case).<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">On Sun, Jun 25, 2023 at 3:20 PM Matija Brown <<a href="mailto:Matija.Brown@outlook.de" target="_blank">Matija.Brown@outlook.de</a>> wrote:<o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Unfortunately it took a little longer (got busy), but have just had a quick look at the<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">OpenGL side of things.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">The ES2Texture class appears to handle everything there. There are two create-Methods, but the other<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">one is responsible for MediaFrame stuff and it doesn’t really? make sense to have non-linear filtering there?<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">What’s your opinion?<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">The create method seems to parse in all texture parameters simply as arguments (<a href="https://urldefense.com/v3/__https:/github.com/openjdk/jfx/blob/0d9dcf38275528e1b621d71631aac5bdb9452110/modules/javafx.graphics/src/main/java/com/sun/prism/es2/ES2Texture.java*L98__;Iw!!ACWV5N9M2RV99hQ!IosyLrHoYxRq1BtTWALnnXOVTyTSir7RK04cKX4JSpP3Ln5cndinsnucq78twcVENeeW4eQ4Uc6RgArM9pJk$" target="_blank">https://github.com/openjdk/jfx/blob/0d9dcf38275528e1b621d71631aac5bdb9452110/modules/javafx.graphics/src/main/java/com/sun/prism/es2/ES2Texture.java#L98</a>),<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">it would probably be best to just add the filtering in there as well.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">API-wise it’s probably best to have a Texture or DiffuseMap class that the PhongMaterial uses and stores metadata about the Image.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">However this might be slightly overkill considering there is only this one single parameter we’re trying to add,<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">thus maybe just a flag in PhongMaterial would suffice?<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Have a nice day,<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Matija.<o:p></o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:11.0pt">From:
</span></b><span style="font-size:11.0pt"><a href="mailto:Matija.Brown@outlook.de" target="_blank">Matija Brown</a><br>
<b>Sent: </b>Thursday, 22 June 2023 18:37<br>
<b>To: </b><a href="mailto:jayathirth.d.v@oracle.com" target="_blank">Jayathirth Rao Daarapuram Venkatesh Murthy</a>;
<a href="mailto:nlisker@gmail.com" target="_blank">Nir Lisker</a>; <a href="mailto:kevin.rushforth@oracle.com" target="_blank">
Kevin Rushforth</a><br>
<b>Cc: </b><a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a><br>
<b>Subject: </b>RE: [JavaFX 3D ( | Feature Request)] Setting Texture Nearest-Sampling on PhongMaterial<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">I’ll do the OpenGL – have done quite a bit with Vulkan and GL in the past so there’s no problem there.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Certainly usefull if you would do some reviewing – if you finish the Metal texture maps someone will surely find<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">themselves to expand it with sampling.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Tomorrow I’ll give a short summary on what would be to do for OpenGL, as we have that for D3D already.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Then do a little example probably – doesn’t really seem too much work to me?<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Matija.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:11.0pt">From:
</span></b><span style="font-size:11.0pt"><a href="mailto:jayathirth.d.v@oracle.com" target="_blank">Jayathirth Rao Daarapuram Venkatesh Murthy</a><br>
<b>Sent: </b>Thursday, 22 June 2023 06:28<br>
<b>To: </b><a href="mailto:nlisker@gmail.com" target="_blank">Nir Lisker</a>; <a href="mailto:kevin.rushforth@oracle.com" target="_blank">
Kevin Rushforth</a><br>
<b>Cc: </b><a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a><br>
<b>Subject: </b>Re: [JavaFX 3D ( | Feature Request)] Setting Texture Nearest-Sampling on PhongMaterial<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Correcting myself:</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Currently I am working on Metal implementation of Texture maps in JavaFX 3D :
<a href="https://bugs.openjdk.org/browse/JDK-8310109" target="_blank">https://bugs.openjdk.org/browse/JDK-8310109</a> and not on adding nearest sampling(which last mail can imply).</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Thanks,</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Jay</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div id="m_-6205322515822456995m_376544303615863523mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">openjfx-dev <<a href="mailto:openjfx-dev-retn@openjdk.org" target="_blank">openjfx-dev-retn@openjdk.org</a>> on behalf of Jayathirth Rao Daarapuram Venkatesh Murthy <<a href="mailto:jayathirth.d.v@oracle.com" target="_blank">jayathirth.d.v@oracle.com</a>><br>
<b>Date: </b>Thursday, 22 June 2023 at 9:22 AM<br>
<b>To: </b>Nir Lisker <<a href="mailto:nlisker@gmail.com" target="_blank">nlisker@gmail.com</a>>, Kevin Rushforth <<a href="mailto:kevin.rushforth@oracle.com" target="_blank">kevin.rushforth@oracle.com</a>><br>
<b>Cc: </b><a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a> <<a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a>><br>
<b>Subject: </b>Re: [JavaFX 3D ( | Feature Request)] Setting Texture Nearest-Sampling on PhongMaterial</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Currently I am working on Metal implementation of the same and has no bandwidth to work on additional OpenGL thing.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">But I can help in reviewing the code if we come up with addition of nearest filtering.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Thanks,</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Jay</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div id="m_-6205322515822456995m_376544303615863523mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">openjfx-dev <<a href="mailto:openjfx-dev-retn@openjdk.org" target="_blank">openjfx-dev-retn@openjdk.org</a>> on behalf of Nir Lisker <<a href="mailto:nlisker@gmail.com" target="_blank">nlisker@gmail.com</a>><br>
<b>Date: </b>Wednesday, 21 June 2023 at 9:40 PM<br>
<b>To: </b>Kevin Rushforth <<a href="mailto:kevin.rushforth@oracle.com" target="_blank">kevin.rushforth@oracle.com</a>><br>
<b>Cc: </b><a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a> <<a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a>><br>
<b>Subject: </b>Re: [JavaFX 3D ( | Feature Request)] Setting Texture Nearest-Sampling on PhongMaterial</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:9.6pt">
<span style="font-size:11.0pt">If I remember correctly, in OpenGL you parse the texture filter when the texture is being created, while in DirectX as it is bound</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:9.6pt">
<span style="font-size:11.0pt">to the sampler (it is a sampler state after all) it would have to be set before every render call. However it shouldn’t make any</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:9.6pt">
<span style="font-size:11.0pt">API difference really, as we can just have a field somewhere and the parse it along when needed.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Yes, the JBS ticket mentions this difference as well.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Since Kevin approved this feature and the API seems to converge nicely between the pipelines, we can start the work. I'm somewhat busy with other
tasks as of late, but I will try to formulate an API. Matija or Jay, if one of you can start investigating the changes to the OpenGL pipeline we could create a branch in the sandbox repo and work there.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">On Wed, Jun 21, 2023 at 4:03 PM Kevin Rushforth <<a href="mailto:kevin.rushforth@oracle.com" target="_blank">kevin.rushforth@oracle.com</a>> wrote:</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt;margin-left:9.6pt">
<span style="font-size:11.0pt">My preference would be to add support only for Linear and Nearest in any case.<br>
<br>
-- Kevin</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:9.6pt">
<span style="font-size:11.0pt">On 6/21/2023 4:48 AM, Matija Brown wrote:</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">As Jayathrith said, in OpenGL as well as Metal only NEAREST and LINEAR filters are available.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">There might be a way of getting around it by implementing some own algorithm for OpenGL and Metal but that seem slightly</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">over the top. So either one would have to keep the options limited to the two supported everywhere</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">or go with the “conditional” features.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">Having had a look at DirectX the APIs seem not to differ too much.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">If I remember correctly, in OpenGL you parse the texture filter when the texture is being created, while in DirectX as it is bound</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">to the sampler (it is a sampler state after all) it would have to be set before every render call. However it shouldn’t make any</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">API difference really, as we can just have a field somewhere and the parse it along when needed.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">Cheers,</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">Matija.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<b><span style="font-size:11.0pt">From: </span></b><span style="font-size:11.0pt"><a href="mailto:jayathirth.d.v@oracle.com" target="_blank">Jayathirth Rao Daarapuram Venkatesh Murthy</a><br>
<b>Sent: </b>Wednesday, 21 June 2023 13:09<br>
<b>To: </b><a href="mailto:nlisker@gmail.com" target="_blank">Nir Lisker</a>; <a href="mailto:Matija.Brown@outlook.de" target="_blank">
Matija Brown</a><br>
<b>Cc: </b><a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a><br>
<b>Subject: </b>Re: [JavaFX 3D ( | Feature Request)] Setting Texture Nearest-Sampling on PhongMaterial</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">In OpenGL we set GL_LINEAR by default at : <a href="https://urldefense.com/v3/__https:/github.com/openjdk/jfx/blob/0d9dcf38275528e1b621d71631aac5bdb9452110/modules/javafx.graphics/src/main/java/com/sun/prism/es2/ES2Texture.java*L221__;Iw!!ACWV5N9M2RV99hQ!IosyLrHoYxRq1BtTWALnnXOVTyTSir7RK04cKX4JSpP3Ln5cndinsnucq78twcVENeeW4eQ4Uc6RgFgAD2mD$" target="_blank">
https://github.com/openjdk/jfx/blob/0d9dcf38275528e1b621d71631aac5bdb9452110/modules/javafx.graphics/src/main/java/com/sun/prism/es2/ES2Texture.java#L221</a></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">And Metal supports only two types of Min/Max filters : Nearest(default) and Linear. So even if D3D supports multiple types we might be limited to support only these 2 filters for all platforms.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">Thanks,</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">Jay</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div id="m_-6205322515822456995m_376544303615863523m_4252637545766470404mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt;margin-left:81.6pt">
<b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">openjfx-dev
<a href="mailto:openjfx-dev-retn@openjdk.org" target="_blank"><openjfx-dev-retn@openjdk.org></a> on behalf of Nir Lisker
<a href="mailto:nlisker@gmail.com" target="_blank"><nlisker@gmail.com></a><br>
<b>Date: </b>Wednesday, 21 June 2023 at 3:57 PM<br>
<b>To: </b>Matija Brown <a href="mailto:Matija.Brown@outlook.de" target="_blank">
<Matija.Brown@outlook.de></a><br>
<b>Cc: </b><a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a>
<a href="mailto:openjfx-dev@openjdk.org" target="_blank"><openjfx-dev@openjdk.org></a><br>
<b>Subject: </b>Re: [JavaFX 3D ( | Feature Request)] Setting Texture Nearest-Sampling on PhongMaterial</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span lang="EN-GB" style="font-size:11.0pt">First of all, please excuse directly e-mailing you earlier today. Working with mailing lists is quite new for me and apparently I forgot to add</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span lang="EN-GB" style="font-size:11.0pt">the mailing list to cc.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</blockquote>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">I didn't get any private email, so you seem to be doing better than you thought with the mailing list :)</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">With the OpenGL-side I do have some experience. Concerning the D3D-side of things it would probably mean convincing</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">Somebody that it is a good idea to finally apply the suggested change.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">There would be some API change required of course. As a basic concept it would probably be sensible to add this as a parameter to the PhonMaterial-class.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">Alternatively it might make sense to add a “Texture” class that is used a a DiffuseMap in the PhonMaterial. But that seems slightly overkill.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</blockquote>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">Where to put the new methods in the Java side is not the concerning part, it's how to create methods that match all the pipelines. In D3D, the method for setting the filter is detailed in [1], and its possible parameters in [2][3][4].
So suppose that I'm looking at the list of available filter types there:</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">D3DTEXF_NONE, D3DTEXF_POINT, D3DTEXF_LINEAR, D3DTEXF_ANISOTROPIC, D3DTEXF_PYRAMIDALQUAD, D3DTEXF_GAUSSIANQUAD, D3DTEXF_CONVOLUTIONMONO,</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">if OpenGL supports a somewhat different set of filters, we will have some clashes in the Java API side.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">Generally, we would like to give as much flexibility to the user as possible, but need to be careful with platform-specific functionality. We could round *some* corners. For example, I think that if we have an enum for the filter
types above that is a union of the ones available in the different pipelines, and if a few are supported by only one of the pipelines, we could note it in the docs and get away with it (something similar to a conditional feature). However, if the whole native
pipeline setup for texture filtering is different, which means a different set of Java API methods per pipeline, then that's too much.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">All this means is that to continue we need to figure out what the API for each pipeline looks like, what's the most functionality we can have for each pipeline, and then how we can unite them into a single Java API with the hopes
of being able to reconcile the differences "well enough" (whatever that will mean).</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">[1] <a href="https://urldefense.com/v3/__https:/learn.microsoft.com/en-us/windows/win32/api/d3d9helper/nf-d3d9helper-idirect3ddevice9-setsamplerstate__;!!ACWV5N9M2RV99hQ!IosyLrHoYxRq1BtTWALnnXOVTyTSir7RK04cKX4JSpP3Ln5cndinsnucq78twcVENeeW4eQ4Uc6RgO1gPsHn$" target="_blank">https://learn.microsoft.com/en-us/windows/win32/api/d3d9helper/nf-d3d9helper-idirect3ddevice9-setsamplerstate</a></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">[2] <a href="https://urldefense.com/v3/__https:/learn.microsoft.com/en-us/windows/win32/direct3d9/d3dtexturefiltertype__;!!ACWV5N9M2RV99hQ!IosyLrHoYxRq1BtTWALnnXOVTyTSir7RK04cKX4JSpP3Ln5cndinsnucq78twcVENeeW4eQ4Uc6RgAbRe--K$" target="_blank">https://learn.microsoft.com/en-us/windows/win32/direct3d9/d3dtexturefiltertype</a></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">[3] <a href="https://urldefense.com/v3/__https:/learn.microsoft.com/en-us/windows/win32/direct3d9/d3dsamplerstatetype__;!!ACWV5N9M2RV99hQ!IosyLrHoYxRq1BtTWALnnXOVTyTSir7RK04cKX4JSpP3Ln5cndinsnucq78twcVENeeW4eQ4Uc6RgGm003ue$" target="_blank">https://learn.microsoft.com/en-us/windows/win32/direct3d9/d3dsamplerstatetype</a></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">[4] <a href="https://urldefense.com/v3/__https:/learn.microsoft.com/en-us/windows/win32/direct3d9/vertex-textures-in-vs-3-0__;!!ACWV5N9M2RV99hQ!IosyLrHoYxRq1BtTWALnnXOVTyTSir7RK04cKX4JSpP3Ln5cndinsnucq78twcVENeeW4eQ4Uc6RgBUJEhTQ$" target="_blank">https://learn.microsoft.com/en-us/windows/win32/direct3d9/vertex-textures-in-vs-3-0</a></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt">On Wed, Jun 21, 2023 at 12:45 PM Matija Brown <<a href="mailto:Matija.Brown@outlook.de" target="_blank">Matija.Brown@outlook.de</a>> wrote:</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span lang="EN-GB" style="font-size:11.0pt">First of all, please excuse directly e-mailing you earlier today. Working with mailing lists is quite new for me and apparently I forgot to add</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span lang="EN-GB" style="font-size:11.0pt">the mailing list to cc.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span lang="EN-GB" style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">With the OpenGL-side I do have some experience. Concerning the D3D-side of things it would probably mean convincing</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">Somebody that it is a good idea to finally apply the suggested change.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">There would be some API change required of course. As a basic concept it would probably be sensible to add this as a parameter to the PhonMaterial-class.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">Alternatively it might make sense to add a “Texture” class that is used a a DiffuseMap in the PhonMaterial. But that seems slightly overkill.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">As I am not very well acquainted with current design principles of this library, these things should lie in more experience contributors hands.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<b><span style="font-size:11.0pt">From: </span></b><span style="font-size:11.0pt"><a href="mailto:nlisker@gmail.com" target="_blank">Nir Lisker</a><br>
<b>Sent: </b>Tuesday, 20 June 2023 20:50<br>
<b>To: </b><a href="mailto:Matija.Brown@outlook.de" target="_blank">Matija Brown</a><br>
<b>Cc: </b><a href="mailto:openjfx-dev@openjdk.org" target="_blank">openjfx-dev@openjdk.org</a><br>
<b>Subject: </b>Re: [JavaFX 3D ( | Feature Request)] Setting Texture Nearest-Sampling on PhongMaterial</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">Which leads to the question; Does there, in JavaFX exist something comparable to setting the texture-sampler to NEAREST</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">instead of LINEAR sampling?</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</blockquote>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">There is no API to set the texture filter. If you would like to contribute and add it, I can help. It needs to be compatible with both Direct3D and OpenGL (not sure how the work on Metal is going), so this can be a challenge.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">For the D3D side, see this issue in JBS [1]. The relevant code is at [2]. I didn't look at the OpenGL side.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">- Nir</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">[1] <a href="https://bugs.openjdk.org/browse/JDK-8092272" target="_blank">https://bugs.openjdk.org/browse/JDK-8092272</a> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">[2] <a href="https://urldefense.com/v3/__https:/github.com/openjdk/jfx/blob/0d9dcf38275528e1b621d71631aac5bdb9452110/modules/javafx.graphics/src/main/native-prism-d3d/D3DContext.cc*L621__;Iw!!ACWV5N9M2RV99hQ!IosyLrHoYxRq1BtTWALnnXOVTyTSir7RK04cKX4JSpP3Ln5cndinsnucq78twcVENeeW4eQ4Uc6RgNOGE23Z$" target="_blank">https://github.com/openjdk/jfx/blob/0d9dcf38275528e1b621d71631aac5bdb9452110/modules/javafx.graphics/src/main/native-prism-d3d/D3DContext.cc#L621</a></span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:96.0pt">
<span style="font-size:11.0pt">On Mon, Jun 19, 2023 at 10:15 PM Matija Brown <<a href="mailto:Matija.Brown@outlook.de" target="_blank">Matija.Brown@outlook.de</a>> wrote:</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">On my never ending journey of building a Minecraft-clone in every graphics-framework available,</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">I have come across JavaFX for the next attempt.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">However a minor inconvenience has crossed my path in the process:</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">Using the (very well developed!) 2D-Graphics displaying pixel-art style images is no trouble whatsoever.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">Simply rendering it to a canvas and disabling smoothing does the job just fine. Unfortunately, I have been</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">unable to figure out how to achieve a similar thing using the 3D-Graphics engine and the PhongMaterial that comes with it.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">Which leads to the question; Does there, in JavaFX exist something comparable to setting the texture-sampler to NEAREST</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">instead of LINEAR sampling?</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">Unfortunately the latest information I could find online was from about 2013 and much has (probably)</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">changed since then. Thus the question is being posed once again.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt">I whish to excuse myself for probably repeating a fairly common question,</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:110.4pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:100.8pt">
<span style="font-size:11.0pt">Kind regards,<br>
Matija Brown.</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:86.4pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:81.6pt">
<span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:5.0pt;margin-left:4.8pt">
<span style="font-size:11.0pt"> </span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <span style="font-size:11.0pt"><o:p></o:p></span></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:4.8pt">
<span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>