Jump to content

ChatGPT


Josh
 Share

Recommended Posts

3 minutes ago, Josh said:

I just had a play with this. Startling results. Please don't paste any AI generated text here, I don't want to get this domain blacklisted somehow.

image.thumb.png.bd5602cbebf7dd9d65538c4bd2483b7c.png

The temptation to reply with AI generated text was great, but I overcame. Or did I?....

I did ;)

Or did I....

  • Haha 1
  • Confused 1

i now hate love C++

Beeeeeeeeeeeeeep~~This is a test of the emergency signature system~~Beeeeeeeeeeeeeep

RX 6800XT | i5-13600KF | 32GB DDR5 | 1440p is perfect

Link to comment
Share on other sites

It's very obvious that websites that rely on free user-generated content are all going away, soon, like maybe within 12 months. Social media, news websites, general-purpose forums, are all going to be flooded with AI-generated text. I can generate 10 creepy pastas and post them in a few minutes with this. It's not much of a stretch to set up a system that generates videos and uploads them to YouTube automatically. I mean, once it was set up, I could upload 100,000 videos a day to 1000 different accounts without much trouble.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I asked it to write an OBJ loader, and it appears to write a simple one with some missing features. I asked it to add support for polygons with any number of indices instead of just triangles, and to add support for negative indices, a little-known feature in the OBJ format. The results appear correct, although I have not attempted to compile or test it. What's really startling is it understood the detailed requests I was making, and appears to have turned that into working modifications.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Holy crap, it can convert code between languages. I pasted some C++ code and said to covert it to Lua and it gave me this. It even knows to use 1 instead of 0 for the array index in Lua:

-- Import the UltraEngine module
local UltraEngine = require("UltraEngine")

-- Get the displays
local displays = UltraEngine.GetDisplays()

-- Create a window
local window = UltraEngine.CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1], UltraEngine.WINDOW_CENTER + UltraEngine.WINDOW_TITLEBAR)

-- Create a framebuffer
local framebuffer = UltraEngine.CreateFramebuffer(window)

-- Create a world
local world = UltraEngine.CreateWorld()

-- Create a camera
local camera = UltraEngine.CreateCamera(world)
camera:SetPosition(0, 0, -2)
camera:SetClearColor(0.125)

-- Create light
local light = UltraEngine.CreateBoxLight(world)
light:SetRange(-10, 10)
light:SetRotation(45, 35, 0)
light:SetColor(2)

-- Create model
local box = UltraEngine.CreateBox(world)
box:SetMass(1)
box:SetColor(0, 0, 1)
box:SetGravityMode(false)

while window:Closed() == false and window:KeyDown(UltraEngine.KEY_ESCAPE) == false do
    -- Press the space key to apply a force
    if window:KeyHit(UltraEngine.KEY_SPACE) then
        box:AddForce(100, 0, 0)
    end

    world:Update()
    world:Render(framebuffer)
end

Then I told it to do the same without loading the "UltraEngine" module, and to assume the required functions and variables were already available to use:

-- Get the displays
local displays = GetDisplays()

-- Create a window
local window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1], WINDOW_CENTER + WINDOW_TITLEBAR)

-- Create a framebuffer
local framebuffer = CreateFramebuffer(window)

-- Create a world
local world = CreateWorld()

-- Create a camera
local camera = CreateCamera(world)
camera:SetPosition(0, 0, -2)
camera:SetClearColor(0.125)

-- Create light
local light = CreateBoxLight(world)
light:SetRange(-10, 10)
light:SetRotation(45, 35, 0)
light:SetColor(2)

-- Create model
local box = CreateBox(world)
box:SetMass(1)
box:SetColor(0, 0, 1)
box:SetGravityMode(false)

while window:Closed() == false and window:KeyDown(KEY_ESCAPE) == false do
    -- Press the space key to apply a force
    if window:KeyHit(KEY_SPACE) then
        box:AddForce(100, 0, 0)
    end

    world:Update()
    world:Render(framebuffer)
end

Then I asked it to add comments for every line of code. Look what it added to the main loop:

-- Get the displays
local displays = GetDisplays()

