≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Introduction to HLSL Shaders.
Posted by:
(you are not logged in)
Enter the missing letter in: "Inter?ational"
(you are not logged in)
Text:
[quote][b][/b] wrote: For the purpose of testing, these two files were associated to that "action_ShaderPlus" : 1) Vertex Shader (GLSL format) file "v_01.glsl" : [code]uniform mat4 mWorldViewProj; uniform mat4 mInvWorld; uniform mat4 mTransWorld; void main(void) { gl_Position = mWorldViewProj * gl_Vertex; // normal would be this: vec4 normal = vec4(gl_Normal, 0.0); normal = mInvWorld * normal; normal = normalize(normal); // world position would be this: vec4 worldpos = gl_Vertex * mTransWorld; gl_FrontColor = gl_BackColor = vec4(1.0, 0.0, 1.0, 0.0); gl_TexCoord[0] = gl_MultiTexCoord0; }[/code] 2) Fragment Shader (GLSL format) file "f_01.glsl" : [code] uniform sampler2D myTexture; uniform vec4 callBackUniformVector; void main (void) { vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0])); col *= gl_Color; gl_FragColor = col * callBackUniformVector; } [/code] Of course, this action_ShaderPlus" can handle HLSL shaders. The name of the files and their extension could be whatever you want. (example : "myshaderfolder/myvertexshader.txt" with which you specify the folder and the file containing your shader).[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact