GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
image_shader(3) Arcan Lua API image_shader(3)

image_shader - Set the active shader for an object.

oldshid
image_shader( vid:image, string:identifier )
image_shader( vid:image, integer:identifier )
image_shader( vid:image, string:identifier, integer:attributes )
image_shader( vid:image, integer:identifier, integer:attributes )

Processing programs can be created using the build_shader call. These programs can then be assigned to an image through this function. if attributes are provided, the value is expected to be one of these constants:

SHADER_DOMAIN_RENDERTARGET : find a rendertarget bound to image and assign the shader as the default program for objects using this rendertarget. if image does not contain a rendertarget, it is a terminal state transition.

SHADER_DOMAIN_RENDERTARGET_HARD : same as for SHADER_DOMAIN_RENDERTARGET , except all shaders on objects attached to the rendertarget will be ignored. This is useful for a temporary suspension of all shaders, as well as for rendertargets created using define_linktarget .

1
if only the vid is provided, the active program won't be changed and the function is then used to query the active program of a video object.
2
if a string argument is supplied as the second argument, the routine will first resolve it by looking for a previously compiled shader with a name that matches the argument.
3
the shader state of all video objects are set to ' DEFAULT ' which is some platform default safe sate that follows obj_opacity and normal texturing.

function image_shader0()
      shid = build_shader(nil, [[
            void image_shader0(){
                  gl_FragColor = vec4(0.5, 1.0, 0.5, 1.0);
            }
      ]], "demoshader");
      a = fill_surface(64, 64, 0, 0, 0);
      show_image(a);
      image_shader(a, shid);
end

build_shader(3) shader_ugroup(3) shader_uniform(3)

June 2022 image

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.