<div dir="ltr"><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p class="MsoNormal"><span lang="EN-GB">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<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-GB">the mailing list to cc.</span></p></blockquote><div> </div><div>I didn't get any private email, so you seem to be doing better than you thought with the mailing list :)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p class="MsoNormal">With the OpenGL-side I do have some experience. Concerning the D3D-side of things it would probably mean convincing</p><p class="MsoNormal">Somebody that it is a good idea to finally apply the suggested change.</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">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.</p><p class="MsoNormal">Alternatively it might make sense to add a “Texture” class that is used a a DiffuseMap in the PhonMaterial. But that seems slightly overkill.</p></blockquote><div><br></div><div>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:</div>D3DTEXF_NONE, D3DTEXF_POINT, D3DTEXF_LINEAR, D3DTEXF_ANISOTROPIC, D3DTEXF_PYRAMIDALQUAD, D3DTEXF_GAUSSIANQUAD, D3DTEXF_CONVOLUTIONMONO,</div><div dir="ltr">if OpenGL supports a somewhat different set of filters, we will have some clashes in the Java API side.</div><div dir="ltr"><br></div><div dir="ltr">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.</div><div dir="ltr"><br></div><div dir="ltr">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).<br><div><br></div><div>[1] <a href="https://learn.microsoft.com/en-us/windows/win32/api/d3d9helper/nf-d3d9helper-idirect3ddevice9-setsamplerstate">https://learn.microsoft.com/en-us/windows/win32/api/d3d9helper/nf-d3d9helper-idirect3ddevice9-setsamplerstate</a></div><div>[2] <a href="https://learn.microsoft.com/en-us/windows/win32/direct3d9/d3dtexturefiltertype">https://learn.microsoft.com/en-us/windows/win32/direct3d9/d3dtexturefiltertype</a></div><div>[3] <a href="https://learn.microsoft.com/en-us/windows/win32/direct3d9/d3dsamplerstatetype">https://learn.microsoft.com/en-us/windows/win32/direct3d9/d3dsamplerstatetype</a></div><div>[4] <a href="https://learn.microsoft.com/en-us/windows/win32/direct3d9/vertex-textures-in-vs-3-0">https://learn.microsoft.com/en-us/windows/win32/direct3d9/vertex-textures-in-vs-3-0</a></div></div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">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:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div lang="en-DE">
<div>
<p class="MsoNormal"><span lang="EN-GB">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<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">the mailing list to cc.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal">With the OpenGL-side I do have some experience. Concerning the D3D-side of things it would probably mean convincing</p>
<p class="MsoNormal">Somebody that it is a good idea to finally apply the suggested change.</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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.</p>
<p class="MsoNormal">Alternatively it might make sense to add a “Texture” class that is used a a DiffuseMap in the PhonMaterial. But that seems slightly overkill.</p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">As I am not very well acquainted with current design principles of this library, these things should lie in more experience contributors hands.</p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal" style="border:none;padding:0cm"><b>From: </b><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</p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Which leads to the question; Does there, in JavaFX exist something comparable to setting the texture-sampler to NEAREST</p>
<p class="MsoNormal">instead of LINEAR sampling?</p>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">For the D3D side, see this issue in JBS [1]. The relevant code is at [2]. I didn't look at the OpenGL side.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">- Nir<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">[1] <a href="https://bugs.openjdk.org/browse/JDK-8092272" target="_blank">https://bugs.openjdk.org/browse/JDK-8092272</a> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">[2] <a href="https://github.com/openjdk/jfx/blob/0d9dcf38275528e1b621d71631aac5bdb9452110/modules/javafx.graphics/src/main/native-prism-d3d/D3DContext.cc#L621" target="_blank">https://github.com/openjdk/jfx/blob/0d9dcf38275528e1b621d71631aac5bdb9452110/modules/javafx.graphics/src/main/native-prism-d3d/D3DContext.cc#L621</a><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">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:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<div>
<p class="MsoNormal"><span lang="en-DE">On my never ending journey of building a Minecraft-clone in every graphics-framework available,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE">I have come across JavaFX for the next attempt.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE">However a minor inconvenience has crossed my path in the process:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE">Using the (very well developed!) 2D-Graphics displaying pixel-art style images is no trouble whatsoever.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE">Simply rendering it to a canvas and disabling smoothing does the job just fine. Unfortunately, I have been<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE">unable to figure out how to achieve a similar thing using the 3D-Graphics engine and the PhongMaterial that comes with it.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE">Which leads to the question; Does there, in JavaFX exist something comparable to setting the texture-sampler to NEAREST<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE">instead of LINEAR sampling?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE">Unfortunately the latest information I could find online was from about 2013 and much has (probably)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE">changed since then. Thus the question is being posed once again.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE"> <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE">I whish to excuse myself for probably repeating a fairly common question,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="en-DE"> <u></u><u></u></span></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-left:4.8pt">
<span lang="en-DE">Kind regards,<br>
Matija Brown.<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div></blockquote></div>