Pages

luni, 10 iulie 2023

News : New videos about Moho Animation Software.

You can find more on the official youtube channel.

Graphics programming - Unity 3D shaders - 001.

If you have studied shader theory and computational graphics in the past, then the only impediment would be the Unity 3D interface.
For a shader that uses the CG programming language, then you can use this type of shader in Unity 3D software.
You can create with right-click on Unity 3D interface.
This will create a shader file, you can open and see the default shader.
Let's make a CG shader with one color.
Remove all content from this file and add this source code:
Shader "Cg basic shader" { // this is the name of the shader 
   SubShader { // Unity chooses this like an subshader and works with your GPU specifications
      Pass { // passes in higher-level shader/material systems GLSL/Cg/HLSL is a way of setting up states necessary for multi-pass rendering, in this case is one pass
         CGPROGRAM // start programming with Unity's Cg

         #pragma vertex vert 
            // this specifies the vert function as the vertex shader 
         #pragma fragment frag
            // this specifies the frag function as the fragment shader
		// define vert for vertex shader 	
         float4 vert(float4 vertexPos : POSITION) : SV_POSITION 
            // vertex shader 
         {
            return UnityObjectToClipPos(vertexPos);
              // this line transforms the vertex input parameter 
              // and returns it as a nameless vertex output parameter 
              // (with semantic SV_POSITION)
         }
		 // define frag for fragment shader
         float4 frag(void) : COLOR // fragment shader
         {
            return float4(0.0, 1.9, 7.6, 1.0); 
               // this fragment shader returns a nameless fragment
               // output parameter (with semantic COLOR) that is set to
               // opaque red (red = 1, green = 0, blue = 0, alpha = 1)
         }

         ENDCG // ends the part in  programming with Unity's Cg
      }
   }
}
This is a standard shader and if you search on the web you can find more simple shaders.
Add an object to your scene, create a new material, and add to this object, drag the file shader to the material, and will fill with this RGBA color: 0.0, 1.9, 7.6, 1.0.

News : About my work and one of my websites.

I would like to bring to the attention of those who follow my activity on my websites and appreciate the inability to continue with one of the websites: free-tutorials.org. It is currently hosted on a free host, but I cannot import it 100%, which has led me not to complete it with new posts. The continuation of the activities there, considering the limited time, will be carried out on my blogs with the defined theme with which I started: Linux - Fedora, Graphics, Python, Pygame.
In the meantime, because the host is expensive and until now someone has helped me to host it on his server, it is possible to sell the domain: free-tutorials.org - I receive purchase offers at my personal Yahoo email address catafest@yahoo.com.
Minimum starting price 250 euros, because the domain is old from 2018.