Java-Gaming.org Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (681)
Games in Android Showcase (196)
games submitted by our members
Games in WIP (744)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2 3 ... 10
 1 
 on: 2016-06-27 04:01:38 
Started by BurntPizza - Last post by theagentd
So I finally got time to sit down and play with my GLSL preprocessor.

When you're done, PM me a github link and I can port it to some standard text preprocessor for you, then put it in the shared code! This looks really useful, Ive always needed a better way of doing shader/client interoperability like checking for primitives and all.
Sure, that'd be lovely! I plan on integrating the whole thing with a couple of tools to write a binary shader file (char[] of GLSL source code + info about the shader for GL, byte[] SPIR-V code + descriptor set layouts for VK), so your port probably has to be written in Java. xd

 2 
 on: 2016-06-27 02:48:37 
Started by BurntPizza - Last post by Ecumene
So I finally got time to sit down and play with my GLSL preprocessor.

When you're done, PM me a github link and I can port it to some standard text preprocessor for you, then put it in the shared code! This looks really useful, Ive always needed a better way of doing shader/client interoperability like checking for primitives and all.

 3 
 on: 2016-06-27 02:30:28 
Started by BurntPizza - Last post by theagentd
So I finally got time to sit down and play with my GLSL preprocessor. Got quite a bit on the way, but I realized halfway through that I'll need to restructure the whole thing quite a bit. Regardless, it's gotten fairly useful already.

Set/struct definition file:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
$struct MyStruct{
   vec4 structVec;
   vec4 structVec2;
}

$struct My_Struct2{
   MyStruct struct;
   vec4 structVec;
   vec4[3] blargh;
}
/*
   Random star comment.
*/


$set MySet{
   $uniform uniformBuffer std140 {
      MyStruct myStruct;
      vec4
       testVec4;
   }
   //Comment.
   $sampler2D randomTexture;
   $subpassInput2D subpassInput;
}


Shader definition file:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
//Random comment!
$importstruct MyStruct

$importset
//Another comment in the middle of a $ command (and this comment also has a special character in it!)
/*And a star comment as well!
*/

      MySet

/**/
out vec4 fragColor;

//It really gets rid of all comments. >___>
/*
It can handle star comments now!


asdasdasd
*/


void main(){
   fragColor = uniformBuffer.myStruct.structVec + uniformBuffer.testVec4 + texture(randomTexture, vec2(0)) + subpassLoad(subpassInput);
}



This input produced the following GLSL code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
#version 330

#define subpassLoad(x) texelFetch(x, ivec2(gl_FragCoord.xy), 0)

struct MyStruct{
    vec4 structVec;
    vec4 structVec2;
};

layout(std140) uniform uniformBuffer{
    MyStruct myStruct;
    vec4 testVec4;
} uniformBuffer;
uniform sampler2D randomTexture;
uniform sampler2D subpassInput;
 


out vec4 fragColor;



void main(){
   fragColor = uniformBuffer.myStruct.structVec + uniformBuffer.testVec4 + texture(randomTexture, vec2(0)) + subpassLoad(subpassInput);
}

It compiles! This is meant for OpenGL, emulating certain features. Descriptor sets are broken up to "free" uniform samplers and uniform buffers, subpass inputs are changed to normal textures with texelFetch() to read from them. It'll be easy to implement OpenGL ES and Vulkan support for the output writer, but I'll need to restructure the system a bit. I forgot I need to output extra info about descriptor sets and other things as well (and that Vulkan will output SPIR-V instead of GLSL). xd

EDIT: Added support for star comments (/* */)

 4 
 on: 2016-06-27 02:04:54 
Started by TritonDreyja - Last post by TritonDreyja
New video up
<a href="http://www.youtube.com/v/bOai1mZT31c?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/bOai1mZT31c?version=3&amp;hl=en_US&amp;start=</a>

 5 
 on: 2016-06-27 00:44:49 
Started by shadowstryker - Last post by Ecumene
-snip-


 6 
 on: 2016-06-27 00:29:17 
Started by Hydroque - Last post by Ecumene
Somebody move this to the What I did today thread, and move this comment to the chitchat monster.

I think this is a good topic!

I really like reflections, and when light refracts into things.

Real world example of Snell's Law:


I'm even more interested in translating real-world camera features into OpenGL (like different lense properties and exposure, ect.) toddyhancer is legendary for making good looking games truly "photo-realistic".

 7 
 on: 2016-06-26 23:29:21 
Started by BurntPizza - Last post by delt0r
In the weekend i got Droid Assault from puppy games. It is AWESOME and also rather close to what i am making. Easily their best game. And good to know it really is as much fun as i suspected. I may have lost a bit of time playing it... And always trying to capture that other droid... I got the emp one once. That didn't end well.

But sigh.. i work and work and get further and further behind! It is like a real job.

 8 
 on: 2016-06-26 22:16:24 
Started by shadowstryker - Last post by ra4king
Hydro, heed theagentd's words and don't easily dismiss them. You are aware that you feel most people aren't being nice to you. A rational person wouldn't blame the others for "hating" but would look inwards to see what they might be doing wrong.

 9 
 on: 2016-06-26 21:55:25 
Started by CoDi^R - Last post by Rayvolution
Awesome pixel-fu you got there. Wink

 10 
 on: 2016-06-26 19:52:00 
Started by Hydroque - Last post by theagentd
Somebody move this to the What I did today thread, and move this comment to the chitchat monster.

Pages: [1] 2 3 ... 10
 
CopyableCougar4 (30 views)
2016-06-25 16:56:52

Hydroque (65 views)
2016-06-22 02:17:53

SwampChicken (67 views)
2016-06-20 13:22:57

SwampChicken (67 views)
2016-06-20 13:22:49

SwampChicken (63 views)
2016-06-20 13:22:26

Hydroque (106 views)
2016-06-15 08:22:50

Hydroque (99 views)
2016-06-13 06:40:55

DarkCart (223 views)
2016-05-29 02:30:33

Hydroque (182 views)
2016-05-26 14:45:46

Mac70 (178 views)
2016-05-24 21:16:33
Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42

FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!