≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
shader for web target
Posted by:
(you are not logged in)
Enter the missing letter in: "I?ternational"
(you are not logged in)
Text:
[quote][b][/b] wrote: Hello everybody, This thread could be a think tank about shaders inside CopperCube. Very interesting matter in Just_in_case's comment. Dieter, I want to say that I underestimated the usefulness of your custom-made behavior and I explain why : I am more and more convinced that there is a kind of bug in CopperCube and it has an incidence on the way shaders are performed. I thought that editing and testing java script in the project itself was a good solution. However after having a lot of unexpected results, I must admit that this workflow is misleading. Why ? Because it seems that CopperCube stores the compiled shader in the RAM reserved for the application. I noticed that when I inserted new lines of code in the tested shader, then they remain buffered somewhere even when those lines are later deleted. About the materials and Textures in CopperCube, it is a matter that Just_in_Case is perfectly mastering and his video tutorial about the export of mesh created with multi-material in Blender is, as I already said it, uppermost useful. As far as I could test it, CopperCube may store 1 to n materials (the value n being limited by the possibility of the selected importer). And each material can be defined with up to 4 textures (these one are fully visible in the Irrlicht properties editor where they could be assigned manually or with Java script). To enjoy using CSP_Game shader created by Dieter, I took the liberty to save it in the folder "extensions" of my CopperCube's version. I think that if he would dig deeper then Dieter could find the solution to that alpha transparency problem. Just for the fun, I want to show a shader test with some lines of codes added to the original shader created by Dieter. Before running it, I applied 4 textures in the Irrlicht properties pane to the selected node (the default cube). Therefore the single material of the default cube contains those textures. Here is the content of the stored behavior (my modified version : Sorry for this -> I couldn't post the entire script, too much lines ) : [code]var fragmentShader = ""; fragmentShader += "uniform sampler2D texture1; \n" fragmentShader += "uniform sampler2D texture2; \n" fragmentShader += "uniform sampler2D texture3; \n" fragmentShader += "uniform sampler2D texture4; \n" fragmentShader += "uniform vec4 pulse; \n" fragmentShader += " \n" fragmentShader += "varying vec2 v_texCoord1; \n" fragmentShader += "varying vec2 v_texCoord2; \n" fragmentShader += " \n" fragmentShader += "void main() \n" fragmentShader += "{ \n" fragmentShader += " vec2 texCoord; \n" fragmentShader += " texCoord[0] =cos(pulse.x)+1.0+ ((2.0+sin( mod( (v_texCoord1.s*18.0),6.2832) ))*v_texCoord1.t); \n" fragmentShader += " texCoord[1] =sin(pulse.x)+1.0+ ((2.0+sin( mod( (v_texCoord2.t*18.8),6.2832) ))*v_texCoord2.s); \n" fragmentShader += " gl_FragColor = texture2D(texture1, texCoord); \n" fragmentShader += " gl_FragColor += texture2D(texture2, texCoord); \n" fragmentShader += " gl_FragColor *= texture2D(texture3, texCoord); \n" fragmentShader += " gl_FragColor /= texture2D(texture4, texCoord); \n" fragmentShader += "} \n";[/code][/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