≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
CopperCubePlugin Released
Posted by:
(you are not logged in)
Enter the missing letter in: "?nternational"
(you are not logged in)
Text:
[quote][b][/b] wrote: Shader: The Shader in CopperCube was quite a pain to write, you needed to add \n and + symbols to each line of the Shader code in order to turn it into a JavaScript string, now you just need to write the code normally in the Shader file and then use "import" to import the game. Original: [code]var vertexShader = "float4x4 mWorldViewProj; // World * View * Projection \n" + "float4x4 mInvWorld; // Inverted world matrix \n" + "float4x4 mTransWorld; // Transposed world matrix \n" + " \n" + "// Vertex shader output structure \n" + "struct VS_OUTPUT \n" + "{ \n" + " float4 Position : POSITION; // vertex position \n" + " float4 Diffuse : COLOR0; // vertex diffuse \n" + " float2 TexCoord : TEXCOORD0; // tex coords \n" + "}; \n" + " \n" + "VS_OUTPUT main ( in float4 vPosition : POSITION, \n" + " in float3 vNormal : NORMAL, \n" + " float2 texCoord : TEXCOORD0 )\n" + "{ \n" + " VS_OUTPUT Output; \n" + " \n" + " // transform position to clip space \n" + " Output.Position = mul(vPosition, mWorldViewProj); \n" + " \n" + " // transformed normal would be this: \n" + " float3 normal = mul(vNormal, mInvWorld); \n" + " \n" + " // position in world coodinates would be this: \n" + " // float3 worldpos = mul(mTransWorld, vPosition); \n" + " \n" + " Output.Diffuse = float4(1.0, 1.0, 1.0, 1.0); \n" + " Output.TexCoord = texCoord; \n" + " \n" + " return Output; \n" + "} [/code] Now: [img]https://i3.lensdump.com/i/T72jb7.jpeg[/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