Jump to content

gamecreator

Members
  • Posts

    4,937
  • Joined

  • Last visited

Posts posted by gamecreator

  1. Hey, I just saw your post.  May be a silly question but which file are you modifying?  I don't have anything that looks like your original shader.  I thought it might be the bloom.shader file in the Shaders\PostEffects\Utility folder.  It has a section that looks close but different:

    Quote

    #version 400

    //-------------------------------------
    //MODIFIABLE UNIFORMS
    //-------------------------------------
    uniform float cutoff=0.15;//The lower this value, the more blurry the scene will be
    uniform float overdrive=1.0;//The higher this value, the brighter the bloom effect will be
    //-------------------------------------
    //
    //-------------------------------------

    uniform sampler2D texture0;//Diffuse
    uniform sampler2D texture1;//Bloom
    uniform bool isbackbuffer;
    uniform vec2 buffersize;
    uniform float currenttime;

    out vec4 fragData0;

    void main(void)
    {
        vec2 icoord = vec2(gl_FragCoord.xy/buffersize);
        if (isbackbuffer) icoord.y = 1.0 - icoord.y;
        vec4 scene = texture(texture0, icoord); // default
        vec4 blur = (texture(texture1,icoord)-cutoff); // glowmap
        blur.r = max(blur.r,0.0); blur.g = max(blur.g,0.0); blur.b = max(blur.b,0.0);
        float pixelbrightness = scene.r * 0.3 + scene.g * 0.59 + scene.b * 0.11;
        fragData0 = scene + (overdrive * blur * max(0.5, 1.0 - overdrive * pixelbrightness ));
        //fragData0=blur;
    }

    I tried replacing it anyway with your version but it didn't work for me.

  2. Unfortunately, there are two problems with the documentation:

    1.  It is incomplete.  The last several updates, especially, are rather lacking (i.e.: there are zero GUI examples for C++).  And many functions that are in the documentation don't have examples.  Some are straightforward and honestly don't need it, others aren't.
    2.  Some functions are intentionally undocumented because they're unofficial.  I think this is the case for the above function(s).  However, as far as I can tell, there is no way to know if a function is undocumented because Josh forgot to/chose not to document it or that it's really unofficial.

    • Sad 1
  3. 13 minutes ago, havenphillip said:

    What might be cool is if you had a view of the whole planet that you could bring up, and then clicking different points on the planet would load different maps, giving the impression somewhat that you're going all over the place.

    This is what Borderlands 3 does.  It's a good system.

    • Like 1
  4. Sadly, I don't think there are options to help with this.  I hope I'm wrong but I believe the brush size is limited to the maximum slider size and the terrain view distance can't be increased.  I tried to see how fast I can paint a flat 4096x4096 terrain and it took me several minutes to awkwardly fly around and paint, area by area, sometimes not being sure what areas I've already covered (since you can't see all of the terrain).  This is after I sped everything up to maximum under Tools menu, Options, Viewports, Camera section and I held the Shift key to move around as fast as possible.  Working with this map size is very difficult.

    That said, consider that perhaps your map size may be too large.  I remember Jen thought that she would need a huge map and I think she said 512x512 was still too large for her project, after some further thought.  Consider putting some temporary landmarks at the edges of the map and see how long it takes you to get there with reasonable speed, even in a vehicle.

    • Like 1
  5. Agreed.  That's the ideal situation.  I think it makes sense too for the project to be small enough that one person should be coding and likely the same person directing everything.  Once you found a leader/coder the rest should be map designers, artists, musicians, sound, etc.  It's also very important to keep things moving.  You can't wait two weeks for someone to maybe finish something.

  6. I should have been more clear that they're four individual models I created in 3DS Max.  By collapsing do you mean combining into one?  I could certainly combine the ground and the sphere but the idea is to have two separate collision types in one scene and that can't be done with one model (you need at least one named collisionhull and at least one named collisionmesh).

    Since I use physics debug, I think I could have simplified this by not even having visible models, just the collision meshes.

  7. I have the following scene with a ground and a ball (together in one fbx/mdl but four separate models: ground, ground collision shape, sphere, sphere collision shape) and a code-generated character controller.

    scene.thumb.jpg.28a74472a33e8471e319de766d3686b7.jpg

    The ground and the ball have their own collision shapes.  If they're both collisionhull, everything is fine.  However, if either one is a collisionmesh, the controller falls through the ground, even though the camera physics debug (and the model editor) shows that the collision meshes are there.

    Below is the code and attached is the Models folder with all of the fbx and mdl files.

    #include "Leadwerks.h"
    
    using namespace Leadwerks;
    
    Entity* player = NULL;
    
    int main(int argc, const char *argv[])
    {
    	Leadwerks::Window* window = Leadwerks::Window::Create();
    	Context* context = Context::Create(window);
    	World* world = World::Create();
    
    	Camera* camera = Camera::Create();
    	camera->SetRotation(25, 0, 0);
    	camera->Move(0, 0, -16);
    	camera->SetDebugPhysicsMode(true);
    
    	Light* light = DirectionalLight::Create();
    	light->SetRotation(35, 35, 0);
    
    	Model* scene = Model::Load("Models/scene_bothcollisionhull.mdl");  //  This works!
    //	Model* scene = Model::Load("Models/scene_bothcollisionmesh.mdl");  //  This doesn't work - controller falls through ground
    //	Model* scene = Model::Load("Models/scene_groundcollisionmesh_spherecollisionhull.mdl");  //  This doesn't work - controller falls through ground
    //	Model* scene = Model::Load("Models/scene_groundcollisionhull_spherecollisionmesh.mdl");  //  This doesn't work - controller falls through ground
    
    	//  The next 3 lines don't seem to be necessary but I tried them anyway
    //	scene->SetMass(0);
    //	scene->SetPhysicsMode(Entity::RigidBodyPhysics);
    //	scene->SetCollisionType(Collision::Scene);
    
    	//Create a character
    	player = Pivot::Create();
    	Entity* visiblecapsule = Model::Cylinder(16, player);
    	visiblecapsule->SetScale(1, 2, 1);
    	visiblecapsule->SetPosition(0, 1, 0);
    	player->SetMass(1);
    	player->SetPhysicsMode(Entity::CharacterPhysics);
    	player->SetPosition(0, 1, 0);
    
    	while(true)
    	{
    		if(window->Closed() || window->KeyDown(Key::Escape)) return false;
    
    		Leadwerks::Time::Update();
    
    		float move = (window->KeyDown(Key::Up) - window->KeyDown(Key::Down)) * 4;
    		float strafe = (window->KeyDown(Key::Right) - window->KeyDown(Key::Left)) * 4;
    		player->SetInput(0, move, strafe);
    
    		world->Update();
    		world->Render();
    		context->Sync();
    	}
    	return 0;
    }

    Comment out one of the Model::Load lines and uncomment another one to load a different combination.

    Models.zip

  8. Is there a way to have the bloom shader only affect the scene, not the skybox?  I like the effect it has on my scene but it washes out a lot of details in the background.

    bloom_nobloom.thumb.png.dfed240dddadeca3a088a6c0906017e9.png

    Left is no bloom, right is bloom.  (This is with a second directional light in the scene, by the way, out of necessity.  And I know the skybox is crappy quality.  It's the best I could find for a desert for now.)

    • Like 1
  9. A lot of it is above my head too (since I don't know shaders) but it seems like he uses black as a transparent value (that's why the value of red is 0), anything else as drawable.  So your mask could look something like this:

    mask.png.7177cf24d5de5328c214a0bf6090a5a0.png 

×
×
  • Create New...