Jump to content

shaders refactoring


photo

Recommended Posts

Posted

Hi, i downloaded Unigine 2.0 and run it.

i have small lib for shaders (lib.h) with my classes and double - functions

class cl1 {
  float v1;
  double v2;
};

double dblFunc1(double v1) {
  return v1* 2.0;
}

shader compiler:

Vertex shader failed to compile with the following errors:

ERROR: 0:473: error(#133) Reserved word: double

ERROR: 0:472: error(#133) Reserved word: class

ERROR: 0:473: error(#132) Syntax error: "double" parse error

 

how write new shaders? i need classes and double

 

Posted
Hi Sergey!

 

If you want to use the double precision in shaders on OpenGL, you need a graphics card with support for the GL_ARB_gpu_shader_fp64 extension set for the specific OpenGL shader:



##extension GL_ARB_gpu_shader_fp64 : enable


There is no support for the class concept in shaders, the closest analog is struct.

×
×
  • Create New...