≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Examples shaders
Posted by:
(you are not logged in)
Enter the missing letter in: "Inte?national"
(you are not logged in)
Text:
[quote][b]Specularmap[/b] wrote: Here is a working "xray"*look* but there is no transparency = opacity Maybe Niko add opacity [code] var vertexShader = "varying vec3 N;\n" + "varying vec3 I;\n" + "varying vec4 Cs;\n" + "void main()\n" + "{\n" + " vec4 P = gl_ModelViewMatrix * gl_Vertex;\n" + " I = P.xyz - vec3 (0);\n" + " N = gl_NormalMatrix * gl_Normal;\n" + " Cs = gl_Color;\n" + " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + "}"; var fragmentShader = "// vertex to fragment shader io\n" + "varying vec3 N;\n" + "varying vec3 I;\n" + "varying vec4 Cs;\n" + "// globals\n" + "uniform float edgefalloff;\n" + "uniform float intensity;\n" + "uniform float ambient;\n" + "// entry point\n" + "void main()\n" + "{\n" + "float ambient = 0.1;\n" + "float edgefalloff = 0.6;\n" + "float intensity = 2.0;\n" + " float opac = dot(normalize(-N), normalize(-I));\n" + " opac = abs(opac);\n" + " opac = ambient + intensity*(1.0-pow(opac, edgefalloff));\n" + " //opac = 1.0 - opac;\n" + " gl_FragColor = opac * Cs;\n" + " gl_FragColor.a = opac;\n" + "}"; var newMaterial = ccbCreateMaterial(vertexShader, fragmentShader, 0, null); var soldier = ccbGetSceneNodeFromName('soldier'); ccbSetSceneNodeMaterialProperty(soldier, 0, 'Type', newMaterial); ccbSetSceneNodeMaterialProperty(soldier, 1, 'Type', newMaterial); ccbSetSceneNodeMaterialProperty(soldier, 2, 'Type', newMaterial); ccbSetSceneNodeMaterialProperty(soldier, 4, 'Type', newMaterial); [/code] [img]http://i.imgur.com/Gy44lDV.jpg[/img][/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