Author Topic: How to handle "texture2DGradEXT"  (Read 7078 times)

0 Members and 1 Guest are viewing this topic.

Stefan

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4398
    • View Profile
How to handle "texture2DGradEXT"
« on: December 15, 2015, 09:02:53 PM »
Shadertoy demo "Arlo" makes heavy use of texture2DGradEXT

I tried to port the demo to GeeXLab but Intel compiler crashes, AMD and NVIDIA complain about "OpenGL/ES doesn't allow use of reserved word texture2DGradEXT" etc.

Adding
#extension GL_EXT_shader_texture_lod : enable
#extension GL_OES_standard_derivatives : enable

to the beginning of the pixel shader didn't help

What am i missing?


JeGX

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2035
    • View Profile
    • Geeks3D.com
Re: How to handle "texture2DGradEXT"
« Reply #1 on: December 22, 2015, 02:48:15 PM »
texture2DGradEXT can be replaced by textureGrad in OpenGL 3.2+ (#version 150 in the GLSL shader). But I didn't manage to run the demo on my GTX 960. There is something else in the pixel shader that is not appreciated by the GTX 960.

Stefan

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4398
    • View Profile
Re: How to handle "texture2DGradEXT"
« Reply #2 on: December 24, 2015, 10:14:40 AM »
Made another test: replaced texture2DGradEXT with texture2DGradARB
and added #extension GL_ARB_shader_texture_lod : enable

Compiles successfully, but renders blank screen with 100% GPU load

Stefan

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4398
    • View Profile
Arlo fixed
« Reply #3 on: December 25, 2015, 11:45:17 PM »
Download Arlo fixed

Mea culpa!
Looks like it's mandatory to add iChannel programs in update_scene, if there is more than 1 texture



Stefan

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4398
    • View Profile
Re: How to handle "texture2DGradEXT"
« Reply #4 on: January 02, 2016, 04:00:50 PM »
Found another picky demo Mushroom
Ported to GeeXLab

NVIDIA compiler warning: OpenGL/ES doesn't allow use of reserved word texture2DGradEXT
Again i replaced texture2DGradEXT with texture2DGradARB

Additionally #define VIS_SAMPLES 2 causes NVIDIA compiler warning:
0(442) : warning C7614: OpenGL/ES doesn't allow use of reserved word texture2DLodEXT
0(442) : warning C7506: OpenGL does not define the global function texture2DLodEXT
0(61) : warning C7050: "drddx" might be used before being initialized
0(62) : warning C7050: "drddy" might be used before being initialized