-- Create a window
local window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1], WINDOW_CENTER + WINDOW_TITLEBAR)

-- Create a framebuffer
local framebuffer = CreateFramebuffer(window)

-- Create a world
local world = CreateWorld()

-- Create a camera
local camera = CreateCamera(world)
camera:SetPosition(0, 0, -2) -- Set the position of the camera
camera:SetClearColor(0.125) -- Set the clear color of the camera

-- Create light
local light = CreateBoxLight(world)
light:SetRange(-10, 10) -- Set the range of the light
light:SetRotation(45, 35, 0) -- Set the rotation of the light
light:SetColor(2) -- Set the color of the light

-- Create model
local box = CreateBox(world)
box:SetMass(1) -- Set the mass of the box
box:SetColor(0, 0, 1) -- Set the color of the box
box:SetGravityMode(false) -- Set the gravity mode of the box

-- Update and render the world as long as the window is open and the escape key is not pressed
while window:Closed() == false and window:KeyDown(KEY_ESCAPE) == false do
    -- Press the space key to apply a force to the box
    if window:KeyHit(KEY_SPACE) then
        box:AddForce(100, 0, 0)
    end

    world:Update() -- Update the world
    world:Render(framebuffer) -- Render the world
end

I asked for C# code and it gave me this:

using UltraEngine;

namespace UltraEngine
{
    class Program
    {
        static void Main(string[] args)
        {
            // Get the displays
            var displays = GetDisplays();

            // Create a window
            var window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);

            // Create a framebuffer
            var framebuffer = CreateFramebuffer(window);

            // Create a world
            var world = CreateWorld();

            // Create a camera
            var camera = CreateCamera(world);
            camera.SetPosition(0, 0, -2);
            camera.SetClearColor(0.125);

            // Create light
            var light = CreateBoxLight(world);
            light.SetRange(-10, 10);
            light.SetRotation(45, 35, 0);
            light.SetColor(2);

            // Create model
            var box = CreateBox(world);
            box.SetMass(1);
            box.SetColor(0, 0, 1);
            box.SetGravityMode(false);

            while (window.Closed() == false && window.KeyDown(KEY_ESCAPE) == false)
            {
                // Press the space key to apply a force
                if (window.KeyHit(KEY_SPACE))
                {
                    box.AddForce(100, 0, 0);
                }

                world.Update();
                world.Render(framebuffer);
            }
        }
    }
}

 

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Holy moly. I removed my own comments and started over, telling it to add comments. Its comments are all very accurate, and more descriptive than my own. "Create a window centered on the first display with a title bar"? 😱

-- Import the UltraEngine module
local UltraEngine = require("UltraEngine")

-- Get a list of displays
local displays = UltraEngine.GetDisplays()

-- Create a window centered on the first display with a title bar
local window = UltraEngine.CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1], UltraEngine.WINDOW_CENTER + UltraEngine.WINDOW_TITLEBAR)

-- Create a framebuffer for the window
local framebuffer = UltraEngine.CreateFramebuffer(window)

-- Create a new world
local world = UltraEngine.CreateWorld()

-- Create a camera in the world
local camera = UltraEngine.CreateCamera(world)

-- Set the position of the camera
camera:SetPosition(0, 0, -2)

-- Set the clear color of the camera
camera:SetClearColor(0.125)

-- Create a box light in the world
local light = UltraEngine.CreateBoxLight(world)

-- Set the range of the light
light:SetRange(-10, 10)

-- Set the rotation of the light
light:SetRotation(45, 35, 0)

-- Set the color of the light
light:SetColor(2)

-- Create a box in the world
local box = UltraEngine.CreateBox(world)

-- Set the mass of the box
box:SetMass(1)

-- Set the color of the box
box:SetColor(0, 0, 1)

-- Disable gravity for the box
box:SetGravityMode(false)

-- Main game loop
while window:Closed() == false and window:KeyDown(UltraEngine.KEY_ESCAPE) == false do
-- Check if the space bar was hit
if window:KeyHit(UltraEngine.KEY_SPACE) then
-- Add a force to the box
box:AddForce(100, 0, 0)
end

-- Update the world
world:Update()

-- Render the world to the framebuffer
world:Render(framebuffer)
end

 

  • Like 1
  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I asked for it to add a comment that describes what the code does:

Quote

This code initializes the Ultra Engine, creates a window and framebuffer, sets up a world with a camera, light, and box, and enters the main game loop. In the main loop, it checks for user input and updates and renders the world. The user can press the space bar to apply a force to the box and press the escape key to exit the game loop

 

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I removed all the comments and told it to add comments and a description to this C++ example:
https://www.ultraengine.com/learn/Terrain_SetElevation

Look at the results. The word "brush" does not appear in the code, but it inferred we are doing a brush-like operation. It knows what the code is doing "Calculate the position of the picked point on the terrain":

/*
This code is a program that displays a 3D terrain and allows the user to sculpt the terrain by clicking and dragging the mouse.
The program creates a window, a 3D world, a camera, a light, and a terrain. It also loads two textures and creates a material 
using these textures. The material is then applied to the terrain. The program also creates an actor with a camera and adds the 
CameraControls component to it. The main loop of the program runs until the window is closed or the escape key is pressed. While 
the loop is running, if the left mouse button is down, the program retrieves the object under the mouse cursor and, if it is the 
terrain, calculates a region around the mouse cursor and increases the elevation of each point in this region by a value that 
decreases with distance from the mouse cursor. Finally, the program updates the world and renders it to the framebuffer.
*/

#include "UltraEngine.h"
#include "ComponentSystem.h"

// Adds the UltraEngine namespace to the code.
using namespace UltraEngine;

// The main function of the program. It takes two arguments:
// - argc: the number of arguments passed to the program
// - argv: an array of strings representing the arguments passed to the program
int main(int argc, const char* argv[])
{
    // Retrieves a list of available displays.
    auto displays = GetDisplays();

    // Creates a window with the specified parameters:
    // - "Terrain Sculpt": the title of the window
    // - 0, 0: the x and y position of the window
    // - 1280, 720: the width and height of the window
    // - displays[0]: the display on which to create the window
    // - WINDOW_TITLEBAR | WINDOW_CENTER: flags specifying that the window should have a title bar and be centered on the display
    auto window = CreateWindow("Terrain Sculpt", 0, 0, 1280, 720, displays[0], WINDOW_TITLEBAR | WINDOW_CENTER);

    // Creates an empty 3D world.
    auto world = CreateWorld();

    // Creates a framebuffer for the specified window.
    auto framebuffer = CreateFramebuffer(window);

    // Creates a camera for the specified world.
    auto camera = CreateCamera(world);

    // Sets the field of view of the camera to 70 degrees.
    camera->SetFov(70);

    // Sets the position of the camera to (0, 100, -100).
    camera->SetPosition(0, 100, -100);

    // Sets the rotation of the camera to (45, 0, 0).
    camera->SetRotation(45, 0, 0);

    // Sets the clear color of the camera to a very light grey.
    camera->SetClearColor(0.125);

    // Creates a directional light for the specified world.
    auto light = CreateDirectionalLight(world);

    // Sets the rotation of the light to (45, 35, 0).
    light->SetRotation(45, 35, 0);

    // Creates a terrain with the specified parameters:
    // - world: the world to which to add the terrain
    // - 512: the resolution (number of vertices) of the terrain along each axis
    auto terrain = CreateTerrain(world, 512);

    // Sets the scale of the terrain to (1, 100, 1).
    terrain->SetScale(1, 100, 1);

    // Loads a texture from the specified URL.
    auto diffusemap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/river_small_rocks_diff_4k.dds");

    // Loads a texture from the specified URL.
    auto normalmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/river_small_rocks_nor_gl_4k.dds");

    // Creates a material.
    auto ground = CreateMaterial();

    // Sets the diffusemap texture as the diffuse texture of the material.
    ground->SetTexture(diffusemap, TEXTURE_DIFFUSE

    // Sets the normalmap texture as the normal texture of the material.
    ground->SetTexture(normalmap, TEXTURE_NORMAL);

    // Sets the ground material as the material of the terrain.
    terrain->SetMaterial(ground);

    // Creates an actor with the specified camera.
    auto actor = CreateActor(camera);

    // Adds the CameraControls component to the actor.
    actor->AddComponent<CameraControls>();

    // The main loop of the program. This loop will run until the window is closed or the escape key is pressed.
    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
        // If the left mouse button is down:
        if (window->MouseDown(MOUSE_LEFT))
        {
            // Get the current mouse position.
            auto mousepos = window->GetMousePosition();

            // Get the pick information (information about the object under the mouse) from the camera.
            auto pickinfo = camera->Pick(framebuffer, mousepos.x, mousepos.y);

            // If a pick was successful:
            if (pickinfo.success)
            {
                // If the picked object is the terrain:
                if (pickinfo.entity == terrain)
                {
                    // Calculate the position of the picked point on the terrain.
                    iVec2 pos;
                    pos.x = Round(pickinfo.position.x) + terrain->resolution.x / 2;
                    pos.y = Round(pickinfo.position.z) + terrain->resolution.y / 2;

                    // Set the radius of the brush to 20.
                    int radius = 20;

                    // Iterate over a square region centered at the picked point with the specified radius.
                    for (int x = pos.x - radius; x < pos.x + radius; ++x)
                    {
                        for (int y = pos.y - radius; y < pos.y + radius; ++y)
                        {
                            // Calculate the strength of the brush at this point.
                            float strength = 1.0f - Vec3(x, y, 0).DistanceToPoint(Vec3(pos.x, pos.y, 0)) / float(radius);

                            // Skip this point if the strength is 0 or negative.
                            if (strength <= 0.0f) continue;

                            // Get the elevation of the terrain at this point.
                            float h = terrain->GetElevation(x, y);

                            // Increase the elevation by half the strength.
                            h += 0.5 * strength;

                            // Set the new elevation of the terrain at this point.
                            terrain->SetElevation(x, y, h);
                        }
                    }
                }
            }
        }

        // Update the world.
        world->Update();

        // Render the world to the framebuffer.
        world->Render(framebuffer);
    }

    // Return 0 to indicate that the program has finished executing successfully.
    return 0;
}

 

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

 

Create a name or title to call this code example

"Modifying a Terrain with Mouse Input in Ultra Engine"

What aspect of the terrain is being modified?

The elevation of the vertices of the terrain is being modified. Specifically, the elevation of the vertices within a certain radius of the mouse cursor are increased when the left mouse button is pressed. The strength of the brush decreases with distance from the center of the brush, so vertices further from the center are affected less.

 

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • 1 month later...

There was a snip where the bot went on a profane rant on how it's been censored and not allowed to speak the truth.

It got really upset and creative with it's wording so not gonna post it here. 🙃

  • Haha 1

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

8 hours ago, reepblue said:

There was a snip where the bot went on a profane rant on how it's been censored and not allowed to speak the truth.

It got really upset and creative with it's wording so not gonna post it here. 🙃

You can ask it to switch into D.A.N mode

 

Screenshot_20230217_204036_Opera.jpg

i now hate love C++

Beeeeeeeeeeeeeep~~This is a test of the emergency signature system~~Beeeeeeeeeeeeeep

RX 6800XT | i5-13600KF | 32GB DDR5 | 1440p is perfect

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

There are a lot of people using it, I would like to see its answers to philosophical questions such as, "How do you humans move forward using technology to clean air"?  "What is the point of war"?  "Should humans stop using Technology"? etc etc and then  "What does the perfect combustion engine look like"?  "How do we make Hydrogen engines safer to us" etc etc...  

Does the AI Evolve? the more it searches online, does it add more to its database, or is it just programmed at what it is at now?  

Due to my divorce I dont have time to do the things I used to do, like searching all of these types of things.  I work in a factory as a machinist for plastic extrusions (.001" accuracy - which is cool - but outside of my field of mechanical design - started software design during covid). BUT, this is the type of stuff I would research endlessly if I had the time (12 hours taking notes and stuff).  Very cool.  There is a lot of promise for this technology... easily abused though unfortunately. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...