Interface Material

All Known Implementing Classes:
Material.CppProxy

public interface Material
Class, represents material interface
  • Method Details

    • getName

      @NonNull String getName()
      Returns:
      material name (string)
    • addParameter

      void addParameter(@Nullable Parameter parameter)
      adds shader parameter to parameters list, after what you'll can get access to this parameter in shader by it's name. Type of parameter in shader will match with type of parameter, except int, float, vector2, vector3, this types will be replaces on vec4, which x component will have needed value, other components will be filled by garbage.
      Parameters:
      parameter - (parameter): parameter to add
    • getParameters

      @NonNull ArrayList<Parameter> getParameters()
      Returns:
      list of shader parameters (list)
    • removeParameter

      void removeParameter(@Nullable Parameter parameter)
      removes parameter from list.
      Parameters:
      parameter - (parameter): parameter to remove
    • findParameter

      @Nullable Parameter findParameter(@NonNull String name)
      find parameter by name
      Parameters:
      name - (string)
      Returns:
      parameter (parameter) or null
    • setTopology

      void setTopology(@NonNull GeometryTopology topology)
      set material geometry topology.
      Parameters:
      topology - (geometry_topology): geometry topology type. Can be triangles_list, lines_list, points_list. Default: triangles_list
    • getCurrentTopology

      @NonNull GeometryTopology getCurrentTopology()
      Returns:
      current geometry topology (geometry_topology)
    • setState

      void setState(@NonNull State state)
      sets render state (i.e blending mode, color/depth writing, depth testing, etc.)
      Parameters:
      state - (state) render state
    • getState

      @NonNull State getState()
      Returns:
      render state (state)
    • addImage

      void addImage(@NonNull String sampler, @Nullable Image image)
      add image sampler, after what you'll can get acess to image and sampler in shader by formula: image_index = i * 2. sampler_index = i * 2 + 1. Where i is image index in images list (which you can get by get_images call). Note that you need to declare images samplers in shader manually and sampler name in name must match with sampler name in material.
      Parameters:
      sampler - (string): sampler name
      image - (image): sampler image
    • getImages

      @NonNull ArrayList<Image> getImages()
      Returns:
      list of samplers images (list)
    • removeImage

      void removeImage(@NonNull String sampler)
      removes image from list (if exist). Will be ignored if effect was activated.
      Parameters:
      sampler - (string): sampler name
    • getSamplers

      @NonNull ArrayList<String> getSamplers()
      Returns:
      list of samplers name (list)
    • getShaderSource

      @NonNull ShaderSource getShaderSource()
      Returns:
      compiled and combined shaders sources