SOLVED!
Creating surface attribute
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-08-11
10:49 AM
- last edited on
‎2021-09-15
09:54 AM
by
Noemi Balogh
‎2020-08-11
10:49 AM
Hello,
I'm trying to create new surfaces from scratch using custom textures (Basic Engine only).
So far I got through setting up the library folder for texture images and creating API_Texture attribute with API function. However, I'm constantly getting mixed results that seem to have something to do with API_Texture.status field.
For instance, if status == 0 no texture image is loaded. Different values produce different results with mirroring, alpha channel settings and so on.
Is there any reference on how does this thing work? Or is there any other, more 'proper' way of creating surfaces with API?
Also, how do I set the vectorial hatching for the surface?
Thanks.
I'm trying to create new surfaces from scratch using custom textures (Basic Engine only).
So far I got through setting up the library folder for texture images and creating API_Texture attribute with API function. However, I'm constantly getting mixed results that seem to have something to do with API_Texture.status field.
For instance, if status == 0 no texture image is loaded. Different values produce different results with mirroring, alpha channel settings and so on.
Is there any reference on how does this thing work? Or is there any other, more 'proper' way of creating surfaces with API?
Also, how do I set the vectorial hatching for the surface?
Thanks.
Solved! Go to Solution.
Labels:
- Labels:
-
Add-On (C++)
1 ACCEPTED SOLUTION
Accepted Solutions
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-08-11 12:18 PM
‎2020-08-11
12:18 PM
Hey,
Here are the possible values for the status field with a little explanation. Note that you can use multiple using binary operations (as you would with masks).
Here are the possible values for the status field with a little explanation. Note that you can use multiple using binary operations (as you would with masks).
#define APITxtr_LinkMat 0x1000 /**< texture linked to a material */ #define APITxtr_MirrorY 0x0800 /**< mirrored in Y direction */ #define APITxtr_MirrorX 0x0400 /**< mirrored in X direction */ #define APITxtr_RandomShift 0x0200 /**< shifted randomly */ #define APITxtr_SurfacePattern 0x0100 /**< alpha channel changes the surface color of the texture */ #define APITxtr_AmbientPattern 0x0080 /**< alpha channel changes the ambient color of the texture */ #define APITxtr_SpecularPattern 0x0040 /**< alpha channel changes the specular color of the texture */ #define APITxtr_DiffusePattern 0x0020 /**< alpha channel changes the diffuse color of the texture */ #define APITxtr_BumpPattern 0x0010 /**< bump mapping or surface normal perturbation */ #define APITxtr_TransPattern 0x0008 /**< alpha channel changes the transparency of the texture */ #define APITxtr_FillRectNatur 0x0004 /**< fit the rectangle with the picture in a central position */ /**< using the natural aspect ratio of the picture */ #define APITxtr_FitPictNatur 0x0002 /**< fit the the picture in the middle of the rectangle */ /**< using the natural aspect ratio of the picture */ #define APITxtr_UseAlpha 0x0001 /**< use alpha channel */
2 REPLIES 2
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-08-11 12:18 PM
‎2020-08-11
12:18 PM
Hey,
Here are the possible values for the status field with a little explanation. Note that you can use multiple using binary operations (as you would with masks).
Here are the possible values for the status field with a little explanation. Note that you can use multiple using binary operations (as you would with masks).
#define APITxtr_LinkMat 0x1000 /**< texture linked to a material */ #define APITxtr_MirrorY 0x0800 /**< mirrored in Y direction */ #define APITxtr_MirrorX 0x0400 /**< mirrored in X direction */ #define APITxtr_RandomShift 0x0200 /**< shifted randomly */ #define APITxtr_SurfacePattern 0x0100 /**< alpha channel changes the surface color of the texture */ #define APITxtr_AmbientPattern 0x0080 /**< alpha channel changes the ambient color of the texture */ #define APITxtr_SpecularPattern 0x0040 /**< alpha channel changes the specular color of the texture */ #define APITxtr_DiffusePattern 0x0020 /**< alpha channel changes the diffuse color of the texture */ #define APITxtr_BumpPattern 0x0010 /**< bump mapping or surface normal perturbation */ #define APITxtr_TransPattern 0x0008 /**< alpha channel changes the transparency of the texture */ #define APITxtr_FillRectNatur 0x0004 /**< fit the rectangle with the picture in a central position */ /**< using the natural aspect ratio of the picture */ #define APITxtr_FitPictNatur 0x0002 /**< fit the the picture in the middle of the rectangle */ /**< using the natural aspect ratio of the picture */ #define APITxtr_UseAlpha 0x0001 /**< use alpha channel */
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-08-11 12:36 PM
‎2020-08-11
12:36 PM
That's exactly what I needed.
Thanks!
Thanks!