March 08, 2021, 01:06:11 AM

Author Topic: how to disable bilinear filtering (on textures) (Blitz3d)  (Read 4158 times)

Offline MagosDomina

  • Full Member
  • ***
  • Posts: 121
    • Aspiring game developer website.
Re: how to disable bilinear filtering (on textures) (Blitz3d)
« Reply #15 on: January 08, 2018, 12:44:22 AM »
What exactly is the InitDX7() doing here?
Central hub for my Game Design related activities.
http://www.magosdomina.com/

Windows 7 PRO 64-bit, 48Gb RAM, CPU: Dual Hexacore Intel Xeon 3.33 GHZ, Nvidia Quadro 5800FX 4Gb x 2 SLI.

Offline Yue

  • Hero Member
  • *****
  • Posts: 579
    • YiHosting Your Hosting Free
Re: how to disable bilinear filtering (on textures) (Blitz3d)
« Reply #16 on: January 08, 2018, 12:51:38 AM »
This is the function of the library that RemiD.

Offline RemiD

  • Hero Member
  • *****
  • Posts: 1155
Re: how to disable bilinear filtering (on textures) (Blitz3d)
« Reply #17 on: January 08, 2018, 07:43:34 AM »
This is not my library, these are functions from ashadow or devil shadow system (but initially made by TomSpeed)

The idea is to configure directx7 as you want for the Blitz3d window, so i suppose that InitDX7() setup that for the Blitz3d window. (it depends how the internal functions of the dll have been made, i don't know the details. But it works well...)

search for posts by "TomSpeed" or "devil child" or "Kryzon" on the old blitzbasic forum, there are some examples on how to setup directx7 for different things.
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline JBR

  • Full Member
  • ***
  • Posts: 128
Re: how to disable bilinear filtering (on textures) (Blitz3d)
« Reply #18 on: December 31, 2020, 12:41:09 AM »
Hi RemiD,

I want to use bilinear on some textures and block one on others.

As I understand it your code changes the renderer so this is not possible.

There is one texture I want mipmapped, any ideas?

Jim

Offline RemiD

  • Hero Member
  • *****
  • Posts: 1155
Re: how to disable bilinear filtering (on textures) (Blitz3d)
« Reply #19 on: December 31, 2020, 09:24:12 AM »
@JBR>>this is not my decls dll but those of ashadow library, so i can't change it.

however, if you take a look the bb code :
Code: [Select]
Function DisableTextureFilters()
;DX7DBF_SetMipmapLODBias( -10.0, 0 )
For Level = 0 To 7
DX7DBF_SetTextureStageState( Level, D3DTSS_MAGFILTER, D3DTEXF_POINT )
DX7DBF_SetTextureStageState( Level, D3DTSS_MINFILTER, D3DTEXF_POINT )
DX7DBF_SetTextureStageState( Level, D3DTSS_MIPFILTER, D3DTEXF_POINT  )
Next
End Function
i think that 0 to 7 corresponds to the layers (of textures) that you can apply on a surface / mesh.
i am not sure that we can use the 8 layers with Blitz3d, in most cases i use 2 layers (layer 0 and layer 1)...
so maybe you could change the code so that all textures on layer 0 and layer 1 don't have bilinear filtering, and textures on layers 3 and 4 have bilinear filtering.

something like :
Code: [Select]
Function DisableTextureFilters()
;DX7DBF_SetMipmapLODBias( -10.0, 0 )
For Level = 0 To 1 ;disable bilinear filtering on all textures on layers 0-1
DX7DBF_SetTextureStageState( Level, D3DTSS_MAGFILTER, D3DTEXF_POINT )
DX7DBF_SetTextureStageState( Level, D3DTSS_MINFILTER, D3DTEXF_POINT )
DX7DBF_SetTextureStageState( Level, D3DTSS_MIPFILTER, D3DTEXF_POINT  )
Next
End Function
(not tested)

then when you apply a texture on a surface / mesh :
Code: [Select]
;without bilinear filtering :
entitytexture( mesh, texture, frame, layer ) ;layer must be 0 or 1
;or
brushtexture( brush, texture, frame, layer ) ;layer must be 0 or 1

;with bilinear filtering :
entitytexture( mesh, texture, frame, layer ) ;layer must be 2 or 3
;or
brushtexture( brush, texture, frame, layer ) ;layer must be 2 or 3
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal