DGL
https://delphigl.com/forum/

Doom3 - Shaders (Materials)
https://delphigl.com/forum/viewtopic.php?f=19&t=3499
Seite 1 von 1

Autor:  Stucuk [ Sa Nov 20, 2004 20:58 ]
Betreff des Beitrags:  Doom3 - Shaders (Materials)

With doom3 shaders you can have mathimatical equations as values. My question is does anyone know how to turn a mathimatical equation (stored in a string) into an integer/float?

Sample Shader:
Code:
  1. noselfShadow
  2. noshadows
  3. deform sprite
  4. translucent
  5. discrete
  6. nonsolid
  7. noimpact
  8. {
  9. blend add
  10. map textures/particles/bfgballsac.tga
  11. rotate time * .2
  12. zeroClamp
  13. }
  14. {
  15. blend add
  16. map textures/particles/bfgballsac.tga
  17. rotate time * -.1
  18. zeroClamp
  19. }

Autor:  Mars [ Sa Nov 20, 2004 23:22 ]
Betreff des Beitrags: 

You have to write an expression parser, if you need to evaluate expressions only once, you can compute the result "on the fly", else it will be more efficient to create p-code from the string.

Autor:  Stucuk [ So Nov 21, 2004 00:23 ]
Betreff des Beitrags: 

<-- Clueless.

The values need to be parsed each time the shader is reloaded (which is when levels reload, etc. Places where speed doesn't rearly matter)

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/